From 9a5c9ffb6afec3e771c9e80b995df1e87534a859 Mon Sep 17 00:00:00 2001 From: Bryan Roessler Date: Thu, 25 Jul 2024 14:47:54 -0400 Subject: [PATCH] Format NCsingleDisplay.m --- workflow/templates/easy/NCsingleDisplay.m | 160 ++++++++++------------ 1 file changed, 71 insertions(+), 89 deletions(-) diff --git a/workflow/templates/easy/NCsingleDisplay.m b/workflow/templates/easy/NCsingleDisplay.m index 6d90d290..064d2f8c 100755 --- a/workflow/templates/easy/NCsingleDisplay.m +++ b/workflow/templates/easy/NCsingleDisplay.m @@ -4,107 +4,89 @@ global scLst global ExpPath global scan -eDir= ExpPath; -hf= figure; -%**************Parameter Entry****************** -[scLst, row, col] = NCdisplayGui(eDir); %(ExpPath); %Ncode 122111replaced removed ,numOfPrtTimes) -%*********************************************** - +eDir=ExpPath; +hf=figure; +% Parameter Entry +[scLst, row, col]=NCdisplayGui(eDir); %(ExpPath); %Ncode 122111replaced removed ,numOfPrtTimes) close(hf) - - -selSpot= (row-1)*24 + col; +selSpot=(row-1)*24 + col; for iPlate=1:length(scLst) - scanPltNum= str2double(scLst(iPlate)); - %scanPltNum(iPlate); -%----------------------------------------------------------------------- -K= scan(scanPltNum).plate(1).CFout((selSpot),3); -r= scan(scanPltNum).plate(1).CFout((selSpot),4); -l= scan(scanPltNum).plate(1).CFout((selSpot),5); - -suffix= strcat('Scan-Plate', scLst(iPlate)); %char(QspLst(n)); -%fileSpotSuffix = strcat('-Spot#',num2str(selSpot),'-Row=',selSpotRC(1),'-Col=',selSpotRC(2),'-FitData','-L=',num2str(l),'-r=',num2str(r),'-K=',num2str(K)); -fileSpotSuffix = strcat('-Spot#',num2str(selSpot),'-Row=',num2str(row),'-Col=',num2str(col),'-FitData','-L=',num2str(l),'-r=',num2str(r),'-K=',num2str(K)); -filenameNoExt= [suffix fileSpotSuffix]; - -timeArr= scan(scanPltNum).plate(1).tSeries; -rawIntens= scan(scanPltNum).plate(1).intens((selSpot),:)/scan(scanPltNum).plate(1).Ag((selSpot)); -try -filterTms= scan(scanPltNum).plate(1).filterTimes{(selSpot)}; -normInts= scan(scanPltNum).plate(1).normIntens{(selSpot)}; -catch - end -%******************************** - - if (exist('K','var')&& exist('r','var') && exist('l','var')) - t = (0:1:200); - Growth = K ./ (1 + exp(-r.* (t - l ))); - end -if length(scLst)>1 + scanPltNum=str2double(scLst(iPlate)); + K=scan(scanPltNum).plate(1).CFout((selSpot),3); + r=scan(scanPltNum).plate(1).CFout((selSpot),4); + l=scan(scanPltNum).plate(1).CFout((selSpot),5); + suffix=strcat('Scan-Plate', scLst(iPlate)); % char(QspLst(n)); + % fileSpotSuffix=strcat('-Spot#',num2str(selSpot),'-Row=',selSpotRC(1),'-Col=',selSpotRC(2),'-FitData','-L=',num2str(l),'-r=',num2str(r),'-K=',num2str(K)); + fileSpotSuffix=strcat('-Spot#',num2str(selSpot),'-Row=',num2str(row),'-Col=',num2str(col),'-FitData','-L=',num2str(l),'-r=',num2str(r),'-K=',num2str(K)); + filenameNoExt=[suffix fileSpotSuffix]; + timeArr=scan(scanPltNum).plate(1).tSeries; + rawIntens=scan(scanPltNum).plate(1).intens((selSpot),:)/scan(scanPltNum).plate(1).Ag((selSpot)); + try + filterTms=scan(scanPltNum).plate(1).filterTimes{(selSpot)}; + normInts=scan(scanPltNum).plate(1).normIntens{(selSpot)}; + catch + end + if (exist('K','var')&& exist('r','var') && exist('l','var')) + t=(0:1:200); + Growth=K ./ (1 + exp(-r.* (t - l ))); + end + if length(scLst)>1 figure -else + else cla + end + hold on + plot(timeArr,rawIntens,'g*'); + try + plot(filterTms,normInts,'o'); + catch + end + hold on; + title(strcat(filenameNoExt,'')); + xlabel('Hours'); + ylabel('Intensities Normalized by Area'); + grid on; + if (exist('K','var')&& exist('r','var') && exist('l','var')) + plot(t, Growth,'b-'); + % Plot L on curvefit figure + grL=Growth(round(l)); %growthCurve timePT for l in hours + plot(l,0:grL,'-b') % to display position of l + plot(l,grL,'^b') % to display l position on curve as an arrowhead + + % Plot Arbitrary User Entry AUC "finalTimePt" + % plot(finalTimePt,0,'+m') + % plot(0:finalTimePt,bl,'-m') + end end -hold on -plot(timeArr,rawIntens,'g*'); -try -plot(filterTms,normInts,'o'); -catch -end -hold on; -title(strcat(filenameNoExt,'')); -xlabel('Hours'); -ylabel('Intensities Normalized by Area'); -grid on; - -if (exist('K','var')&& exist('r','var') && exist('l','var')) -plot(t, Growth,'b-'); -%*********Plot L on curvefit figure*********** - grL=Growth(round(l)); %growthCurve timePT for l in hours - plot(l,0:grL,'-b') %to display position of l - plot(l,grL,'^b') %to display l position on curve as an arrowhead - -%***Plot Arbitrary User Entry AUC "finalTimePt" - % plot(finalTimePt,0,'+m') - % plot(0:finalTimePt,bl,'-m') - -end -end -%end %end for SWsingle display/plot figure - -%############################################################ - - - %Spot entry form------------------------------------------------------ %{ -prompt = {'Enter spot to analyse:'}; -dlg_title = 'Input spot to curve fit'; -num_lines = 1; -def = {'1'}; -selSpot = inputdlg(prompt,dlg_title,num_lines,def); -K= scan(scanPltNum).plate(1).CFout(str2double(selSpot),3); -r= scan(scanPltNum).plate(1).CFout(str2double(selSpot),4); -l= scan(scanPltNum).plate(1).CFout(str2double(selSpot),5); +prompt={'Enter spot to analyse:'}; +dlg_title='Input spot to curve fit'; +num_lines=1; +def={'1'}; +selSpot=inputdlg(prompt,dlg_title,num_lines,def); +K=scan(scanPltNum).plate(1).CFout(str2double(selSpot),3); +r=scan(scanPltNum).plate(1).CFout(str2double(selSpot),4); +l=scan(scanPltNum).plate(1).CFout(str2double(selSpot),5); -suffix= strcat('Scan-Plate', scLst); %char(QspLst(n)); -fileSpotSuffix = strcat('-Spot#',selSpot,'-FitData','-L=',num2str(l),'-r=',num2str(r),'-K=',num2str(K)); -filenameNoExt= [suffix fileSpotSuffix]; +suffix=strcat('Scan-Plate', scLst); %char(QspLst(n)); +fileSpotSuffix=strcat('-Spot#',selSpot,'-FitData','-L=',num2str(l),'-r=',num2str(r),'-K=',num2str(K)); +filenameNoExt=[suffix fileSpotSuffix]; -timeArr= scan(scanPltNum).plate(1).tSeries; -rawIntens= scan(scanPltNum).plate(1).intens(str2double(selSpot),:)/scan(scanPltNum).plate(1).Ag(str2double(selSpot)); -filterTms= scan(scanPltNum).plate(1).filterTimes{str2double(selSpot)}; -normInts= scan(scanPltNum).plate(1).normIntens{str2double(selSpot)}; +timeArr=scan(scanPltNum).plate(1).tSeries; +rawIntens=scan(scanPltNum).plate(1).intens(str2double(selSpot),:)/scan(scanPltNum).plate(1).Ag(str2double(selSpot)); +filterTms=scan(scanPltNum).plate(1).filterTimes{str2double(selSpot)}; +normInts=scan(scanPltNum).plate(1).normIntens{str2double(selSpot)}; %} %----------------------------------------------------------------------- %{ -prompt = {'Enter Spot row:','Enter Spot column:'}; -dlg_title = 'Input spot to curve fit'; -num_lines = 2; -def = {'1','1'}; -selSpotRC = inputdlg(prompt,dlg_title,num_lines,def); -row= str2double(selSpotRC(1)); col=str2double(selSpotRC(2)); +prompt={'Enter Spot row:','Enter Spot column:'}; +dlg_title='Input spot to curve fit'; +num_lines=2; +def={'1','1'}; +selSpotRC=inputdlg(prompt,dlg_title,num_lines,def); +row=str2double(selSpotRC(1)); col=str2double(selSpotRC(2)); %} -%row= cell2mat(row); +%row=cell2mat(row);