Formatting

This commit is contained in:
2024-07-27 19:13:51 -04:00
parent 9057970706
commit b8ebff2c18
5 changed files with 66 additions and 62 deletions

View File

@@ -49,7 +49,7 @@ if ~exist(masterPlateFile, 'file') || isempty(masterPlateFile)
disp('Using newest MasterPlate file: ', masterPlateFile, ', skipping directory selection'); disp('Using newest MasterPlate file: ', masterPlateFile, ', skipping directory selection');
break break
catch ME catch ME
h = msgbox(ME.message, 'Error', 'error'); h=msgbox(ME.message, 'Error', 'error');
disp('Rerunning directory selection'); disp('Rerunning directory selection');
% I don't know what else we'll need to do here % I don't know what else we'll need to do here
end end
@@ -74,7 +74,7 @@ if ~exist(masterPlateFile, 'file') || isempty(masterPlateFile)
disp('Using newest MasterPlate file: ', masterPlateFile, ', skipping directory selection'); disp('Using newest MasterPlate file: ', masterPlateFile, ', skipping directory selection');
break break
catch ME catch ME
h = msgbox(ME.message, 'Error', 'error'); h=msgbox(ME.message, 'Error', 'error');
uiwait(h); uiwait(h);
disp('Rerunning directory selection'); disp('Rerunning directory selection');
% I don't know what else we'll need to do here % I don't know what else we'll need to do here
@@ -108,18 +108,18 @@ try
excLnNum=3; excLnNum=3;
while (isequal(txt{excLnNum,1},'###')) while (isequal(txt{excLnNum,1},'###'))
numb=numb+1; numb=numb+1;
MP(numb).head = {raw(excLnNum,2:6)}; MP(numb).head={raw(excLnNum,2:6)};
MP(numb).recNum = {raw((excLnNum+1):(excLnNum+384),1)}; MP(numb).recNum={raw((excLnNum+1):(excLnNum+384),1)};
MP(numb).orf = {raw((excLnNum+1):(excLnNum+384),2)}; MP(numb).orf={raw((excLnNum+1):(excLnNum+384),2)};
MP(numb).strain = {raw((excLnNum+1):(excLnNum+384),3)}; MP(numb).strain={raw((excLnNum+1):(excLnNum+384),3)};
MP(numb).genename= {raw((excLnNum+1):(excLnNum+384),12)}; MP(numb).genename={raw((excLnNum+1):(excLnNum+384),12)};
MP(numb).drug= {raw((excLnNum+1):(excLnNum+384),8)}; MP(numb).drug={raw((excLnNum+1):(excLnNum+384),8)};
MP(numb).media= {raw((excLnNum+1):(excLnNum+384),7)}; MP(numb).media={raw((excLnNum+1):(excLnNum+384),7)};
if size(raw,2)>15 if size(raw,2)>15
MP(numb).orfRep= {raw((excLnNum+1):(excLnNum+384),16)}; % added 12_1005 to specify replicates Orfs in MP MP(numb).orfRep={raw((excLnNum+1):(excLnNum+384),16)}; % added 12_1005 to specify replicates Orfs in MP
MP(numb).specifics= {raw((excLnNum+1):(excLnNum+384),17)}; % added 12_1008 to specify replicates Specific details in MP MP(numb).specifics={raw((excLnNum+1):(excLnNum+384),17)}; % added 12_1008 to specify replicates Specific details in MP
else else
MP(numb).orfRep= ' '; MP(numb).orfRep=' ';
MP(numb).specifics= ' '; MP(numb).specifics= ' ';
end end
% Future MP field % Future MP field
@@ -161,7 +161,7 @@ try
end end
end end
catch ME catch ME
h = msgbox(ME.message, 'Error', 'error'); h=msgbox(ME.message, 'Error', 'error');
uiwait(h); uiwait(h);
end end

View File

