From bb103a6f9a3a455e8c46a81b6496490b88727f3a Mon Sep 17 00:00:00 2001 From: Bryan Roessler Date: Sat, 27 Jul 2024 13:39:18 -0400 Subject: [PATCH] strcat to sprintf --- workflow/templates/easy/DMPexcel2mat.m | 13 ++-- workflow/templates/easy/DgenResults.m | 36 +++++----- workflow/templates/easy/EASYconsole.m | 68 ++++++++++-------- workflow/templates/easy/NCsingleDisplay.m | 4 +- workflow/templates/easy/NImParamRadiusGui.m | 1 - workflow/templates/easy/par4Gbl_Main8c.m | 76 +++++++++------------ 6 files changed, 99 insertions(+), 99 deletions(-) diff --git a/workflow/templates/easy/DMPexcel2mat.m b/workflow/templates/easy/DMPexcel2mat.m index a1c834b5..4fddde53 100755 --- a/workflow/templates/easy/DMPexcel2mat.m +++ b/workflow/templates/easy/DMPexcel2mat.m @@ -7,7 +7,7 @@ global matDir % If we already have mpdmFile, don't recreate if (exist(mpdmFile, 'file') && ~isempty(mpdmFile)) - disp(strcat('The Drug Media/MasterPlate Annotation File: ', mpdmFile, ' exists, skipping DMPexcel2mat.m')); + disp(sprintf('The Drug Media/MasterPlate Annotation File: %s exists, skipping DMPexcel2mat.m\n', mpdmFile)); return end @@ -82,7 +82,7 @@ if ~exist(masterPlateFile, 'file') || isempty(masterPlateFile) end end else - disp(strcat('Using MasterPlate file: ', masterPlateFile, ', skipping directory selection')); + disp(sprintf('Using MasterPlate file: %s skipping directory selection\n', masterPlateFile)); end % fid=fopen(masterPlateFile)%('exp23PrintTimes.xls'); % textread puts date and time sequentially into vector @@ -183,7 +183,7 @@ if ~exist(drugMediaFile, 'file') || isempty(drugMediaFile) dmFileToTest=fullfile(mpPath, 'DrugMedia_', mpBareFileName, '.xlsx'); if exist(dmFileToTest, 'file') % Try to find a matching drug media file drugMediaFile=dmFileToTest; - disp(strcat('Using matching DrugMedia file: ', drugMediaFile, ', skipping directory selection')); + disp(sprintf('Using matching DrugMedia file: %s, skipping directory selection\n', drugMediaFile)); else % Try to find the DrugMedia file automatically (newest created first) files=dir(matDir); @@ -195,7 +195,8 @@ if ~exist(drugMediaFile, 'file') || isempty(drugMediaFile) [~, sortedIndices]=sort(datenum({files(strncmp(dmFiles.name, 'DrugMedia_', 10)).date}), 'descend'); sortedFiles=dmFiles{sortedIndices}; drugMediaFile=sortedFiles{1}; - disp(strcat('Using newest DrugMedia file: ', drugMediaFile, ', skipping directory selection')); + disp(sprintf('Using newest DrugMedia file: %s, skipping directory selection\n', drugMediaFile)); + end catch Me % This can be silent, not really an error @@ -228,7 +229,7 @@ if ~exist(drugMediaFile, 'file') || isempty(drugMediaFile) end end else - disp(strcat('Using drugMediaFile: ', drugMediaFile, ', skipping directory selection')); + disp(sprintf('Using drugMediaFile: %s, skipping directory selection\n', drugMediaFile)); end % Drug and Media Plate setup @@ -325,4 +326,4 @@ if isequal(Linked,0) % 0 indicates Drugs and Media are combinatorial end save(mpdmFile, 'fields','MP','DM','Linked'); -msgbox([strcat('Drug-Media-MasterPlate Annotation File', mpdmFile,'Generation Complete')]) +msgbox(sprintf('Drug-Media-MasterPlate Annotation File %s Generation Complete', mpdmFile)) diff --git a/workflow/templates/easy/DgenResults.m b/workflow/templates/easy/DgenResults.m index 1c2d83d1..ba1e42a7 100755 --- a/workflow/templates/easy/DgenResults.m +++ b/workflow/templates/easy/DgenResults.m @@ -366,9 +366,9 @@ if isequal(opt,'DB')||isequal(opt,'Both') try copyfile(DBfilename,DBupload) catch ME - rep=getReport(ME, 'basic'); - rep=strcat('Failed copyfile to ',DBupload,' -', rep); - errordlg(rep) + disp(sprintf('DB upload failed with error: %s\n', getReport(ME, 'basic'))); + rep=sprintf('Failed copyfile to %s - %s', DBupload, rep); + errordlg(rep); end end @@ -406,9 +406,9 @@ try totPlCnt=totPlCnt+1; if destPerMP>1 &&rem(totPlCnt,destPerMP)==1, mpCnt=mpCnt+1; end if destPerMP==1,mpCnt=mpCnt+1; end - pertCnt= rem(totPlCnt,destPerMP); + pertCnt=rem(totPlCnt,destPerMP); if pertCnt==0, pertCnt= destPerMP;end - pert= strcat('Perturb_',num2str(pertCnt)); + pert=strcat('Perturb_',num2str(pertCnt)); s % BCR seems wrong %Print Time Point HEADER for each plate for newly added intensity data @@ -420,10 +420,10 @@ try try asd=cell2mat(scan(s).plate(1).CFparameters(1)); - aucEndPt= strcat('AUC',num2str(asd(9))); + aucEndPt=strcat('AUC',num2str(asd(9))); catch asd=cell2mat(scan(s).plate(1).CFparameters{1,1}(1,384)); - aucEndPt= strcat('AUC',num2str(asd(9))); + aucEndPt=strcat('AUC',num2str(asd(9))); end fprintf(fid, 'Num.\tDiagnostics\tDrug\tConc\tMedia\tModifier1\tConc1\tModifier2\tConc2\tORF\tGene'); fprintf(fid, '\t %s',aucEndPt); @@ -475,8 +475,8 @@ try rSq=outCmat(n,6); lval=outCmat(n,5); if Kval>160, selcode='K_Hi'; else selcode=' ';end - if Kval<40, selcode=strcat(selcode,' K_Lo'); end %12_1030 - if rSq<.97 && rSq>0, selcode=strcat(selcode,' rSqLo'); end + if Kval<40, selcode=strcat(selcode,' K_Lo');end % TODO sprintf if you want a space + if rSq<.97 && rSq>0, selcode=strcat(selcode,' rSqLo');end if lval>(0.85*(max(outTseries))), selcode=strcat(selcode,' late');end if isnan(outCmat(n,7))||isnan(outCmat(n,8))||isnan(outCmat(n,9))... ||isnan(outCmat(n,10))||isnan(outCmat(n,11))... @@ -497,7 +497,7 @@ try riseTm=0; end - if Ag(n)< .30*(scan(s).Awindow),selcode=strcat(selcode,' smArea'); end + if Ag(n)< .30*(scan(s).Awindow),selcode=strcat(selcode,' smArea'); end % same, need sprintf for space if outCmat(n,3)==0,selcode=strcat('0 ',selcode); end orf=cell2mat(MP(mpCnt).orf{1}(n)); gene=cell2mat(MP(mpCnt).genename{1}(n)); @@ -575,15 +575,15 @@ try end if isequal(opt,'DB')||isequal(opt,'Both') if j