Rollup interactions.R

This commit is contained in:
2024-08-10 09:54:01 -04:00
parent 9f541115eb
commit db92aea17d
248 changed files with 3197 additions and 4759 deletions

View File

@@ -1,7 +1,5 @@
%% CALLED BY EASYconsole.m %%
% Updated 240724 Bryan C Roessler to improve file operations and portability
%
global projectScansDir
global projectName
global matFile
global defImParMat
global printResultsDir
@@ -27,7 +25,7 @@ end
% MPnum=ImParMat(1);
% opt=questdlg('Print Results Only (RES), DB Only (DB), or Both','Results Printout Options','Res','DB','Both','Both');
opt='Res';
if ~exist('defImParMat','var') || isempty(defImParMat) % TODO needs better explanation
if ~exist('defImParMat','var') || isempty(defImParMat) % TODO needs explanation
load(pointMapsFile);
end
destPerMP=ImParMat(2); % TODO this is weird, needs explanation
@@ -37,7 +35,7 @@ numOfDrgs=length(DM.drug);
numOfMeds=length(DM.media);
destPerMP=numOfDrgs;
% TODO this should be rewritten or is uncessary, what is this for
% TODO this should be rewritten or is unnecessary, what is this for
% Determine the longest set of intensity(tPts) for the Experiment Data Set
maxNumIntens=0;
for n=1:size(scan,2)
@@ -53,22 +51,12 @@ end
% end
% TODO this seems weird
expNm=projectScansDir(max(strfind(projectScansDir,'/'))+1:end);
drivePos=min(strfind(projectScansDir,'/'));
drive=projectScansDir(1:(drivePos-1));
DBupload=fullfile(drive,'EZdbFiles','DBupLOADfiles');
% DBupload=fullfile(drive,'EZdbFiles','DBupLOADfiles');
% Added to allow backward compatability
% Test for CFoutStd as indication of 2018version with r_refined fit code;If
% earlier version with only a standard composite fite, Print results to !!ResultsStd_...txt only
try
scan(1).plate(1).CFoutStd(1,1);
resultsFilename=fullfile(printResultsDir, strcat('!!ResultsELr_',expNm,'.txt'));
DBfilename=fullfile(printResultsDir, strcat('!!DbaseELr_',expNm,'.txt'));
catch
resultsFilename=fullfile(printResultsDir, strcat('!!ResultsStd_',expNm,'.txt'));
DBfilename=fullfile(printResultsDir, strcat('!!DbaseStd_',expNm,'.txt'));
end
resultsFilename=fullfile(printResultsDir, 'results_elr.txt');
DBfilename=fullfile(printResultsDir, 'DbaseELr.txt');
if isequal(opt,'Res')||isequal(opt,'Both'),fid=fopen(resultsFilename,'w');end
if isequal(opt,'DB')||isequal(opt,'Both'),fid2=fopen(DBfilename,'w');end
@@ -271,7 +259,7 @@ for s=1:size(scan,2)
end
if isequal(opt,'DB')||isequal(opt,'Both')
fprintf(fid2,'%s\t %d\t %d\t %d\t %d\t %d\t %s\t %s\t %s\t %s\t %s\t %s\t %s\t %s\t %s\t %s\t',expNm,s,p,r,c,n,selcode,drug,conc,media,mod1,conc1,mod2,conc2,orf,gene);
fprintf(fid2,'%s\t %d\t %d\t %d\t %d\t %d\t %s\t %s\t %s\t %s\t %s\t %s\t %s\t %s\t %s\t %s\t',projectName,s,p,r,c,n,selcode,drug,conc,media,mod1,conc1,mod2,conc2,orf,gene);
fprintf(fid2, '%.5f\t %.5f\t %.5f\t %.5f\t %.5f\t %.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f',...
outCmat(n,1),riseTm,outCmat(n,3),outCmat(n,4),...
outCmat(n,5),dbRsq,dbKup,dbKlo,dbrup,dbrlo,dbLlo,dbLup); %\t%.5f\t%.5f\t%.5f\t%.5f
@@ -361,24 +349,24 @@ if isequal(opt,'Res')||isequal(opt,'Both')
fclose(fid);
end
if isequal(opt,'DB')||isequal(opt,'Both')
fclose(fid2);
try
copyfile(DBfilename,DBupload)
catch ME
fprintf('DB upload failed with error: %s\n', getReport(ME, 'basic'));
rep=sprintf('Failed copyfile to %s - %s', DBupload, rep);
errordlg(rep);
end
end
% if isequal(opt,'DB')||isequal(opt,'Both')
% fclose(fid2);
% try
% copyfile(DBfilename,DBupload)
% catch ME
% fprintf('DB upload failed with error: %s\n', getReport(ME, 'basic'));
% rep=sprintf('Failed copyfile to %s - %s', DBupload, rep);
% errordlg(rep);
% end
% end
% Print results using the standard method
try
scan(1).plate(1).CFoutStd(1,1) %Test for 2018 r_refined version
ln=1;
resultsFilename=fullfile(printResultsDir, strcat('!!ResultsStd_',expNm,'.txt'));
DBfilename=fullfile(printResultsDir, strcat('!!DbaseStd_',expNm,'.txt'));
resultsFilename=fullfile(printResultsDir, 'results_std.txt');
DBfilename=fullfile(printResultsDir, 'DbaseStd.txt');
if isequal(opt,'Res')||isequal(opt,'Both'),fid=fopen(resultsFilename,'w');end
if isequal(opt,'DB')||isequal(opt,'Both'),fid2=fopen(DBfilename,'w');end %121012 Combo
if isequal(opt,'Res')||isequal(opt,'Both') %print Results
@@ -553,7 +541,7 @@ try
end
if isequal(opt,'DB')||isequal(opt,'Both')
fprintf(fid2,'%s\t %d\t %d\t %d\t %d\t %d\t %s\t %s\t %s\t %s\t %s\t %s\t %s\t %s\t %s\t %s\t',expNm,s,p,r,c,n,selcode,drug,conc,media,mod1,conc1,mod2,conc2,orf,gene);
fprintf(fid2,'%s\t %d\t %d\t %d\t %d\t %d\t %s\t %s\t %s\t %s\t %s\t %s\t %s\t %s\t %s\t %s\t',projectName,s,p,r,c,n,selcode,drug,conc,media,mod1,conc1,mod2,conc2,orf,gene);
fprintf(fid2, '%.5f\t %.5f\t %.5f\t %.5f\t %.5f\t %.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f\t%.5f',...
outCmat(n,1),riseTm,outCmat(n,3),outCmat(n,4),...
outCmat(n,5),dbRsq,dbKup,dbKlo,...
@@ -649,20 +637,20 @@ try
fclose(fid);
end
if isequal(opt,'DB')||isequal(opt,'Both')
fclose(fid2);
try
copyfile(DBfilename,DBupload)
catch ME
fsprintf('DB upload failed with error: %s\n', getReport(ME, 'basic'));
rep=sprintf('Failed copyfile to %s - %s\n', DBupload, rep);
errordlg(rep)
end
end
% if isequal(opt,'DB')||isequal(opt,'Both')
% fclose(fid2);
% try
% copyfile(DBfilename,DBupload)
% catch ME
% fsprintf('DB upload failed with error: %s\n', getReport(ME, 'basic'));
% rep=sprintf('Failed copyfile to %s - %s\n', DBupload, rep);
% errordlg(rep)
% end
% end
msgbox([sprintf('Printing Script complete. Check !!Results sheets in %s for results.', printResultsDir)])
msgbox([sprintf('Printing script complete. Check results sheets in %s for results.', printResultsDir)])
catch ME
fprintf('Printing Script failed with error: %s\n', getReport(ME, 'basic'));
fprintf('Printing script failed with error: %s\n', getReport(ME, 'basic'));
end

View File

@@ -141,8 +141,7 @@ function varargout = EASYconsole(varargin)
if ~isempty(getenv('MASTER_PLATE_FILE'))
masterPlateFile=fullfile(getenv('MASTER_PLATE_FILE'));
fprintf('Using drug media file: %s from environment variable MASTER_PLATE_FILE\n', masterPlateFile);
else
% Try to find MasterPlate_ file on our own
else % try to find MasterPlate_ file on our own
mp=fullfile(easyResultsDir, strcat('MasterPlate_', projectName,'.xlsx'));
if exist(mp, 'file')
masterPlateFile=mp;
@@ -281,7 +280,7 @@ function NewExpDat_Callback(~, ~, ~)
% Create a new experiment
try
questdlg('\fontsize{20} NAME the file and NAVIGATE to the directory with the image folders.','File Creation','OK', struct('Default','OK','Interpreter','tex'));
questdlg('Name the file and navigate to the directory with the image folders.','File Creation','OK', struct('Default','OK','Interpreter','tex'));
[matfile,easyResultsDir]=uiputfile('.mat');
inputFileName=strrep(inputFile,'.mat','');

View File

@@ -791,7 +791,7 @@ function [Tmpsbdg2, scanIntens, F_spots, bmtp, optomizedPos, TmpexpScanIntens2,
else
refBG(1)=refP(1)-floor(0.5*(refP(1)-(refPrR(1)+widthEx)));
end
refBG(2)=refP(2)-floor(0.5*(refP(2)-(refPrC(2)+widthEx))); % return from lunch fix start here!!!!!
refBG(2)=refP(2)-floor(0.5*(refP(2)-(refPrC(2)+widthEx)));
if rem(r,numRows)==0
refBG(3)=refP(1)+widthEx+ floor(0.5*(plateBotSpace));
else

View File

@@ -1,5 +1,3 @@
%% CALLED BY EASYconsole.m %%
global SWgrowthArea
global scLst
global ImParMat
@@ -62,9 +60,9 @@ end
% after each run to allow previous version of EASY to access data made
% by EASY versions after 20_0819.
try
load(fullfile(fotosResultsDir,'Nbdg')); %Modified to load from 'Fotos' 20_0819
load(fullfile(fotosResultsDir,'Nbdg')); % modified to load from 'Fotos' 20_0819
catch
load(fullfile(pointMapsResultsDir,'Nbdg')); %Left in to accomodate loads of work before 20_0819
load(fullfile(pointMapsResultsDir,'Nbdg')); % left in to accomodate loads of work before 20_0819
end
% Load Fotos stored data
fotosToLoad={'Coordinates', 'BGatTpts', 'anlZones', 'NCFparms'};
@@ -211,11 +209,11 @@ end
% Save data in .mat files
save(matFile,'scan');
% save((fullfile(easyResultsDir,'PTmats','Nbdg')), 'sbdg'); %legacy location can probably get rid of in time
% save((fullfile(easyResultsDir,'PTmats','Nbdg')), 'sbdg'); % legacy location can probably get rid of in time
save((fullfile(fotosResultsDir,'Nbdg')), 'sbdg');
save((fullfile(fotosResultsDir,'Coordinates')),'FexpScanSpots') %Saves frames at each tPt
save((fullfile(fotosResultsDir,'Coordinates')),'FexpScanSpots') % saves frames at each tPt
save((fullfile(fotosResultsDir,'BGatTpts')),'FexpScanBMtp')
save((fullfile(fotosResultsDir,'anlZones')),'anlZoneRefs')%Saves anl Positions at each tPt
save((fullfile(fotosResultsDir,'anlZones')),'anlZoneRefs') % saves anl Positions at each tPt
% Print FitResults
fileExt='.txt';

File diff suppressed because it is too large Load Diff