@@ -379,8 +379,8 @@ try
ln=1; ln=1;
resultsFilename=fullfile(printResultsDir, strcat('!!ResultsStd_',expNm,'.txt')); resultsFilename=fullfile(printResultsDir, strcat('!!ResultsStd_',expNm,'.txt'));
DBfilename=fullfile(printResultsDir, strcat('!!DbaseStd_',expNm,'.txt')); DBfilename=fullfile(printResultsDir, strcat('!!DbaseStd_',expNm,'.txt'));
if isequal(opt,'Res')||isequal(opt,'Both'),fid = fopen(resultsFilename,'w');end 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,'DB')||isequal(opt,'Both'),fid2=fopen(DBfilename,'w');end %121012 Combo
if isequal(opt,'Res')||isequal(opt,'Both') %print Results if isequal(opt,'Res')||isequal(opt,'Both') %print Results
fprintf(fid,'%d\t',ln); %Results header fprintf(fid,'%d\t',ln); %Results header
fprintf(fid,'%s\t\n',scansDir); fprintf(fid,'%s\t\n',scansDir);

View File

@@ -50,23 +50,27 @@ function varargout = EASYconsole(varargin)
fprintf('Using scans directory: %s from environment variable SCANS_DIR\n', scansDir); fprintf('Using scans directory: %s from environment variable SCANS_DIR\n', scansDir);
disp('This usually indicates that we are in module mode'); disp('This usually indicates that we are in module mode');
else else
dirToScan=fullfile(parentDir,'..','ExpJobs'); % hardcoded relative to easy script dir TODO: if we change pj layout this will change % Change these when modifying EASY_DIR in workflow
if exist(dirToScan, 'dir') fprintf('Beginning parent scans directory search\n');
dirs=dir(fullfile(dirToScan, 'dir')); % filter for dirs only fprintf('This usually indicates that we are in stand-alone mode without PROJECT or SCANS_DIR environment variables\n');
[~, sortedIndices]=sort(datenum({dirs.date}), 'descend'); % sort by newest first dirsToScan={
sortedDirs=dirs{sortedIndices}; fullfile(parentDir,'..', '..', 'scans'),
scansDir=sortedDirs{1}; fullfile(parentDir, '..', '..', 'ExpJobs'),
disp('Beginning in newest project scans directory'); fullfile('/mnt/data/scans'),
fprintf('Using scans directory: %s from hardcoded relative path\n', scansDir); fullfile('/mnt/data/ExpJobs'),
disp('This usually indicates that we are in stand-alone mode without PROJECT or SCANS_DIR environment variables'); fullfile(parentDir, '..', 'demo', '20240727_hartmanlab_demo_project')
else };
scansDir=fullfile(parentDir, '..', 'demo', '20240727_hartmanlab_demo_project'); for d=dirsToScan
if exist(scansDir, 'dir') if exist(d, 'dir')
demo=1; subDirs=dir(d);
fprintf('Using scans directory: %s from hardcoded absolute path to demo project\n', scansDir); if ~isempty(subDirs)
else fprintf('Found a non-empty parent scans directory in our list: %s\n', d);
fprintf('Error: demo project %s not found\n', scansDir); fprintf('Scanning inside for a project scan directory\n');
disp('Attempting to continue but this may get ugly'); [~, sortedIndices]=sort(datenum({dirs.date}), 'descend'); % sort by newest first
sortedDirs=dirs{sortedIndices};
scansDir=sortedDirs{1};
fprintf('Selected newest project scans directory: %s\n', scansDir);
end
end end
end end
end end

View File

@@ -124,7 +124,7 @@ end %function end $$$$$[/INST]
yPos=0.85-(lblNumber-1)*(btnHt+spacing); yPos=0.85-(lblNumber-1)*(btnHt+spacing);
btnPos=[xLPos yPos-spacing btnWid btnHt]; btnPos=[xLPos yPos-spacing btnWid btnHt];
htxt = uicontrol(... htxt=uicontrol(...
'Style', 'text',... 'Style', 'text',...
'String','BG Threshold (%above) Detection',... 'String','BG Threshold (%above) Detection',...
'Units','normalized',... 'Units','normalized',...
@@ -136,7 +136,7 @@ htxt = uicontrol(...
yPos=0.85-(lblNumber-1)*(btnHt+spacing); yPos=0.85-(lblNumber-1)*(btnHt+spacing);
btnPos=[xLPos yPos-spacing btnWid btnHt]; btnPos=[xLPos yPos-spacing btnWid btnHt];
htxt = uicontrol(... htxt=uicontrol(...
'Style', 'text',... 'Style', 'text',...
'String','SpotDetThres(1-60%)',... 'String','SpotDetThres(1-60%)',...
'Units','normalized',... 'Units','normalized',...
@@ -147,7 +147,7 @@ htxt = uicontrol(...
yPos=0.85-(lblNumber-1)*(btnHt+spacing); yPos=0.85-(lblNumber-1)*(btnHt+spacing);
btnPos=[xLPos yPos-spacing btnWid btnHt]; btnPos=[xLPos yPos-spacing btnWid btnHt];
htxt = uicontrol(... htxt=uicontrol(...
'Style', 'text',... 'Style', 'text',...
'String','Radius',... %'String','Width',... 'String','Radius',... %'String','Width',...
'Units','normalized',... 'Units','normalized',...
@@ -157,7 +157,7 @@ lblNumber=6;
yPos=0.85-(lblNumber-1)*(btnHt+spacing); yPos=0.85-(lblNumber-1)*(btnHt+spacing);
btnPos=[xLPos yPos-spacing btnWid btnHt]; btnPos=[xLPos yPos-spacing btnWid btnHt];
htxt = uicontrol(... htxt=uicontrol(...
'Style', 'text',... 'Style', 'text',...
'String','Dither',... 'String','Dither',...
'Units','normalized',... 'Units','normalized',...
@@ -168,7 +168,7 @@ lblNumber=7;
yPos=0.85-(lblNumber-1)*(btnHt+spacing); yPos=0.85-(lblNumber-1)*(btnHt+spacing);
btnPos=[xLPos yPos-spacing btnWid btnHt]; btnPos=[xLPos yPos-spacing btnWid btnHt];
htxt = uicontrol(... htxt=uicontrol(...
'Style', 'text',... 'Style', 'text',...
'String','SearchRange',... 'String','SearchRange',...
'Units','normalized',... 'Units','normalized',...
@@ -180,7 +180,7 @@ lblNumber=8;
yPos=0.85-(lblNumber-1)*(btnHt+spacing); yPos=0.85-(lblNumber-1)*(btnHt+spacing);
btnPos=[xLPos yPos-spacing btnWid btnHt]; btnPos=[xLPos yPos-spacing btnWid btnHt];
htxt = uicontrol(... htxt=uicontrol(...
'Style', 'text',... 'Style', 'text',...
'String','Blank2',... 'String','Blank2',...
'Units','normalized',... 'Units','normalized',...
@@ -199,7 +199,7 @@ btnNumber=6;
yPos=0.85-(btnNumber-1)*(btnHt+spacing); yPos=0.85-(btnNumber-1)*(btnHt+spacing);
btnPos=[xPos yPos-spacing btnWid btnHt]; btnPos=[xPos yPos-spacing btnWid btnHt];
srcExtendFactor=ImParMat(7); srcExtendFactor=ImParMat(7);
hedit = uicontrol(... hedit=uicontrol(...
'Style', 'edit',... 'Style', 'edit',...
'String',srcLoIntensThres,... 'String',srcLoIntensThres,...
'Units','normalized',... 'Units','normalized',...
@@ -207,7 +207,7 @@ hedit = uicontrol(...
'callback',{@entryExtendFactor}); 'callback',{@entryExtendFactor});
function entryExtendFactor(source,eventdata) function entryExtendFactor(source,eventdata)
user_entry = str2double(get(source,'string')); user_entry=str2double(get(source,'string'));
if (isnan(user_entry)||(user_entry<1.8)||(user_entry>4.0)) if (isnan(user_entry)||(user_entry<1.8)||(user_entry>4.0))
errordlg('You must enter a numeric value between 1.8 and 2.1','Bad Input','modal') errordlg('You must enter a numeric value between 1.8 and 2.1','Bad Input','modal')
return return
@@ -226,7 +226,7 @@ user_entry = str2double(get(source,'string'));
yPos=0.85-(btnNumber-1)*(btnHt+spacing); yPos=0.85-(btnNumber-1)*(btnHt+spacing);
btnPos=[xPos yPos-spacing btnWid btnHt]; btnPos=[xPos yPos-spacing btnWid btnHt];
srcBGthreshold=ImParMat(3); srcBGthreshold=ImParMat(3);
hedit = uicontrol(... hedit=uicontrol(...
'Style', 'edit',... 'Style', 'edit',...
'String',srcBGthreshold,... 'String',srcBGthreshold,...
'Units','normalized',... 'Units','normalized',...
@@ -234,7 +234,7 @@ hedit = uicontrol(...
'callback',{@entryBGthreshold}); % 'Position', [5 100 60 20]) 'callback',{@entryBGthreshold}); % 'Position', [5 100 60 20])
function entryBGthreshold(source,eventdata) function entryBGthreshold(source,eventdata)
user_entry = str2double(get(source,'string')); user_entry=str2double(get(source,'string'));
if (isnan(user_entry)||(user_entry<1)||(user_entry>100)) if (isnan(user_entry)||(user_entry<1)||(user_entry>100))
errordlg('Enter a numeric value between 1 and 100 percent to produce a Background Threshold value as a percent above the time series average background for each spot.','Bad Input','modal') errordlg('Enter a numeric value between 1 and 100 percent to produce a Background Threshold value as a percent above the time series average background for each spot.','Bad Input','modal')
return return
@@ -250,7 +250,7 @@ btnNumber=4; %Enter spot detection threshold (lock-in Image frame)
yPos=0.85-(btnNumber-1)*(btnHt+spacing); yPos=0.85-(btnNumber-1)*(btnHt+spacing);
btnPos=[xPos yPos-spacing btnWid btnHt]; btnPos=[xPos yPos-spacing btnWid btnHt];
srcSpotThres=ImParMat(4); srcSpotThres=ImParMat(4);
hedit = uicontrol(... hedit=uicontrol(...
'Style', 'edit',... 'Style', 'edit',...
'String',srcSpotThres,... 'String',srcSpotThres,...
'Units','normalized',... 'Units','normalized',...
@@ -258,7 +258,7 @@ hedit = uicontrol(...
'callback',{@entrySpotThres}); 'callback',{@entrySpotThres});
function entrySpotThres(source,eventdata) function entrySpotThres(source,eventdata)
user_entry = str2double(get(source,'string')); user_entry=str2double(get(source,'string'));
if (isnan(user_entry)||(user_entry<1)||(user_entry>60)) if (isnan(user_entry)||(user_entry<1)||(user_entry>60))
errordlg('You must enter a numeric value between 1 and 60','Bad Input','modal') errordlg('You must enter a numeric value between 1 and 60','Bad Input','modal')
return return
@@ -274,7 +274,7 @@ btnNumber=5;
yPos=0.85-(btnNumber-1)*(btnHt+spacing); yPos=0.85-(btnNumber-1)*(btnHt+spacing);
btnPos=[xPos yPos-spacing btnWid btnHt]; btnPos=[xPos yPos-spacing btnWid btnHt];
srcRadius=ImParMat(10); srcRadius=ImParMat(10);
hedit = uicontrol(... hedit=uicontrol(...
'Style', 'edit',... 'Style', 'edit',...
'String',srcRadius,... 'String',srcRadius,...
'Units','normalized',... 'Units','normalized',...
@@ -282,7 +282,7 @@ hedit = uicontrol(...
'callback',{@entryRadius}); % 'Position', [5 100 60 20]) 'callback',{@entryRadius}); % 'Position', [5 100 60 20])
function entryRadius(source,eventdata) function entryRadius(source,eventdata)
user_entry = str2double(get(source,'string')); user_entry=str2double(get(source,'string'));
if (isnan(user_entry)||(user_entry<12)||(user_entry>17)) if (isnan(user_entry)||(user_entry<12)||(user_entry>17))
errordlg('You must enter a numeric value between 12 and 17','Bad Input','modal') errordlg('You must enter a numeric value between 12 and 17','Bad Input','modal')
return return
@@ -298,7 +298,7 @@ btnNumber=5;
yPos=0.85-(btnNumber-1)*(btnHt+spacing); yPos=0.85-(btnNumber-1)*(btnHt+spacing);
btnPos=[xPos yPos-spacing btnWid btnHt]; btnPos=[xPos yPos-spacing btnWid btnHt];
srcWidth=ImParMat(5); srcWidth=ImParMat(5);
hedit = uicontrol(... hedit=uicontrol(...
'Style', 'edit',... 'Style', 'edit',...
'String',srcWidth,... 'String',srcWidth,...
'Units','normalized',... 'Units','normalized',...
@@ -306,7 +306,7 @@ hedit = uicontrol(...
'callback',{@entryWidth}); % 'Position', [5 100 60 20]) 'callback',{@entryWidth}); % 'Position', [5 100 60 20])
function entryWidth(source,eventdata) function entryWidth(source,eventdata)
user_entry = str2double(get(source,'string')); user_entry=str2double(get(source,'string'));
if (isnan(user_entry)||(user_entry<5)||(user_entry>41)) if (isnan(user_entry)||(user_entry<5)||(user_entry>41))
errordlg('You must enter a numeric value between 5 and 40','Bad Input','modal') errordlg('You must enter a numeric value between 5 and 40','Bad Input','modal')
return return
@@ -322,7 +322,7 @@ user_entry = str2double(get(source,'string'));
yPos=0.85-(btnNumber-1)*(btnHt+spacing); yPos=0.85-(btnNumber-1)*(btnHt+spacing);
btnPos=[xPos yPos-spacing btnWid btnHt]; btnPos=[xPos yPos-spacing btnWid btnHt];
srcDither= ImParMat(6); srcDither= ImParMat(6);
hedit = uicontrol(... hedit=uicontrol(...
'Style', 'edit',... 'Style', 'edit',...
'String',srcDither,... 'String',srcDither,...
'Units','normalized',... 'Units','normalized',...
@@ -330,7 +330,7 @@ hedit = uicontrol(...
'callback',{@entryDither}); 'callback',{@entryDither});
function entryDither(source,eventdata) function entryDither(source,eventdata)
user_entry = str2double(get(source,'string')); user_entry=str2double(get(source,'string'));
if (isnan(user_entry)||(user_entry<0)||(user_entry>5)) if (isnan(user_entry)||(user_entry<0)||(user_entry>5))
errordlg('You must enter a numeric value between 1 and 4','Bad Input','modal') errordlg('You must enter a numeric value between 1 and 4','Bad Input','modal')
return return
@@ -363,7 +363,7 @@ btnNumber=7;
end end
end end
%} %}
hSearchRange = uicontrol(... hSearchRange=uicontrol(...
'Style', 'edit',... 'Style', 'edit',...
'String',srchRange,... 'String',srchRange,...
'Units','normalized',... 'Units','normalized',...
@@ -371,7 +371,7 @@ hSearchRange = uicontrol(...
'callback',{@CsearchRange}); 'callback',{@CsearchRange});
function CsearchRange(source,eventdata) function CsearchRange(source,eventdata)
user_entry = str2double(get(source,'string')); user_entry=str2double(get(source,'string'));
if (isnan(user_entry)||(user_entry<1)||(user_entry>50)) %originally 18; 19_0729 increased if (isnan(user_entry)||(user_entry<1)||(user_entry>50)) %originally 18; 19_0729 increased
errordlg('You must enter a numeric value between 1 and 18 12->18 recommended. (ImParMat(12)))','Bad Input','modal') errordlg('You must enter a numeric value between 1 and 18 12->18 recommended. (ImParMat(12)))','Bad Input','modal')
return return
@@ -387,7 +387,7 @@ btnNumber=7;
btnPos=[xPos yPos-spacing btnWid btnHt]; btnPos=[xPos yPos-spacing btnWid btnHt];
srcExtend=ImParMat(7); srcExtend=ImParMat(7);
hedit = uicontrol(... hedit=uicontrol(...
'Style', 'edit',... 'Style', 'edit',...
'String',srcExtend,... 'String',srcExtend,...
'Units','normalized',... 'Units','normalized',...
@@ -395,7 +395,7 @@ hedit = uicontrol(...
'callback',{@entryExtend}); 'callback',{@entryExtend});
function entryExtend(source,eventdata) function entryExtend(source,eventdata)
user_entry = str2double(get(source,'string')); user_entry=str2double(get(source,'string'));
if (isnan(user_entry)||(user_entry<-0.10)||(user_entry>0.4)) if (isnan(user_entry)||(user_entry<-0.10)||(user_entry>0.4))
errordlg('You must enter a numeric value between 0 and 0.4. 0.10 recommended','Bad Input','modal') errordlg('You must enter a numeric value between 0 and 0.4. 0.10 recommended','Bad Input','modal')
return return
@@ -411,7 +411,7 @@ btnNumber=8;
btnPos=[xPos yPos-spacing btnWid btnHt]; btnPos=[xPos yPos-spacing btnWid btnHt];
%ImParMat(8)=1; %ImParMat(8)=1;
srcpointExtend=ImParMat(8); srcpointExtend=ImParMat(8);
hedit = uicontrol(... hedit=uicontrol(...
'Style', 'edit',... 'Style', 'edit',...
'String',srcpointExtend,... 'String',srcpointExtend,...
'Units','normalized',... 'Units','normalized',...
@@ -419,7 +419,7 @@ hedit = uicontrol(...
'callback',{@entrypointExtend}); 'callback',{@entrypointExtend});
function entrypointExtend(source,eventdata) function entrypointExtend(source,eventdata)
user_entry = str2double(get(source,'string')); user_entry=str2double(get(source,'string'));
user_entry= floor(user_entry); user_entry= floor(user_entry);
if (isnan(user_entry)||(user_entry<-3)||(user_entry>5)) if (isnan(user_entry)||(user_entry<-3)||(user_entry>5))
errordlg('You must enter an integer value between 0 and 5. 1 recommended','Bad Input','modal') errordlg('You must enter an integer value between 0 and 5. 1 recommended','Bad Input','modal')
@@ -436,7 +436,7 @@ btnNumber=9;
yPos=0.85-(btnNumber-1)*(btnHt+spacing); yPos=0.85-(btnNumber-1)*(btnHt+spacing);
btnPos=[xPos yPos-spacing btnWid btnHt]; btnPos=[xPos yPos-spacing btnWid btnHt];
hedit = uicontrol(... hedit=uicontrol(...
'Style', 'popupmenu',... 'Style', 'popupmenu',...
'String',{'GrowthArea','FixedArea'},... 'String',{'GrowthArea','FixedArea'},...
'Units','normalized',... 'Units','normalized',...
@@ -444,14 +444,14 @@ hedit = uicontrol(...
'callback',{@grwArea}); 'callback',{@grwArea});
function grwArea(source,eventdata) function grwArea(source,eventdata)
str = get(source, 'String'); str=get(source, 'String');
val = get(source,'Value'); val=get(source,'Value');
% Set current data to the selected data set. % Set current data to the selected data set.
switch str{val}; switch str{val};
case 'GrowthArea' ;% User selects Peaks. case 'GrowthArea' ;% User selects Peaks.
SWgrowthArea = 1 SWgrowthArea=1
case 'FixedArea' % User selects Membrane. case 'FixedArea' % User selects Membrane.
SWgrowthArea = 0 SWgrowthArea=0
end end
end end
%} %}

View File

@@ -68,7 +68,7 @@ catch
end end
% Load Fotos stored data % Load Fotos stored data
fotosToLoad = {'Coordinates', 'BGatTpts', 'anlZones', 'NCFparms'}; fotosToLoad = {'Coordinates', 'BGatTpts', 'anlZones', 'NCFparms'};
for i = 1:length(fotosToLoad) for i=1:length(fotosToLoad)
try try
load(fullfile(fotosResultsDir, fotosToLoad{i})); load(fullfile(fotosResultsDir, fotosToLoad{i}));
catch catch