From 79e3676ed35b55a6b09427d71211f474f7b0190f Mon Sep 17 00:00:00 2001 From: Bryan Roessler Date: Tue, 30 Jul 2024 13:42:48 -0400 Subject: [PATCH] Who even knows at this point --- workflow/apps/matlab/easy/DMPexcel2mat.m | 10 +- workflow/apps/matlab/easy/DgenResults.m | 4 +- workflow/apps/matlab/easy/EASYconsole.m | 9 +- workflow/apps/matlab/easy/par4Gbl_Main8c.m | 4 +- workflow/apps/matlab/ezview/Axes2FigPrint.m | 12 +- workflow/apps/matlab/ezview/EZcompositePlot.m | 18 +- workflow/apps/matlab/ezview/EZdestComp.m | 10 +- workflow/apps/matlab/ezview/EZdiagRFsSheet.m | 2 +- .../matlab/ezview/EZdiagRFsSheetwImport.m | 4 +- workflow/apps/matlab/ezview/EZexpSel.m | 44 +- workflow/apps/matlab/ezview/EZfigTrendOL.m | 34 +- workflow/apps/matlab/ezview/EZhtMap.m | 2 +- workflow/apps/matlab/ezview/EZintPrint.m | 8 +- workflow/apps/matlab/ezview/EZlstBoxCmpExt.m | 8 +- workflow/apps/matlab/ezview/EZlstBoxExt.m | 8 +- workflow/apps/matlab/ezview/EZmDayPlotUcmp.m | 18 +- .../apps/matlab/ezview/EZmDayPlotUcomposite.m | 30 +- workflow/apps/matlab/ezview/EZmDayTrend.m | 2 +- workflow/apps/matlab/ezview/EZmultiDay.m | 55 +-- workflow/apps/matlab/ezview/EZmultiDayExp.m | 10 +- workflow/apps/matlab/ezview/EZmultiDayGui.m | 4 +- workflow/apps/matlab/ezview/EZmultiExLoad.m | 16 +- .../apps/matlab/ezview/EZmultiGeneRFsLst.m | 6 +- workflow/apps/matlab/ezview/EZplotUcmp.m | 455 ++++++++---------- .../apps/matlab/ezview/EZsingleExUserRF.m | 16 +- workflow/apps/matlab/ezview/EZspotview.m | 6 +- workflow/apps/matlab/ezview/EZtableRFdiag.m | 16 +- workflow/apps/matlab/ezview/EZusrSelRefx.m | 16 +- workflow/apps/matlab/ezview/EZvDatatip.m | 10 +- workflow/apps/matlab/ezview/EZvInitLoad.m | 20 +- workflow/apps/matlab/ezview/EZvNIcircle.m | 8 +- workflow/apps/matlab/ezview/EZvapendLabel.m | 14 +- workflow/apps/matlab/ezview/EZviewGui.m | 30 +- workflow/apps/matlab/ezview/datatipp.m | 19 +- workflow/apps/matlab/ezview/questdlgJWR.m | 54 +-- workflow/qhtcp-workflow | 2 +- workflow/templates/exp/.Rhistory | 15 - workflow/templates/exp/ExpFrontend.m | 212 -------- 38 files changed, 465 insertions(+), 746 deletions(-) delete mode 100644 workflow/templates/exp/.Rhistory delete mode 100644 workflow/templates/exp/ExpFrontend.m diff --git a/workflow/apps/matlab/easy/DMPexcel2mat.m b/workflow/apps/matlab/easy/DMPexcel2mat.m index 0c3ea837..ee5c280e 100755 --- a/workflow/apps/matlab/easy/DMPexcel2mat.m +++ b/workflow/apps/matlab/easy/DMPexcel2mat.m @@ -129,7 +129,7 @@ try % MP(numb).specifics2=' '; % end excLnNum=excLnNum+385; - msg=strcat('NumberOfMP = ',num2str(numb), ' lastLineNo. = ',num2str(excLnNum)); + msg=strcat('NumberOfMP=',num2str(numb), ' lastLineNo.=',num2str(excLnNum)); end else excLnNum=1; @@ -157,7 +157,7 @@ try MP(numb).specifics= ' '; end excLnNum=excLnNum+385; - msg=strcat('NumberOfMP = ',num2str(numb), 'lastLineNo. = ',num2str(excLnNum)); + msg=strcat('NumberOfMP=',num2str(numb), 'lastLineNo.=',num2str(excLnNum)); end end catch ME @@ -261,7 +261,7 @@ if isequal(Linked,1) % Drugs and Media are linked 1 to 1; else they are combinat DM.mod2(numb)={raw(excLnNum,7)}; DM.conc2(numb)={raw(excLnNum,8)}; excLnNum=excLnNum+1; - msg=strcat('NumberOf1:1DrugMediaPlates = ',num2str(numb), ' lastLineNo. = ',num2str(excLnNum)); + msg=strcat('NumberOf1:1DrugMediaPlates=',num2str(numb), ' lastLineNo.=',num2str(excLnNum)); end else clear DM @@ -283,7 +283,7 @@ if isequal(Linked,1) % Drugs and Media are linked 1 to 1; else they are combinat DM.conc2(numb)={DMtbl(excLnNum,8)}; DM.conc2(numb)=table2cell(DM.conc2{numb}); excLnNum=excLnNum+1; - msg=strcat('NumberOf1:1DrugMediaPlates = ',num2str(numb), ' lastLineNo. = ',num2str(excLnNum)); + msg=strcat('NumberOf1:1DrugMediaPlates=',num2str(numb), ' lastLineNo.=',num2str(excLnNum)); end end end @@ -321,7 +321,7 @@ if isequal(Linked,0) % 0 indicates Drugs and Media are combinatorial excLnNum=excLnNum+1; end end - msg=strcat('NumberOfDrugs = ',num2str(drgCnt), ' NumberOfMedias = ',num2str(medCnt) ); + msg=strcat('NumberOfDrugs=',num2str(drgCnt), ' NumberOfMedias=',num2str(medCnt) ); end save(mpdmFile, 'fields','MP','DM','Linked'); diff --git a/workflow/apps/matlab/easy/DgenResults.m b/workflow/apps/matlab/easy/DgenResults.m index 17b95dff..bee0ac5c 100755 --- a/workflow/apps/matlab/easy/DgenResults.m +++ b/workflow/apps/matlab/easy/DgenResults.m @@ -281,7 +281,7 @@ for s=1:size(scan,2) outIntens=[]; outIntens=zeros(384,dataLength); intensBlob=''; - tmBlob =''; + tmBlob=''; for j=1:dataLength %size(RawIntens,2) %size(outTseries,1) if Ag(n)==0,Ag(n)=scan(s).Awindow;end @@ -565,7 +565,7 @@ try outIntens=[]; outIntens=zeros(384,dataLength); intensBlob=''; - tmBlob =''; + tmBlob=''; for j=1:dataLength %size(RawIntens,2) %size(outTseries,1) if Ag(n)==0,Ag(n)=scan(s).Awindow;end diff --git a/workflow/apps/matlab/easy/EASYconsole.m b/workflow/apps/matlab/easy/EASYconsole.m index c0d9ba88..902fd15f 100644 --- a/workflow/apps/matlab/easy/EASYconsole.m +++ b/workflow/apps/matlab/easy/EASYconsole.m @@ -293,7 +293,7 @@ function NewExpDat_Callback(~, ~, ~) % create supporting dirs % this is also in the workflow script but here for standalone mode - dirs={'PrintResults', 'CFfigs', 'Fotos', 'Fotos/BkUp'}; + dirs={'PrintResults', 'CFfigs', 'Fotos'}; for i=1:length(dirs) d=dirs{i}; if ~exist(fullfile(easyResultsDir, d), 'dir') @@ -335,7 +335,7 @@ function LoadDatFile_Callback(~, ~, ~) global fhconsole try - questdlg('Load results .mat from ../ExpJobs/YourJob/Results/matResults/','File Creation','OK', struct('Default','OK','Interpreter','tex')); + questdlg('Load results .mat from ../out/project/','File Creation','OK', struct('Default','OK','Interpreter','tex')); [inputFile,inputPath]=uigetfile('.mat','Open Experiment folder and data storage .mat file name','MultiSelect','off'); matDir=fullfile(inputPath); matFile=fullfile(inputPath,inputFile); @@ -370,11 +370,6 @@ function LoadDatFile_Callback(~, ~, ~) disp('WARNING: cannot find project scans'); end - bkupDir=fullfile(matDir,'BkUp'); - if ~exist(bkupDir, 'dir') - mkkdir(bkupDir); - end - % Create supporting dirs dirs={'PrintResults', 'figs', 'CFfigs', 'PTmats', 'Fotos'}; for i=1:length(dirs) diff --git a/workflow/apps/matlab/easy/par4Gbl_Main8c.m b/workflow/apps/matlab/easy/par4Gbl_Main8c.m index c5aa9c92..ca84f61f 100755 --- a/workflow/apps/matlab/easy/par4Gbl_Main8c.m +++ b/workflow/apps/matlab/easy/par4Gbl_Main8c.m @@ -48,7 +48,7 @@ end % EASYconsole if exist(matFile, 'file') - bkUpMatFile=fullfile(matDir,'BkUp',matFile); + bkUpMatFile=fullfile(matFile, '.bk'); copyfile(matFile,bkUpMatFile); end @@ -67,7 +67,7 @@ catch load(fullfile(pointMapsResultsDir,'Nbdg')); %Left in to accomodate loads of work before 20_0819 end % Load Fotos stored data -fotosToLoad = {'Coordinates', 'BGatTpts', 'anlZones', 'NCFparms'}; +fotosToLoad={'Coordinates', 'BGatTpts', 'anlZones', 'NCFparms'}; for i=1:length(fotosToLoad) try load(fullfile(fotosResultsDir, fotosToLoad{i})); diff --git a/workflow/apps/matlab/ezview/Axes2FigPrint.m b/workflow/apps/matlab/ezview/Axes2FigPrint.m index d87ab85e..350034ec 100755 --- a/workflow/apps/matlab/ezview/Axes2FigPrint.m +++ b/workflow/apps/matlab/ezview/Axes2FigPrint.m @@ -1,6 +1,6 @@ close all figure('units','pix','pos',[200 200 850 750]) -ax = axes; +ax=axes; plot((1:10).^2) set(ax,'units','pix') legend('x^2') @@ -10,11 +10,11 @@ title('Title','fontsize',24) drawnow % Now capture the axes and labels. -P = get(ax,'pos'); -T = get(ax,'tightinset'); -h = [P(1)-T(1)-5 P(2)-T(2)-5 P(3)+P(1)/2+T(3)+15 P(4)+P(2)/2+T(4)+10]; -F = getframe(gcf,h); -[X,Map] = frame2im(F); +P=get(ax,'pos'); +T=get(ax,'tightinset'); +h=[P(1)-T(1)-5 P(2)-T(2)-5 P(3)+P(1)/2+T(3)+15 P(4)+P(2)/2+T(4)+10]; +F=getframe(gcf,h); +[X,Map]=frame2im(F); % I put the funny background color so the captured area stands out. figure('color',[.6 .2 .2],'units','pix','pos',[26 33 1184 925]) image(X) diff --git a/workflow/apps/matlab/ezview/EZcompositePlot.m b/workflow/apps/matlab/ezview/EZcompositePlot.m index f65fe6a8..901bfaab 100755 --- a/workflow/apps/matlab/ezview/EZcompositePlot.m +++ b/workflow/apps/matlab/ezview/EZcompositePlot.m @@ -69,17 +69,17 @@ if AddCplot==1, %******MEAN calculation Plot******************** %try - l= Exp(expN).cLmean(cTraceN); - r= Exp(expN).cRmean(cTraceN); - K= Exp(expN).cKmean(cTraceN); - lslow= l + Exp(expN).cLstd(cTraceN); lfast= l - Exp(expN).cLstd(cTraceN); - rl= r - Exp(expN).cRstd(cTraceN); ru= r + Exp(expN).cRstd(cTraceN); - Kl= K - Exp(expN).cKstd(cTraceN); Ku= K + Exp(expN).cKstd(cTraceN); + l=Exp(expN).cLmean(cTraceN); + r=Exp(expN).cRmean(cTraceN); + K=Exp(expN).cKmean(cTraceN); + lslow=l + Exp(expN).cLstd(cTraceN); lfast= l - Exp(expN).cLstd(cTraceN); + rl=r - Exp(expN).cRstd(cTraceN); ru= r + Exp(expN).cRstd(cTraceN); + Kl=K - Exp(expN).cKstd(cTraceN); Ku= K + Exp(expN).cKstd(cTraceN); clear g; t=1:200; - g = K ./ (1 + exp(-r.* (t - l ))); -gSlow= Kl ./ (1 + exp(-rl.* (t - lslow ))); -gFast= Ku ./ (1 + exp(-ru.* (t - lfast ))); + g=K ./ (1 + exp(-r.* (t - l ))); +gSlow=Kl ./ (1 + exp(-rl.* (t - lslow ))); +gFast=Ku ./ (1 + exp(-ru.* (t - lfast ))); if K==0||r==0||l==0, g(1:200)=1;gSlow(1:200)=1;gFast(1:200)=1;end Exp(expN).hCmean(cTraceN)=plot(OLaxes,t,g);hold on; %PLOT the composit mean of traces diff --git a/workflow/apps/matlab/ezview/EZdestComp.m b/workflow/apps/matlab/ezview/EZdestComp.m index ff490b4d..25cdb236 100755 --- a/workflow/apps/matlab/ezview/EZdestComp.m +++ b/workflow/apps/matlab/ezview/EZdestComp.m @@ -309,11 +309,11 @@ intLadj=(deltaXR); Exp(expN).Trace(tracN).Dexp(DexpN).UsrIntL= intL; %{ -intNormL = (intL) ./ Rn(1) +intNormL=(intL) ./ Rn(1) intNormLadj= ((deltaXR)./ Rn(1)) -proGrIntL = -(intL) -proGrIntLadj = -(deltaXR) -proGrIntNormL = -(intL ./ Rn(1)) +proGrIntL=-(intL) +proGrIntLadj=-(deltaXR) +proGrIntNormL=-(intL ./ Rn(1)) proGrIntNormLadj= -((deltaXR)./ Rn(1)) %find where Xn(j)==0 and set interactL to a fixed Max interaction value intNormL(find(Xn==0))=2 @@ -365,7 +365,7 @@ end %Plot new intL try % zeroCLn= zeros(1,destPerMP) - % Exp(zoneSel).hzeroCLn = plot(DNLaxes,zeroCLn,1:destPerMP,'y'); + % Exp(zoneSel).hzeroCLn=plot(DNLaxes,zeroCLn,1:destPerMP,'y'); Exp(zoneSel).hintL(tracN)= plot(DNLaxes,intL,1:destPerMP); Exp(zoneSel).hintLb(tracN)= plot(DNLaxes,intL,1:destPerMP,'rs'); Exp(zoneSel).hintLadj(tracN)= plot(DNLaxes,intLadj,1:destPerMP,'g'); Exp(zoneSel).hintLadjb(tracN)= plot(DNLaxes,intLadj,1:destPerMP,'gs'); catch, diff --git a/workflow/apps/matlab/ezview/EZdiagRFsSheet.m b/workflow/apps/matlab/ezview/EZdiagRFsSheet.m index dc6f3f6a..da8d4439 100755 --- a/workflow/apps/matlab/ezview/EZdiagRFsSheet.m +++ b/workflow/apps/matlab/ezview/EZdiagRFsSheet.m @@ -11,7 +11,7 @@ try %Try the whole routine cnames={'RF Name','Median','Mean','STD','Minimum','Maximum'}; rCnt=0; RFfilename= fullfile(Exp(expN).Dexp(DexpN).resDir,'PrintResults','!RFsDiagnostics.txt'); - fid = fopen(RFfilename,'w'); %('RFdiagnostic.txt','w'); + fid=fopen(RFfilename,'w'); %('RFdiagnostic.txt','w'); ftitle= strcat(ExpPath,':::Reference Diagnostic Values'); try fprintf(fid,'%s\n',ftitle); diff --git a/workflow/apps/matlab/ezview/EZdiagRFsSheetwImport.m b/workflow/apps/matlab/ezview/EZdiagRFsSheetwImport.m index 76c4ccee..5ed56d85 100755 --- a/workflow/apps/matlab/ezview/EZdiagRFsSheetwImport.m +++ b/workflow/apps/matlab/ezview/EZdiagRFsSheetwImport.m @@ -1,8 +1,8 @@ %Diagnostic sheet called by EZvInitLoad.m, EZexpSel.m ?EZinteractDev_.m? global Exp -intLfilename1= fullfile(Exp(expN).resDir,'PrintResults','!RFsDiagnostics.txt'); -fid = fopen(RFdiagnostic,'w'); +intLfilename1=fullfile(Exp(expN).resDir,'PrintResults','!RFsDiagnostics.txt'); +fid=fopen(RFdiagnostic,'w'); ln=1; fprintf(fid,'%d\t',ln); fprintf(fid,'%s\ExpName:::','Reference Diagnostic Values'); diff --git a/workflow/apps/matlab/ezview/EZexpSel.m b/workflow/apps/matlab/ezview/EZexpSel.m index 0a3a6254..715830ff 100755 --- a/workflow/apps/matlab/ezview/EZexpSel.m +++ b/workflow/apps/matlab/ezview/EZexpSel.m @@ -570,7 +570,7 @@ else Exp(expN).Dexp(1).RFmd1pltN= RF1mp; try medValList1{d+1}= Exp(expN).Dexp(1).scan(rf1scN).plate(1).CFout(medianIndx,5); nonZeroCnt; - catch, catcherror = 'Ln356', + catch, catcherror='Ln356', end end %~isempty(nonZeroIndx) && length(medianIndx) > (.15*384) @@ -853,8 +853,8 @@ uu= horzcat(uu,vv); for d=1:DMnum medianIndxG=[]; NZrfIndxG=[]; - minG = min(nonzeros(vv(:,d))); - maxG = max(nonzeros(vv(:,d))); + minG=min(nonzeros(vv(:,d))); + maxG=max(nonzeros(vv(:,d))); RFmeanG= mean(nonzeros(vv(:,d))); RFstdG= std(nonzeros(vv(:,d))); NZrfIndxG= find(vv(:,d)); %find(nonzeros(vv(:,d))); WWRONG FOR A WHILE! @@ -976,7 +976,7 @@ if expN==1 set(handles.listboxGnOrf,'string',Exp(1).Dexp(1).srtGnLst) end DNLaxes1= handles.DNLaxes1; %ZoneRelated - Exp(1).hzeroCLn(expLdCnt) = plot(DNLaxes1,zeroCLn,1:DMnum,'y'); + Exp(1).hzeroCLn(expLdCnt)=plot(DNLaxes1,zeroCLn,1:DMnum,'y'); end if expN==2 @@ -993,7 +993,7 @@ if expN==2 set(handles.listboxGnOrf,'string',Exp(2).Dexp(1).srtGnLst) end DNLaxes2= handles.DNLaxes2; %ZoneRelated - Exp(2).hzeroCLn(expLdCnt) = plot(DNLaxes2,zeroCLn,1:DMnum,'y'); + Exp(2).hzeroCLn(expLdCnt)=plot(DNLaxes2,zeroCLn,1:DMnum,'y'); end @@ -1011,7 +1011,7 @@ if expN==3 set(handles.listboxGnOrf,'string',Exp(3).Dexp(1).srtGnLst) end DNLaxes3= handles.DNLaxes3; %ZoneRelated - Exp(3).hzeroCLn(expLdCnt) = plot(DNLaxes3,zeroCLn,1:DMnum,'y'); + Exp(3).hzeroCLn(expLdCnt)=plot(DNLaxes3,zeroCLn,1:DMnum,'y'); end if Exp(4).interacPBsel==0 %if interaction "raw" don't show a center line @@ -1126,11 +1126,11 @@ elseif expType==2 %Multiple Experiment from in one Folder extraction %************************************************* ww=pwd; try EZmultiDayGui; catch ME - msg = ME.message, cd(ww); end %* %* + msg=ME.message, cd(ww); end %* %* try EZmultiDay; catch ME - msg = ME.message, cd(ww); end %* + msg=ME.message, cd(ww); end %* try EZmultiExLoad; catch ME - msg = ME.message, cd(ww); end %* + msg=ME.message, cd(ww); end %* %********************* elseif expType==3 Exp(expN).DexpType= 'multi'; @@ -1148,11 +1148,11 @@ elseif expType==3 %************************************************* ww=pwd; try EZmultiDayGui; catch ME - msg = ME.message,cd(ww); end %* %* + msg=ME.message,cd(ww); end %* %* try EZmultiDay; catch ME - msg = ME.message, cd(ww); end %* + msg=ME.message, cd(ww); end %* try EZmultiExLoad; catch ME - msg = ME.message, cd(ww); end %* + msg=ME.message, cd(ww); end %* %********************* else disp('Cancel Load Exp') @@ -1205,12 +1205,12 @@ end %User Reference Input Dialog Box used in the multiExperiment Chrono setup - prompt = {'Enter GeneName to use as Reference:',... + prompt={'Enter GeneName to use as Reference:',... 'Enter Specifics Term if used to futher specify Reference '} - dlg_title = 'User Reference Input'; - num_lines = 1; - def = {'RF1','None'}; - answer = inputdlg(prompt,dlg_title,num_lines,def); + dlg_title='User Reference Input'; + num_lines=1; + def={'RF1','None'}; + answer=inputdlg(prompt,dlg_title,num_lines,def); rfGene= cell2mat(answer(1)); if ~strcmpi(rfGene,'RF1')|| ~strcmpi(rfGene,'RF2'), usrRefFg=1; end rfSpec= answer(2); %if strcmpi(answer(2),'None'), rfSpec= ''; end @@ -1220,12 +1220,12 @@ end %+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %First user input prototype code if ~exist('RF1scanN','var') && ~exist('RF2scanN','var') %change || && - prompt = {'Enter Masterplate Number(s) of Your Reference GeneName spots:',... + prompt={'Enter Masterplate Number(s) of Your Reference GeneName spots:',... 'Enter GeneName of Your Reference:'}; - dlg_title = 'User Reference Input'; - num_lines = 1; - def = {'Ref MP(s)','USRrefGeneName'}; - answer = inputdlg(prompt,dlg_title,num_lines,def); + dlg_title='User Reference Input'; + num_lines=1; + def={'Ref MP(s)','USRrefGeneName'}; + answer=inputdlg(prompt,dlg_title,num_lines,def); rfMPstr= cell2mat(answer(1)); rfMPcomas=strfind((cell2mat(answer(1))),','); n=0; diff --git a/workflow/apps/matlab/ezview/EZfigTrendOL.m b/workflow/apps/matlab/ezview/EZfigTrendOL.m index 7aa69afd..f24658d4 100755 --- a/workflow/apps/matlab/ezview/EZfigTrendOL.m +++ b/workflow/apps/matlab/ezview/EZfigTrendOL.m @@ -206,19 +206,19 @@ sh= userPars.BPlblShft; fontSize= userPars.BPfontSz; rotation= userPars.BProt; -%fontSize = 8; - %tickLabelStr = {'Label alpha','Label beta','Label chi','Label delta',... +%fontSize=8; + %tickLabelStr={'Label alpha','Label beta','Label chi','Label delta',... % 'Label epsilon','Label fish','Label gamma','Label hallo','Label ingo'} % generate data if size(BPvals,1)==1, BPvals(2,1:maxCols)= nan; end - final_res = BPvals; %10*randn(300,9)+10; + final_res=BPvals; %10*randn(300,9)+10; % group boxes - %sh = 0.3; %sh is shift value - width = .5*sh; + %sh=0.3; %sh is shift value + width=.5*sh; - %pos = [1+sh 2-sh 3+sh 4-sh 5+sh 6-sh 7+sh 8-sh 9+sh]; + %pos=[1+sh 2-sh 3+sh 4-sh 5+sh 6-sh 7+sh 8-sh 9+sh]; bpn=1; if strcmp(Exp(expN).DexpType, 'chrono') ticDim= length(Exp(expN).Dexp); @@ -235,7 +235,7 @@ rotation= userPars.BProt; end end end - wid = width * ones(1,length(pos)); + wid=width * ones(1,length(pos)); % boxplot figure @@ -257,10 +257,10 @@ rotation= userPars.BProt; ylabel('L in Hours', 'FontSize', fontSize) %x-labels - text_h = findobj(gca, 'Type', 'text'); - %rotation = 45; + text_h=findobj(gca, 'Type', 'text'); + %rotation=45; - for cnt = 1:length(text_h) + for cnt=1:length(text_h) set(text_h(cnt), 'FontSize', fontSize,... 'Rotation', rotation, ... 'String', tickLabelStr{length(tickLabelStr)-cnt+1}, ... @@ -270,16 +270,16 @@ rotation= userPars.BProt; % 'VerticalAlignment', 'cap', ... % smaller box for axes, in order to un-hide the labels - squeeze = 0.2; - left = 0.02; - right = 1; - bottom = squeeze; - top = 1-squeeze; + squeeze=0.2; + left=0.02; + right=1; + bottom=squeeze; + top=1-squeeze; set(gca, 'OuterPosition', [left bottom right top]) % remove outliers - hout = findobj(gca,'tag','Outliers'); - for out_cnt = 1 : length(hout) + hout=findobj(gca,'tag','Outliers'); + for out_cnt=1 : length(hout) if strcmpi(BPoutliers,'on'), set(hout(out_cnt), 'Visible', 'on') elseif strcmpi(BPnotch,'off'), diff --git a/workflow/apps/matlab/ezview/EZhtMap.m b/workflow/apps/matlab/ezview/EZhtMap.m index 41d23e2b..47f340e8 100755 --- a/workflow/apps/matlab/ezview/EZhtMap.m +++ b/workflow/apps/matlab/ezview/EZhtMap.m @@ -284,7 +284,7 @@ elseif htTog==3 Xhn{m,j,:}=Exp(expN).Dexp(DexpN).scan(scnN).plate(1).CFout(:,12); %Exp(expN).Dexp(DexpN).scan(DM{j}(m)).plate(1).CFout(:,12); %********************************************************* - %intL{m,j,:} = ((Xn{m,j,:} - Xn{m,1,:}) - (Rn(j)-Rn(1))); + %intL{m,j,:}= ((Xn{m,j,:} - Xn{m,1,:}) - (Rn(j)-Rn(1))); intL= ((Xn{m,j,:} - Xn{m,1,:}) - (Rn(j)-Rn(1))); Exp(expN).HtMpIntN2=intL; %ZoneRelated %{ diff --git a/workflow/apps/matlab/ezview/EZintPrint.m b/workflow/apps/matlab/ezview/EZintPrint.m index 1f3082a8..377f4cbf 100755 --- a/workflow/apps/matlab/ezview/EZintPrint.m +++ b/workflow/apps/matlab/ezview/EZintPrint.m @@ -27,7 +27,7 @@ userInputs=cell2mat(strcat( 'ExpZone:',num2str(expN), '; LeftPercent',answer(1), %********************11111111111111111111111111111111111111111**************************************************************************************************************** %Interaction Printout for Positive (longer L interaction values) Non-Adjusted for Ref std and curve fit boundaries -fid = fopen(intLfilename1,'w'); +fid=fopen(intLfilename1,'w'); ln=1; fprintf(fid,'%d\t',ln); fprintf(fid,'%s\userInputs',strcat('AggrevatingInteractionResults for User Input: ',userInputs)); @@ -63,7 +63,7 @@ end fclose(fid) %********************222222222222222222222222222222222222222222222**************************************************************************************************************** %Interaction Printout for Negative (shorter L interaction values) Non-Adjusted for Ref std and curve fit boundaries -fid = fopen(intLfilename2,'w'); +fid=fopen(intLfilename2,'w'); ln=1; fprintf(fid,'%d\t',ln); fprintf(fid,'%s\userInputs',strcat('AlleviatingInteractionResults for User Input: ',userInputs)); %fprintf(fid,'%s\userInputs',userInputs); @@ -96,7 +96,7 @@ end fclose(fid) %********************3333333333333333333333333333333333333333333333**************************************************************************************************************** %Interaction Printout for Positive (longer L interaction values) "ADJUSTED" for Ref std and curve fit boundaries -fid = fopen(intLfilename3,'w'); +fid=fopen(intLfilename3,'w'); ln=1; fprintf(fid,'%d\t',ln); fprintf(fid,'%s\userInputs',strcat('Adjusted AggrevatingInteractionResults for User Input: ',userInputs)); @@ -128,7 +128,7 @@ fclose(fid) %********************44444444444444444444444444444444444444444444****************************************************************************************************************%Interaction Printout for Negative (shorter L interaction values) Non-Adjusted for Ref std and curve fit boundaries -fid = fopen(intLfilename4,'w'); +fid=fopen(intLfilename4,'w'); ln=1; fprintf(fid,'%d\t',ln); fprintf(fid,'%s\userInputs',strcat('AlleviatingInteractionResults for User Input: ',userInputs)); %fprintf(fid,'%s\userInputs',userInputs); diff --git a/workflow/apps/matlab/ezview/EZlstBoxCmpExt.m b/workflow/apps/matlab/ezview/EZlstBoxCmpExt.m index 2a890c48..870c12de 100755 --- a/workflow/apps/matlab/ezview/EZlstBoxCmpExt.m +++ b/workflow/apps/matlab/ezview/EZlstBoxCmpExt.m @@ -54,16 +54,16 @@ ru= r + Exp(expN).Dexp(DexpN).RFcmpGr.dm(inDM).std; lfast= l - Exp(expN).Dexp(DexpN).RFcmpGL.dm(inDM).std; lslow= l + Exp(expN).Dexp(DexpN).RFcmpGL.dm(inDM).std; end -try Kstr=Ks(1:5); catch, Kstr = Ks(1:length(Ks)); end -try rstr=rs(1:5); catch, rstr = rs(1:length(rs)); end -try Lstr=Ls(1:5); catch, Lstr = Ls(1:length(Ls)); end +try Kstr=Ks(1:5); catch, Kstr=Ks(1:length(Ks)); end +try rstr=rs(1:5); catch, rstr=rs(1:length(rs)); end +try Lstr=Ls(1:5); catch, Lstr=Ls(1:length(Ls)); end t=1:200; clear g; %try -g = K ./ (1 + exp(-r.* (t - l ))); +g= K ./ (1 + exp(-r.* (t - l ))); gSlow= Kl ./ (1 + exp(-rl.* (t - lslow ))); gFast= Ku ./ (1 + exp(-ru.* (t - lfast ))); if K==0||r==0||l==0, g(1:200)=1;gSlow(1:200)=1;gFast(1:200)=1;end diff --git a/workflow/apps/matlab/ezview/EZlstBoxExt.m b/workflow/apps/matlab/ezview/EZlstBoxExt.m index 02bcf702..276e2ad7 100755 --- a/workflow/apps/matlab/ezview/EZlstBoxExt.m +++ b/workflow/apps/matlab/ezview/EZlstBoxExt.m @@ -132,9 +132,9 @@ try K=scan(1,plateNum).plate(1).CFout(indx,3); Ks= num2str(K); r=scan(1,plateNum).plate(1).CFout(indx,4); rs= num2str(r); l=scan(1,plateNum).plate(1).CFout(indx,5); Ls= num2str(l); -try Kstr=Ks(1:5); catch, Kstr = Ks(1:length(Ks)); end -try rstr=rs(1:5); catch, rstr = rs(1:length(rs)); end -try Lstr=Ls(1:5); catch, Lstr = Ls(1:length(Ls)); end +try Kstr=Ks(1:5); catch, Kstr=Ks(1:length(Ks)); end +try rstr=rs(1:5); catch, rstr=rs(1:length(rs)); end +try Lstr=Ls(1:5); catch, Lstr=Ls(1:length(Ls)); end Kl=scan(1,plateNum).plate(1).CFout(indx,7); Ku=scan(1,plateNum).plate(1).CFout(indx,8); @@ -147,7 +147,7 @@ t=1:200; clear g; try -g = K ./ (1 + exp(-r.* (t - l ))); +g= K ./ (1 + exp(-r.* (t - l ))); gSlow= Kl ./ (1 + exp(-rl.* (t - lslow ))); gFast= Ku ./ (1 + exp(-ru.* (t - lfast ))); if K==0||r==0||l==0, g(1:200)=1;gSlow(1:200)=1;gFast(1:200)=1;end diff --git a/workflow/apps/matlab/ezview/EZmDayPlotUcmp.m b/workflow/apps/matlab/ezview/EZmDayPlotUcmp.m index fc041fce..97a9e99c 100755 --- a/workflow/apps/matlab/ezview/EZmDayPlotUcmp.m +++ b/workflow/apps/matlab/ezview/EZmDayPlotUcmp.m @@ -23,11 +23,11 @@ else end - prompt = {'Enter Specifics Term if used to futher specify selection '} - dlg_title = 'User Specifics Term for Refinement Composite'; - num_lines = 1; - def = {'None'}; - answer = inputdlg(prompt,dlg_title,num_lines,def); + prompt={'Enter Specifics Term if used to futher specify selection '} + dlg_title='User Specifics Term for Refinement Composite'; + num_lines=1; + def={'None'}; + answer=inputdlg(prompt,dlg_title,num_lines,def); usrSpec= cell2mat(answer(1)); if strcmpi(usrSpec,'None'), usrGnSp= {strcat(usrGene,'-')}; elseif length(usrSpec)> 8, @@ -190,9 +190,9 @@ lfast= l - Lstd; lslow= l + Lstd; end -try Kstr=Ks(1:5); catch, Kstr = Ks(1:length(Ks)); end -try rstr=rs(1:5); catch, rstr = rs(1:length(rs)); end -try Lstr=Ls(1:5); catch, Lstr = Ls(1:length(Ls)); end +try Kstr=Ks(1:5); catch, Kstr=Ks(1:length(Ks)); end +try rstr=rs(1:5); catch, rstr=rs(1:length(rs)); end +try Lstr=Ls(1:5); catch, Lstr=Ls(1:length(Ls)); end pertSel=Exp(zoneSel).Dexp(DexpN).pertSel; %floor(get(handles.DMsldr1,'value')); @@ -205,7 +205,7 @@ t=1:200; clear g; try -g = K ./ (1 + exp(-r.* (t - l ))); +g= K ./ (1 + exp(-r.* (t - l ))); gSlow= Kl ./ (1 + exp(-rl.* (t - lslow ))); gFast= Ku ./ (1 + exp(-ru.* (t - lfast ))); if K==0||r==0||l==0, g(1:200)=1;gSlow(1:200)=1;gFast(1:200)=1;end diff --git a/workflow/apps/matlab/ezview/EZmDayPlotUcomposite.m b/workflow/apps/matlab/ezview/EZmDayPlotUcomposite.m index a0e2851a..a163cca4 100755 --- a/workflow/apps/matlab/ezview/EZmDayPlotUcomposite.m +++ b/workflow/apps/matlab/ezview/EZmDayPlotUcomposite.m @@ -18,11 +18,11 @@ selStrNm= char(selGnOrf) usrGene= selStrNm(1:(patrnN(1)-1)) - prompt = {'Enter Specifics Term if used to futher specify selection '} - dlg_title = 'User Specifics Term for Refinement Composite'; - num_lines = 1; - def = {'None'}; - answer = inputdlg(prompt,dlg_title,num_lines,def); + prompt={'Enter Specifics Term if used to futher specify selection '} + dlg_title='User Specifics Term for Refinement Composite'; + num_lines=1; + def={'None'}; + answer=inputdlg(prompt,dlg_title,num_lines,def); %usrGene= cell2mat(answer(1)); usrSpec= answer(1); usrGnSp= strcat(usrGene,usrSpec); @@ -150,8 +150,8 @@ uu= horzcat(uu,vv); for d=dmSel:dmSel medianIndxG=[]; NZusrIndxG=[]; - minG = min(nonzeros(vv(:,d))); - maxG = max(nonzeros(vv(:,d))); + minG=min(nonzeros(vv(:,d))); + maxG=max(nonzeros(vv(:,d))); usrmeanG= mean(nonzeros(vv(:,d))); usrStdG= std(nonzeros(vv(:,d))); NZusrIndxG= find(vv(:,d)); @@ -192,9 +192,9 @@ ru= r + std(vvr(medianIndxG,dmSel)); %r + Exp(expN).Dexp(DexpN).RFcmpr(RFnum). lfast= l - std(vv(medianIndxG,dmSel)); %l - Exp(expN).Dexp(DexpN).RFcmpL(RFnum).dm(inDM).std; lslow= l + std(vv(medianIndxG,dmSel)); %l + Exp(expN).Dexp(DexpN).RFcmpL(RFnum).dm(inDM).std; -try Kstr=Ks(1:5); catch, Kstr = Ks(1:length(Ks)); end -try rstr=rs(1:5); catch, rstr = rs(1:length(rs)); end -try Lstr=Ls(1:5); catch, Lstr = Ls(1:length(Ls)); end +try Kstr=Ks(1:5); catch, Kstr=Ks(1:length(Ks)); end +try rstr=rs(1:5); catch, rstr=rs(1:length(rs)); end +try Lstr=Ls(1:5); catch, Lstr=Ls(1:length(Ls)); end pertSel=Exp(zoneSel).Dexp(DexpN).pertSel; %floor(get(handles.DMsldr1,'value')); @@ -208,7 +208,7 @@ t=1:200; clear g; try -g = K ./ (1 + exp(-r.* (t - l ))); +g= K ./ (1 + exp(-r.* (t - l ))); gSlow= Kl ./ (1 + exp(-rl.* (t - lslow ))); gFast= Ku ./ (1 + exp(-ru.* (t - lfast ))); if K==0||r==0||l==0, g(1:200)=1;gSlow(1:200)=1;gFast(1:200)=1;end @@ -451,16 +451,16 @@ ru= r + std(vvr(medianIndxP,dmSel)); %r + Exp(expN).Dexp(DexpN).RFcmpr(RFnum). lfast= l - std(vv(medianIndxP,dmSel)); %l - Exp(expN).Dexp(DexpN).RFcmpL(RFnum).dm(inDM).std; lslow= l + std(vv(medianIndxP,dmSel)); %l + Exp(expN).Dexp(DexpN).RFcmpL(RFnum).dm(inDM).std; -try Kstr=Ks(1:5); catch, Kstr = Ks(1:length(Ks)); end -try rstr=rs(1:5); catch, rstr = rs(1:length(rs)); end -try Lstr=Ls(1:5); catch, Lstr = Ls(1:length(Ls)); end +try Kstr=Ks(1:5); catch, Kstr=Ks(1:length(Ks)); end +try rstr=rs(1:5); catch, rstr=rs(1:length(rs)); end +try Lstr=Ls(1:5); catch, Lstr=Ls(1:length(Ls)); end t=1:200; clear g; try -g = K ./ (1 + exp(-r.* (t - l ))); +g= K ./ (1 + exp(-r.* (t - l ))); gSlow= Kl ./ (1 + exp(-rl.* (t - lslow ))); gFast= Ku ./ (1 + exp(-ru.* (t - lfast ))); if K==0||r==0||l==0, g(1:200)=1;gSlow(1:200)=1;gFast(1:200)=1;end diff --git a/workflow/apps/matlab/ezview/EZmDayTrend.m b/workflow/apps/matlab/ezview/EZmDayTrend.m index d9445a80..1470f14b 100755 --- a/workflow/apps/matlab/ezview/EZmDayTrend.m +++ b/workflow/apps/matlab/ezview/EZmDayTrend.m @@ -373,7 +373,7 @@ end %Plot new intL try % zeroCLn= zeros(1,days) - % Exp(zoneSel).hzeroCLn = plot(DNLaxes,zeroCLn,1:days,'y'); + % Exp(zoneSel).hzeroCLn=plot(DNLaxes,zeroCLn,1:days,'y'); Exp(zoneSel).hintL(tracN)= plot(DNLaxes,intL,1:days); Exp(zoneSel).hintLb(tracN)= plot(DNLaxes,intL,1:days,'rs'); Exp(zoneSel).hintLadj(tracN)= plot(DNLaxes,intLadj,1:days,'g'); Exp(zoneSel).hintLadjb(tracN)= plot(DNLaxes,intLadj,1:days,'gs'); catch, diff --git a/workflow/apps/matlab/ezview/EZmultiDay.m b/workflow/apps/matlab/ezview/EZmultiDay.m index 7be60a33..00c70c8f 100755 --- a/workflow/apps/matlab/ezview/EZmultiDay.m +++ b/workflow/apps/matlab/ezview/EZmultiDay.m @@ -3,45 +3,42 @@ global exp global exDlst global exFolder -c= strfind(exDlst,' '); -d= strfind(exDlst,'_'); +c=strfind(exDlst,' '); +d=strfind(exDlst,'_'); clear expDlstS ii=0; for n=1:(size(c,1)) - if ((sum(ismember(cell2mat(c(n)),[3,4]))==1 && ~isempty(ismember(cell2mat(c(n)),[3,4])))||... - (sum(ismember(cell2mat(d(n)),[3,4]))==1 && ~isempty(ismember(cell2mat(d(n)),[3,4])))) - ii= ii+1; - expDlst(ii)= exDlst(n); - end - + if ((sum(ismember(cell2mat(c(n)),[3,4]))==1 && ~isempty(ismember(cell2mat(c(n)),[3,4]))) ||... + (sum(ismember(cell2mat(d(n)),[3,4]))==1 && ~isempty(ismember(cell2mat(d(n)),[3,4])))) + ii=ii+1; + expDlst(ii)=exDlst(n); + end end clear matFile ii=0; for m= 1:size(expDlst,2) - exD=fullfile(exFolder,cell2mat(expDlst(m))) - dirLst=dir(exD); - - clear matFlst - clear resF - clear resMatF + exD=fullfile(exFolder,cell2mat(expDlst(m))) + dirLst=dir(exD); + clear matFlst + clear resF + clear resMatF - for n=1:size(dirLst,1) - if sum(ismember('Results2', dirLst(n).name))==8 - resF= dirLst(n).name - resMatF= fullfile(exFolder,cell2mat(expDlst(m)),resF,'matResults') - matFlst= dir(resMatF) - for o=1:size(matFlst,1) - if sum(ismember('.mat', matFlst(o).name))==4 + for n=1:size(dirLst,1) + if sum(ismember('Results2', dirLst(n).name))==8 + resF=dirLst(n).name + resMatF=fullfile(exFolder,cell2mat(expDlst(m)),resF,'matResults') + matFlst=dir(resMatF) + for o=1:size(matFlst,1) + if sum(ismember('.mat', matFlst(o).name))==4 ii= ii+1; - resDir{ii}= fullfile(exFolder,cell2mat(expDlst(m)),resF) - matFile(m)= cellstr(fullfile(resMatF,matFlst(o).name)) - end - end %for o=1:size(matFlst,1) - - end %if sum(ismember('Results2', dirLst(n).name)) - end %for n=1:size(dirLst,1) -end %for m= 1:size(expDlst,2) + resDir{ii}=fullfile(exFolder,cell2mat(expDlst(m)),resF) + matFile(m)=cellstr(fullfile(resMatF,matFlst(o).name)) + end + end + end + end +end Exp(expN).DexpLength= size(matFile,2); Exp(expN).DexpN= size(matFile,2); diff --git a/workflow/apps/matlab/ezview/EZmultiDayExp.m b/workflow/apps/matlab/ezview/EZmultiDayExp.m index 175b8bc0..c77eb9fb 100755 --- a/workflow/apps/matlab/ezview/EZmultiDayExp.m +++ b/workflow/apps/matlab/ezview/EZmultiDayExp.m @@ -21,8 +21,8 @@ exDirs=dir(exFolder) exFs= {exDirs.name} -f = figure('Menubar','none','Position',[1000 100 640 750],'Name','Select Exp Folders' ); -hListbox = uicontrol(... +f=figure('Menubar','none','Position',[1000 100 640 750],'Name','Select Exp Folders' ); +hListbox=uicontrol(... 'Style', 'listbox',... 'String',sort(exFs),... 'value',[],... @@ -36,8 +36,8 @@ function load_listbox(source,eventdata) %global CSrchRng %global CSrearchRange -userIndx = (get(source,'value')) -userStr = (get(source,'string')) +userIndx=(get(source,'value')) +userStr=(get(source,'string')) %scLstIndx= str2num(char(strrep(userStr(userIndx), 'Scan', ''))) user_entry=userStr(userIndx) @@ -51,7 +51,7 @@ user_entry=userStr(userIndx) yPos=0.85-(btnNumber-1)*(btnHt+spacing); btnPos=[xPos yPos-spacing btnWid btnHt]; -hedit8 = uicontrol(... +hedit8=uicontrol(... 'Style', 'pushbutton',... 'String',{'Continue'},... 'Units','normalized',... diff --git a/workflow/apps/matlab/ezview/EZmultiDayGui.m b/workflow/apps/matlab/ezview/EZmultiDayGui.m index d71091c5..2a3271c1 100755 --- a/workflow/apps/matlab/ezview/EZmultiDayGui.m +++ b/workflow/apps/matlab/ezview/EZmultiDayGui.m @@ -50,7 +50,7 @@ function EZmultiDayGui f=figure('Menubar','none','Position',[1000 100 640 750],'Name','Select Exp Folders' ); - hListbox = uicontrol(... + hListbox=uicontrol(... 'Style', 'listbox',... 'String',ExpOrderByExp,... 'value',[],... @@ -72,7 +72,7 @@ function EZmultiDayGui yPos=0.85-(btnNumber-1)*(btnHt+spacing); btnPos=[xPos yPos-spacing btnWid btnHt]; - hedit8 = uicontrol(... + hedit8=uicontrol(... 'Style', 'pushbutton',... 'String',{'Continue'},... 'Units','normalized',... diff --git a/workflow/apps/matlab/ezview/EZmultiExLoad.m b/workflow/apps/matlab/ezview/EZmultiExLoad.m index a6358200..e085de39 100755 --- a/workflow/apps/matlab/ezview/EZmultiExLoad.m +++ b/workflow/apps/matlab/ezview/EZmultiExLoad.m @@ -173,12 +173,12 @@ EZVimDisplay %* %********************* usrRefFg=0; - prompt = {'Enter GeneName to use as Reference:',... + prompt={'Enter GeneName to use as Reference:',... 'Enter Specifics Term if used to futher specify Reference '} - dlg_title = 'User Reference Input'; - num_lines = 1; - def = {'RF1','None'}; - answer = inputdlg(prompt,dlg_title,num_lines,def); + dlg_title='User Reference Input'; + num_lines=1; + def={'RF1','None'}; + answer=inputdlg(prompt,dlg_title,num_lines,def); if iscell(answer(1)) rfGene= cell2mat(answer(1)); else @@ -266,7 +266,7 @@ if expN==1 %Adapted to accomodate AppDesigner 230821 set(handles.listboxGnOrf,'string',Exp(1).Dexp(1).srtGnLst) end DNLaxes1= handles.DNLaxes1; - Exp(1).hzeroCLn(expLdCnt) = plot(DNLaxes1,zeroCLn,1:DMnum,'y'); + Exp(1).hzeroCLn(expLdCnt)=plot(DNLaxes1,zeroCLn,1:DMnum,'y'); end if expN==2 %Adapted to accomodate AppDesigner 230821 @@ -283,7 +283,7 @@ if expN==2 %Adapted to accomodate AppDesigner 230821 set(handles.listboxGnOrf,'string',Exp(2).Dexp(1).srtGnLst) end DNLaxes2= handles.DNLaxes2; - Exp(2).hzeroCLn(expLdCnt) = plot(DNLaxes2,zeroCLn,1:DMnum,'y'); + Exp(2).hzeroCLn(expLdCnt)=plot(DNLaxes2,zeroCLn,1:DMnum,'y'); end @@ -301,7 +301,7 @@ if expN==3 %Adapted to accomodate AppDesigner 230821 set(handles.listboxGnOrf,'string',Exp(3).Dexp(1).srtGnLst) end DNLaxes3= handles.DNLaxes3; - Exp(3).hzeroCLn(expLdCnt) = plot(DNLaxes3,zeroCLn,1:DMnum,'y'); + Exp(3).hzeroCLn(expLdCnt)=plot(DNLaxes3,zeroCLn,1:DMnum,'y'); end if Exp(4).interacPBsel==0 %if interaction "raw" don't show a center line diff --git a/workflow/apps/matlab/ezview/EZmultiGeneRFsLst.m b/workflow/apps/matlab/ezview/EZmultiGeneRFsLst.m index 773a5d1b..2604dd04 100755 --- a/workflow/apps/matlab/ezview/EZmultiGeneRFsLst.m +++ b/workflow/apps/matlab/ezview/EZmultiGeneRFsLst.m @@ -301,7 +301,7 @@ else Exp(expN).Dexp(n).RFmd1indx(d+1)=firstZero; Exp(expN).Dexp(n).RFmd1pltN= RF1mp; - try medValList1{d+1}= Exp(expN).Dexp(n).scan(rf1scN).plate(1).CFout(medianIndx,5); nonZeroCnt; catch, catcherror = 'Ln356', end + try medValList1{d+1}= Exp(expN).Dexp(n).scan(rf1scN).plate(1).CFout(medianIndx,5); nonZeroCnt; catch, catcherror='Ln356', end end %~isempty(nonZeroIndx) && length(medianIndx) > (.15*384) catch %try ~ln375 @@ -595,8 +595,8 @@ uu= horzcat(uu,vv); for d=1:DMnum medianIndxG=[]; NZrfIndxG=[]; - minG = min(nonzeros(vv(:,d))); - maxG = max(nonzeros(vv(:,d))); + minG=min(nonzeros(vv(:,d))); + maxG=max(nonzeros(vv(:,d))); RFmeanG= mean(nonzeros(vv(:,d))); RFstdG= std(nonzeros(vv(:,d))); NZrfIndxG= find(vv(:,d)); %find(nonzeros(vv(:,d))); diff --git a/workflow/apps/matlab/ezview/EZplotUcmp.m b/workflow/apps/matlab/ezview/EZplotUcmp.m index d116b55a..a9872be9 100755 --- a/workflow/apps/matlab/ezview/EZplotUcmp.m +++ b/workflow/apps/matlab/ezview/EZplotUcmp.m @@ -1,299 +1,256 @@ -%EZplotUcmp.m +% EZplotUcmp.m +% User find and build composite of Selected Gene Composite and +% Plot it on OLay Plot and Trend plot DNLaxles +% For Single and Multi experiment Studies +% Called when Composite_ toggle button is clicked. +% Data stored for printable Trend Plot production (click [L] in DNLaxes ) -%***********User find and build composite of Selected Gene Composite and -%*************Plot it on OLay Plot and Trend plot DNLaxles -%***************For Single and Multi experiment Studies -%Called when Composite_ toggle button is clicked. -%Data stored for printable Trend Plot production (click [L] in DNLaxes ) -%********************* global ghandles global Exp global exDlst -global exFolder - traceN=Exp(expN).traceN; -DexpN= Exp(expN).DexpN; +DexpN=Exp(expN).DexpN; dmSel=Exp(zoneSel).Dexp(DexpN).pertSel; -%dmSel= str2num(get(ghandles.DMed3,'string')) - +% dmSel=str2num(get(ghandles.DMed3,'string')) +patrnN=strfind(selGnOrf{1},':'); % extract Gene-Orf Name +patrndash=strfind(selGnOrf{1},'-'); +selStrNm=char(selGnOrf); +usrGene=selStrNm(1:(patrnN(1)-1)); -patrnN=strfind(selGnOrf{1},':'); %Extract Gene-Orf Name -patrndash= strfind(selGnOrf{1},'-'); -selStrNm= char(selGnOrf) -usrGene= selStrNm(1:(patrnN(1)-1)); if strcmpi(selStrNm(1:3),'RF-') - usrGeneSearch= selStrNm(4:(patrndash(2)-1)); + usrGeneSearch=selStrNm(4:(patrndash(2)-1)); elseif strcmp(selStrNm(1:3),'RF1') - usrGeneSearch= selStrNm(1:3); + usrGeneSearch=selStrNm(1:3); else - usrGeneSearch= selStrNm(1:(patrnN(1)-1)); + usrGeneSearch=selStrNm(1:(patrnN(1)-1)); end +prompt={'Enter Specifics Term if used to futher specify selection '}; +dlg_title='User Specifics Term for Refinement Composite'; +num_lines=1; +def={'None'}; +answer=inputdlg(prompt,dlg_title,num_lines,def); +usrSpec=cell2mat(answer(1)); - - prompt = {'Enter Specifics Term if used to futher specify selection '}; - dlg_title = 'User Specifics Term for Refinement Composite'; - num_lines = 1; - def = {'None'}; - answer = inputdlg(prompt,dlg_title,num_lines,def); - usrSpec= cell2mat(answer(1)); - if strcmpi(usrSpec,'None'), usrGnSp= {strcat(usrGene,'-')}; - elseif length(usrSpec)> 8, - trimUspec= usrSpec(1:8); - usrGnSp= strcat(usrGene,',',{trimUspec}); - else - trimUspec= usrSpec; - usrGnSp= strcat(usrGene,',',{trimUspec}); - end +if strcmpi(usrSpec,'None'), usrGnSp={strcat(usrGene,'-')}; +elseif length(usrSpec)> 8, + trimUspec=usrSpec(1:8); + usrGnSp=strcat(usrGene,',',{trimUspec}); +else + trimUspec=usrSpec; + usrGnSp=strcat(usrGene,',',{trimUspec}); +end -%for n= DexpN:DexpN %n= 1:Exp(expN).DexpLength %LOOP Thru DayExps -n= DexpN; +% For n=DexpN:DexpN %n=1:Exp(expN).DexpLength %LOOP Thru DayExps +n=DexpN; MPnum=length(Exp(expN).Dexp(DexpN).MP); -DMnum= length(Exp(expN).Dexp(DexpN).DM.drug); - -%Extract expDay from ExpName string -dayNpos= max(strfind(Exp(expN).Dexp(DexpN).ExpFoldr, '_D')); -dayLbl= Exp(expN).Dexp(DexpN).ExpFoldr(dayNpos+1:end); - - -%********************************* - +DMnum=length(Exp(expN).Dexp(DexpN).DM.drug); +% Extract expDay from ExpName string +dayNpos=max(strfind(Exp(expN).Dexp(DexpN).ExpFoldr, '_D')); +dayLbl=Exp(expN).Dexp(DexpN).ExpFoldr(dayNpos+1:end); dRF1indx=0; +usrSp=usrSpec; % user entry of Specifics for Ref selection -usrSp= usrSpec; %user entry of Specifics for Ref selection - -%******************************************************* for mp=1:length(Exp(expN).Dexp(DexpN).MP) - for ind384=1:384 - try % - %Insert test for numeric in genename and orf if isnumeric - %Correct common EXCEL problem of converting OCT1 into a date numeric - if cell2mat(Exp(expN).Dexp(DexpN).MP(mp).genename{1}(ind384))==38991, - Exp(expN).Dexp(DexpN).MP(mp).genename{1}(ind384)={'OCT1_'}; - elseif isnumeric(cell2mat(Exp(expN).Dexp(DexpN).MP(mp).genename{1}(ind384))) - Exp(expN).Dexp(DexpN).MP(mp).genename{1}(ind384)={' '}; - end - %***************************************************************** - - %DISPersed REFerence capture and find Medians - if ( ((strcmpi((Exp(expN).Dexp(DexpN).MP(mp).genename{1}(ind384)),usrGeneSearch) && ... - strcmpi((Exp(expN).Dexp(DexpN).MP(mp).specifics{1}(ind384)),usrSp)))... - || ((strcmpi((Exp(expN).Dexp(DexpN).MP(mp).genename{1}(ind384)),usrGeneSearch) && ... - strcmpi(usrSp,'None'))) ), - - dRF1indx=dRF1indx+1; - Exp(expN).Dexp(DexpN).MP(mp).genename{1}(ind384) =strrep((Exp(expN).Dexp(DexpN).MP(mp).genename{1}(ind384)),':',' '); - drf(dRF1indx,1)= (Exp(expN).Dexp(DexpN).MP(mp).genename{1}(ind384)); - drf(dRF1indx,2)={mp}; drfMP(dRF1indx,mp)= mp; - drf(dRF1indx,3)={ind384}; drfPindx(dRF1indx,mp)= ind384; - %drf(dRF1indx,7)= (Exp(expN).Dexp(DexpN).MP(mp).specifics{1}(ind384)); - - end %if isempty(regexpi(char((Exp(expN).Dexp(DexpN).MP(mp).genename{1}(ind384))),'blank'))... - %******************************************************************************* - catch - msgBadGeneName= strcat('check genename at mp=',num2str(mp),' indx=',num2str(ind384)) - end - - end %end associated with for ind384=1:384 - mp -end %end associated with for mp=1:length(Exp(expN).Dexp(DexpN).MP) -%***************************************************** -%************************************************************************************************ + try + % Insert test for numeric in genename and orf if isnumeric + % Correct common EXCEL problem of converting OCT1 into a date numeric + if cell2mat(Exp(expN).Dexp(DexpN).MP(mp).genename{1}(ind384))==38991, + Exp(expN).Dexp(DexpN).MP(mp).genename{1}(ind384)={'OCT1_'}; + elseif isnumeric(cell2mat(Exp(expN).Dexp(DexpN).MP(mp).genename{1}(ind384))) + Exp(expN).Dexp(DexpN).MP(mp).genename{1}(ind384)={' '}; + end + + % DISPersed REFerence capture and find Medians + if ( ((strcmpi((Exp(expN).Dexp(DexpN).MP(mp).genename{1}(ind384)),usrGeneSearch) && ... + strcmpi((Exp(expN).Dexp(DexpN).MP(mp).specifics{1}(ind384)),usrSp))) || ... + ((strcmpi((Exp(expN).Dexp(DexpN).MP(mp).genename{1}(ind384)),usrGeneSearch) && ... + strcmpi(usrSp,'None'))) ), + dRF1indx=dRF1indx+1; + Exp(expN).Dexp(DexpN).MP(mp).genename{1}(ind384) =strrep((Exp(expN).Dexp(DexpN).MP(mp).genename{1}(ind384)),':',' '); + drf(dRF1indx,1)=(Exp(expN).Dexp(DexpN).MP(mp).genename{1}(ind384)); + drf(dRF1indx,2)={mp}; drfMP(dRF1indx,mp)=mp; + drf(dRF1indx,3)={ind384}; drfPindx(dRF1indx,mp)=ind384; + %drf(dRF1indx,7)=(Exp(expN).Dexp(DexpN).MP(mp).specifics{1}(ind384)); + end + catch + msgBadGeneName=strcat('check genename at mp=',num2str(mp),' indx=',num2str(ind384)) + end + end + mp +end -vvL=[]; %Initialize to cover case where all spot are Zero NoGrowth See NIGrowthflg==0 +vvL=[]; % initialize to cover case where all spot are Zero NoGrowth See NIGrowthflg==0 if exist('drf','var') -%Det. index of change from one MP to the next + % Det. index of change from one MP to the next i=2; clear chgIndx chgIndx(1)=1; -for j=1:length(drf(:,3)) - if j>1 - if cell2mat(drf(j,2))~= cell2mat(drf((j-1),2)), chgIndx(i)=j; i=i+1; end - end -end -chgIndx(length(chgIndx)+1)= size(drf,1) +1; %length(drf)+1; - -vvL= zeros(size(drf,1),1 ); %length(drf)+1; -%************************************ - dMPs= unique(cell2mat(drf(:,2))); - %***************************************** - for d= 1:length(Exp(expN).Dexp(DexpN).DM.drug) - for mm=1:length(dMPs) % length(chgIndx) - usrScNdisp=((dMPs(mm)-1)*DMnum)+(d); - NZusrIndx= drfPindx((find(drfPindx(:,dMPs(mm)))),dMPs(mm)); medianIndxDisp= NZusrIndx; - vvL(chgIndx(mm):(chgIndx(mm+1)-1))=Exp(expN).Dexp(DexpN).scan(usrScNdisp).plate(1).CFout(NZusrIndx,5); - %For Global Ref Composite 17_1009 %************************************************************************** - vvK(chgIndx(mm):(chgIndx(mm+1)-1))=Exp(expN).Dexp(DexpN).scan(usrScNdisp).plate(1).CFout(NZusrIndx,3); - vvr(chgIndx(mm):(chgIndx(mm+1)-1))=Exp(expN).Dexp(DexpN).scan(usrScNdisp).plate(1).CFout(NZusrIndx,4); - %***************************************************************************************************** - end %for mm=1:length(dMPs) - -%****************CALC. GLOBAL MEAN, STD, AND MEDIAN FOR DISTRIBUTED REFERENCES****************************************************************** - %for d= 1:length(Exp(expN).Dexp(DexpN).DM.drug) - NZusrIndxG=[]; - NZusrIndxG= find(vvL); - - if isempty(nonzeros(vvL)), nonZeroCntD=0; - else nonZeroCntD= length(nonzeros(vvL)); - end - %Calc. of median value for composite doesn't require and odd number of Indx items - NZusrIndxG= NZusrIndxG(:); - if ~isempty(NZusrIndxG) && length(NZusrIndxG) > 0 %(.15*size(drf,1)) %To calc. a median, more than 15% of spots must be nonZero - -UsrLvals{d}= vvL(NZusrIndxG); -UsrKvals{d}= vvK(NZusrIndxG); -Usrrvals{d}= vvr(NZusrIndxG); + for j=1:length(drf(:,3)) + if j>1 + if cell2mat(drf(j,2))~=cell2mat(drf((j-1),2)), chgIndx(i)=j; i=i+1; end + end + end + chgIndx(length(chgIndx)+1)=size(drf,1) +1; % length(drf)+1; + vvL=zeros(size(drf,1),1 ); % length(drf)+1; + dMPs=unique(cell2mat(drf(:,2))); + for d=1:length(Exp(expN).Dexp(DexpN).DM.drug) + for mm=1:length(dMPs) % length(chgIndx) + usrScNdisp=((dMPs(mm)-1)*DMnum)+(d); + NZusrIndx=drfPindx((find(drfPindx(:,dMPs(mm)))),dMPs(mm)); + medianIndxDisp=NZusrIndx; + vvL(chgIndx(mm):(chgIndx(mm+1)-1))=Exp(expN).Dexp(DexpN).scan(usrScNdisp).plate(1).CFout(NZusrIndx,5); + vvK(chgIndx(mm):(chgIndx(mm+1)-1))=Exp(expN).Dexp(DexpN).scan(usrScNdisp).plate(1).CFout(NZusrIndx,3); + vvr(chgIndx(mm):(chgIndx(mm+1)-1))=Exp(expN).Dexp(DexpN).scan(usrScNdisp).plate(1).CFout(NZusrIndx,4); end -end + % CALC. GLOBAL MEAN, STD, AND MEDIAN FOR DISTRIBUTED REFERENCES + % for d=1:length(Exp(expN).Dexp(DexpN).DM.drug) + NZusrIndxG=[]; + NZusrIndxG=find(vvL); + + if isempty(nonzeros(vvL)) + nonZeroCntD=0; + else + nonZeroCntD=length(nonzeros(vvL)); + end + %Calc. of median value for composite doesn't require and odd number of Indx items + NZusrIndxG=NZusrIndxG(:); + if ~isempty(NZusrIndxG) && length(NZusrIndxG) > 0 %(.15*size(drf,1)) %To calc. a median, more than 15% of spots must be nonZero + UsrLvals{d}=vvL(NZusrIndxG); + UsrKvals{d}=vvK(NZusrIndxG); + Usrrvals{d}=vvr(NZusrIndxG); + end + end +end -end % if exist('drf','var') - -%END OF DISPERSE -%********************************************************************* -%#################################################################### -%end %for n=1:Exp(expN).DexpLength %Loop thru Dayexps - - -if ~exist('drf','var'), - errordlg('Gene-Specifics combination not found. Check spelling of Specifics entry.','Entry Warning'); - break; +if ~exist('drf','var') + errordlg('Gene-Specifics combination not found. Check spelling of Specifics entry.','Entry Warning'); + break; end NoGrowthflg=0; -if isempty(vvL), - warndlg('No Growth condition found for Gene-Specifics combination. . ','No Growth warning'); - NoGrowthflg=1; +if isempty(vvL) + warndlg('No Growth condition found for Gene-Specifics combination. . ','No Growth warning'); + NoGrowthflg=1; end - -%####################################################################### - - -%***********PLOT Values Selected Gene-Specifics Composite ******************************************try +% Plot Values Selected Gene-Specifics Composite if NoGrowthflg==0 -smpSz= size(NZusrIndxG,1); -K= median(cell2mat((UsrKvals(dmSel)))); Ks= num2str(K); Kstd= std(cell2mat((UsrKvals(dmSel)))); KstdStr= num2str(Kstd); -r= median(cell2mat((Usrrvals(dmSel)))); rs= num2str(r); rstd= std(cell2mat((Usrrvals(dmSel)))); rstdStr= num2str(rstd); -l= median(cell2mat((UsrLvals(dmSel)))); Ls= num2str(l); Lstd= std(cell2mat((UsrLvals(dmSel)))); LstdStr= num2str(Lstd); -Kl= K - Kstd; %std(UsrKvals(dmSel)); -Ku= K + Kstd; %std(UsrKvals(dmSel)); -rl= r - rstd; %std(Usrrvals(dmSel)); -ru= r + rstd; %std(UsrKvals(dmSel)); -lfast= l - Lstd; -lslow= l + Lstd; -elseif NoGrowth==1 %if all data is zero (NoGrowth) - smpSz= size(NZusrIndxG,1); -K= 0; Ks= num2str(K); Kstd= 0; KstdStr= num2str(0); -r= 0; rs= num2str(r); rstd= 0; rstdStr= num2str(0); -l= 0; Ls= num2str(l); Lstd= 0; LstdStr= num2str(0); -Kl= K - Kstd; -Ku= K + Kstd; -rl= r - rstd; -ru= r + rstd; -lfast= l - Lstd; -lslow= l + Lstd; + smpSz=size(NZusrIndxG,1); + K=median(cell2mat((UsrKvals(dmSel)))); Ks=num2str(K); Kstd=std(cell2mat((UsrKvals(dmSel)))); KstdStr=num2str(Kstd); + r=median(cell2mat((Usrrvals(dmSel)))); rs=num2str(r); rstd=std(cell2mat((Usrrvals(dmSel)))); rstdStr=num2str(rstd); + l=median(cell2mat((UsrLvals(dmSel)))); Ls=num2str(l); Lstd=std(cell2mat((UsrLvals(dmSel)))); LstdStr=num2str(Lstd); + Kl=K - Kstd; %std(UsrKvals(dmSel)); + Ku=K + Kstd; %std(UsrKvals(dmSel)); + rl=r - rstd; %std(Usrrvals(dmSel)); + ru=r + rstd; %std(UsrKvals(dmSel)); + lfast=l - Lstd; + lslow=l + Lstd; +elseif NoGrowth==1 % if all data is zero (NoGrowth) + smpSz=size(NZusrIndxG,1); + K=0; Ks=num2str(K); Kstd=0; KstdStr=num2str(0); + r=0; rs=num2str(r); rstd=0; rstdStr=num2str(0); + l=0; Ls=num2str(l); Lstd=0; LstdStr=num2str(0); + Kl=K - Kstd; + Ku=K + Kstd; + rl=r - rstd; + ru=r + rstd; + lfast=l - Lstd; + lslow=l + Lstd; end -try Kstr=Ks(1:5); catch, Kstr = Ks(1:length(Ks)); end -try rstr=rs(1:5); catch, rstr = rs(1:length(rs)); end -try Lstr=Ls(1:5); catch, Lstr = Ls(1:length(Ls)); end - - - plateNum=(LBmp-1)*destPerMP + dmSel; - MP=Exp(zoneSel).Dexp(DexpN).MP; +try Kstr=Ks(1:5); catch, Kstr=Ks(1:length(Ks)); end +try rstr=rs(1:5); catch, rstr=rs(1:length(rs)); end +try Lstr=Ls(1:5); catch, Lstr=Ls(1:length(Ls)); end + +plateNum=(LBmp-1)*destPerMP + dmSel; +MP=Exp(zoneSel).Dexp(DexpN).MP; -try - -t=1:200; -clear g; - try -g = K ./ (1 + exp(-r.* (t - l ))); -gSlow= Kl ./ (1 + exp(-rl.* (t - lslow ))); -gFast= Ku ./ (1 + exp(-ru.* (t - lfast ))); -if K==0||r==0||l==0, g(1:200)=1;gSlow(1:200)=1;gFast(1:200)=1;end + t=1:200; + clear g; + try + g=K ./ (1 + exp(-r.* (t - l ))); + gSlow=Kl ./ (1 + exp(-rl.* (t - lslow ))); + gFast=Ku ./ (1 + exp(-ru.* (t - lfast ))); + if K==0||r==0||l==0, g(1:200)=1;gSlow(1:200)=1;gFast(1:200)=1;end + if zoneSel==1, plotAxes=ghandles.Paxes1; OLaxes=ghandles.OLaxes1; + Dlaxes=ghandles.Dlaxes1;Dkaxes=ghandles.Dkaxes1;Draxes=ghandles.Draxes1; + Exp(1).traceN=Exp(1).traceN+1; + traceN=Exp(1).traceN; + end + if zoneSel==2, plotAxes=ghandles.Paxes2; OLaxes=ghandles.OLaxes2;Daxes=ghandles.Daxes2; + Dlaxes=ghandles.Dlaxes2;Dkaxes=ghandles.Dkaxes2;Draxes=ghandles.Draxes2; + Exp(2).traceN=Exp(2).traceN+1; + traceN=Exp(2).traceN; + end + if zoneSel==3, plotAxes=ghandles.Paxes3; OLaxes=ghandles.OLaxes3;Daxes=ghandles.Daxes3; + Dlaxes=ghandles.Dlaxes3;Dkaxes=ghandles.Dkaxes3;Draxes=ghandles.Draxes3; + Exp(3).traceN=Exp(3).traceN+1; + traceN=Exp(3).traceN; + end + plot(plotAxes,t,g);hold (plotAxes,'on'); + plot(plotAxes,t,gSlow,'y');plot(plotAxes,t,gFast,'r');hold (plotAxes,'off'); + Exp(expN).Trace(traceN).UsrGLB=usrGnSp; + Exp(expN).Trace(traceN).dmSel=dmSel; + Exp(expN).Trace(traceN).DexpN=DexpN; + for d=1:length(Exp(expN).Dexp(DexpN).DM.drug) %LOOP Thru DrugMedias + Exp(expN).Trace(traceN).Dexp(DexpN).DM(d).UsrLvals=UsrLvals(d); + Exp(expN).Trace(traceN).Dexp(DexpN).DM(d).UsrKvals=UsrKvals(d); + Exp(expN).Trace(traceN).Dexp(DexpN).DM(d).Usrrvals=Usrrvals(d); + end - if zoneSel==1, plotAxes=ghandles.Paxes1; OLaxes=ghandles.OLaxes1; - Dlaxes=ghandles.Dlaxes1;Dkaxes=ghandles.Dkaxes1;Draxes=ghandles.Draxes1; - Exp(1).traceN=Exp(1).traceN+1; - traceN=Exp(1).traceN; - end - if zoneSel==2, plotAxes=ghandles.Paxes2; OLaxes=ghandles.OLaxes2;Daxes=ghandles.Daxes2; - Dlaxes=ghandles.Dlaxes2;Dkaxes=ghandles.Dkaxes2;Draxes=ghandles.Draxes2; - Exp(2).traceN=Exp(2).traceN+1; - traceN=Exp(2).traceN; - end - if zoneSel==3, plotAxes=ghandles.Paxes3; OLaxes=ghandles.OLaxes3;Daxes=ghandles.Daxes3; - Dlaxes=ghandles.Dlaxes3;Dkaxes=ghandles.Dkaxes3;Draxes=ghandles.Draxes3; - Exp(3).traceN=Exp(3).traceN+1; - traceN=Exp(3).traceN; - end -plot(plotAxes,t,g);hold (plotAxes,'on'); -plot(plotAxes,t,gSlow,'y');plot(plotAxes,t,gFast,'r');hold (plotAxes,'off'); + % Store L R and K valves for manual selected Composite [C] plots + Exp(expN).ll(traceN)=l; Exp(expN).rr(traceN)=r; Exp(expN).kk(traceN)=K; + Exp(expN).lslow(traceN)=lslow; Exp(expN).lfast(traceN)=lfast; -Exp(expN).Trace(traceN).UsrGLB= usrGnSp; -Exp(expN).Trace(traceN).dmSel= dmSel; -Exp(expN).Trace(traceN).DexpN= DexpN; -for d= 1:length(Exp(expN).Dexp(DexpN).DM.drug) %LOOP Thru DrugMedias -Exp(expN).Trace(traceN).Dexp(DexpN).DM(d).UsrLvals= UsrLvals(d); -Exp(expN).Trace(traceN).Dexp(DexpN).DM(d).UsrKvals= UsrKvals(d); -Exp(expN).Trace(traceN).Dexp(DexpN).DM(d).Usrrvals= Usrrvals(d); -end -%************CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC************************************** -%Store L R and K valves for manual selected Composite [C] plots -Exp(expN).ll(traceN)= l; Exp(expN).rr(traceN)= r; Exp(expN).kk(traceN)= K; -Exp(expN).lslow(traceN)= lslow; Exp(expN).lfast(traceN)= lfast; -%************************************************************************ -try for i=1:length(Exp(zoneSel).hOL(:)),set(Exp(zoneSel).hOL(i),'color',[0 0 1]); end, catch; end -Exp(zoneSel).hOL(traceN)=plot(OLaxes,t,g);hold on; -set(Exp(zoneSel).hOL(traceN),'color',[1 0 0]) + try + for i=1:length(Exp(zoneSel).hOL(:)),set(Exp(zoneSel).hOL(i),'color',[0 0 1]); end + catch + end -catch + Exp(zoneSel).hOL(traceN)=plot(OLaxes,t,g);hold on; + set(Exp(zoneSel).hOL(traceN),'color',[1 0 0]) + catch catchissue='Ln100 EZlstBoxExt' -end %trycatch + end -%Get the DM agar description -if expN==1,DMstr=char(get(handles.DM1,'string'));end -if expN==2,DMstr=char(get(handles.DM2,'string'));end -if expN==3,DMstr=char(get(handles.DM3,'string'));end + % Get the DM agar description + if expN==1,DMstr=char(get(handles.DM1,'string'));end + if expN==2,DMstr=char(get(handles.DM2,'string'));end + if expN==3,DMstr=char(get(handles.DM3,'string'));end + gene=usrGnSp; orf='' %MP(1,LBmp).orf{1,1}(indx); + geneOrfstr=strcat(gene,'_',orf,'_'); + grfgenestr=strcat(gene,'_',orf,'_'); + graphStr=strcat(usrGnSp,'_','L=',Lstr,'_','Ls=',LstdStr,'_','r=',rstr,'_','rs=',rstdStr,'_','K=',Kstr,'Ks=',KstdStr); + spotDescrip=strcat(graphStr,'->',DMstr); - - - gene= usrGnSp; orf= '' %MP(1,LBmp).orf{1,1}(indx); - geneOrfstr= strcat(gene,'_',orf,'_'); - grfgenestr= strcat(gene,'_',orf,'_'); - -graphStr= strcat(usrGnSp,'_','L=',Lstr,'_','Ls=',LstdStr,'_','r=',rstr,'_','rs=',rstdStr,'_','K=',Kstr,'Ks=',KstdStr); -spotDescrip=strcat(graphStr,'->',DMstr); - -xp=char(Exp(zoneSel).Dexp(DexpN).resDir); -if ispc, + xp=char(Exp(zoneSel).Dexp(DexpN).resDir); + if ispc, slashPos=strfind(char(Exp(zoneSel).Dexp(DexpN).resDir),'\'); -else + else slashPos=strfind(char(Exp(zoneSel).Dexp(DexpN).resDir),'/'); -end + end -startPos=slashPos(length(slashPos)-1) +1; -endPos=slashPos(length(slashPos)) -1 -expStr= {xp(startPos:endPos)} + startPos=slashPos(length(slashPos)-1) +1; + endPos=slashPos(length(slashPos)) -1 + expStr={xp(startPos:endPos)} -Exp(zoneSel).hOLname(traceN)= spotDescrip; -Exp(zoneSel).hOLexpNm(traceN)= expStr; -Exp(zoneSel).hOLresDir(traceN)= {Exp(zoneSel).Dexp(DexpN).resDir}; -Exp(zoneSel).hOLplateNum(traceN)= plateNum; + Exp(zoneSel).hOLname(traceN)=spotDescrip; + Exp(zoneSel).hOLexpNm(traceN)=expStr; + Exp(zoneSel).hOLresDir(traceN)={Exp(zoneSel).Dexp(DexpN).resDir}; + Exp(zoneSel).hOLplateNum(traceN)=plateNum; - - -if zoneSel==1,set(ghandles.GeneOrfLoc1,'string',geneOrfstr);end % Displays the value. -if zoneSel==2,set(ghandles.GeneOrfLoc2,'string',geneOrfstr);end -if zoneSel==3,set(ghandles.GeneOrfLoc3,'string',geneOrfstr);end -if zoneSel==1,set(ghandles.graphStrLoc1,'string',spotDescrip);end %graphStr);end % Displays the value. -if zoneSel==2,set(ghandles.graphStrLoc2,'string',spotDescrip);end %graphStr);end -if zoneSel==3,set(ghandles.graphStrLoc3,'string',spotDescrip);end %graphStr);end + if zoneSel==1,set(ghandles.GeneOrfLoc1,'string',geneOrfstr);end % Displays the value. + if zoneSel==2,set(ghandles.GeneOrfLoc2,'string',geneOrfstr);end + if zoneSel==3,set(ghandles.GeneOrfLoc3,'string',geneOrfstr);end + if zoneSel==1,set(ghandles.graphStrLoc1,'string',spotDescrip);end %graphStr);end % Displays the value. + if zoneSel==2,set(ghandles.graphStrLoc2,'string',spotDescrip);end %graphStr);end + if zoneSel==3,set(ghandles.graphStrLoc3,'string',spotDescrip);end %graphStr);end catch - catchissue='Ln141 EZlstBoxExt' - msg='Error' -end % trycatch zoneSel<4 datatip selection from Image (not from an OverLay Plot) + catchissue='Ln141 EZlstBoxExt' + msg='Error' +end diff --git a/workflow/apps/matlab/ezview/EZsingleExUserRF.m b/workflow/apps/matlab/ezview/EZsingleExUserRF.m index 7dd4fab5..9d6cfd47 100755 --- a/workflow/apps/matlab/ezview/EZsingleExUserRF.m +++ b/workflow/apps/matlab/ezview/EZsingleExUserRF.m @@ -3,12 +3,12 @@ global exp usrRefFg=0; - prompt = {'Enter GeneName to use as Reference:',... + prompt={'Enter GeneName to use as Reference:',... 'Enter Specifics Term if used to futher specify Reference '} - dlg_title = 'User Reference Input'; - num_lines = 1; - def = {'RF1','None'}; - answer = inputdlg(prompt,dlg_title,num_lines,def); + dlg_title='User Reference Input'; + num_lines=1; + def={'RF1','None'}; + answer=inputdlg(prompt,dlg_title,num_lines,def); rfGene= cell2mat(answer(1)); if ~strcmpi(rfGene,'RF1')|| ~strcmpi(rfGene,'RF2'), usrRefFg=1; end rfSpec= answer(2); %if strcmpi(answer(2),'None'), rfSpec= ''; end @@ -81,7 +81,7 @@ if expN==1 set(handles.listboxGnOrf,'string',Exp(1).Dexp(1).srtGnLst) end DNLaxes1= handles.DNLaxes1; - Exp(1).hzeroCLn(expLdCnt) = plot(DNLaxes1,zeroCLn,1:DMnum,'y'); + Exp(1).hzeroCLn(expLdCnt)=plot(DNLaxes1,zeroCLn,1:DMnum,'y'); end if expN==2 @@ -95,7 +95,7 @@ if expN==2 set(handles.listboxGnOrf,'string',Exp(2).Dexp(1).srtGnLst) end DNLaxes2= handles.DNLaxes2; - Exp(2).hzeroCLn(expLdCnt) = plot(DNLaxes2,zeroCLn,1:DMnum,'y'); + Exp(2).hzeroCLn(expLdCnt)=plot(DNLaxes2,zeroCLn,1:DMnum,'y'); end @@ -110,7 +110,7 @@ if expN==3 set(handles.listboxGnOrf,'string',Exp(3).Dexp(1).srtGnLst) end DNLaxes3= handles.DNLaxes3; - Exp(3).hzeroCLn(expLdCnt) = plot(DNLaxes3,zeroCLn,1:DMnum,'y'); + Exp(3).hzeroCLn(expLdCnt)=plot(DNLaxes3,zeroCLn,1:DMnum,'y'); end if Exp(4).interacPBsel==0 %if interaction "raw" don't show a center line diff --git a/workflow/apps/matlab/ezview/EZspotview.m b/workflow/apps/matlab/ezview/EZspotview.m index 63f0afdd..979c5dda 100755 --- a/workflow/apps/matlab/ezview/EZspotview.m +++ b/workflow/apps/matlab/ezview/EZspotview.m @@ -19,7 +19,7 @@ if NoOLay==0 prevExp=1; end if prevExp==0 - expDir = Exp(expN).Dexp(DexpN).ExpFoldr; + expDir=Exp(expN).Dexp(DexpN).ExpFoldr; else cd(fullfile(char(OLresDir))) @@ -30,7 +30,7 @@ if NoOLay==0 %expDir=fullfile(char(OLresDir),'..'); end else - expDir = Exp(expN).Dexp(DexpN).ExpFoldr + expDir=Exp(expN).Dexp(DexpN).ExpFoldr end %ExpHmDir= char(Exp(expN).Dexp(DexpN).resDir); @@ -94,7 +94,7 @@ cd(w) %tPtsSize=size(Exp(expN).Dexp(DexpN).FexpScanBMtp{1,1},(3)); tPtsSize=size(FexpScanBMtp{1,plateNum},(3)); %tPtsSize=size(FexpScanBMtp{1,1},(3)); 20160110 -%bmpFileLst = dirfullfile(char(OLresDir),num2str(plateNum),'*.bmp')); %(fullfile(expDir, char(ScLst(ScLstCnt)), '*.bmp')); +%bmpFileLst=dirfullfile(char(OLresDir),num2str(plateNum),'*.bmp')); %(fullfile(expDir, char(ScLst(ScLstCnt)), '*.bmp')); hsafety=figure; dc= get(datacursormode) imInterval=1; diff --git a/workflow/apps/matlab/ezview/EZtableRFdiag.m b/workflow/apps/matlab/ezview/EZtableRFdiag.m index e04d14da..47a9247d 100755 --- a/workflow/apps/matlab/ezview/EZtableRFdiag.m +++ b/workflow/apps/matlab/ezview/EZtableRFdiag.m @@ -1,11 +1,11 @@ -%Create and display Reference data in a table +% Create and display Reference data in a table global Exp -DexpN= Exp(expN).DexpN; +DexpN=Exp(expN).DexpN; rnames=Exp(expN).Dexp(DexpN).RFrnames; -data= Exp(expN).Dexp(DexpN).RFdata; -cnames= [{'Median'},{'Mean'},{'STD'},{'Minimum'},{'Maximum'}]; -f = figure('Menubar','none','Position',[1000 100 640 750],'Name',Exp(expN).Dexp(DexpN).ExpFoldr ); - -t = uitable('Parent',f,'Data',data,'ColumnName',cnames,... - 'RowName',rnames,'Position',[20 20 620 730]); +data=Exp(expN).Dexp(DexpN).RFdata; +cnames=[{'Median'},{'Mean'},{'STD'},{'Minimum'},{'Maximum'}]; +f=figure('Menubar','none','Position',[1000 100 640 750],... + 'Name',Exp(expN).Dexp(DexpN).ExpFoldr ); +t=uitable('Parent',f,'Data',data,'ColumnName',cnames,... + 'RowName',rnames,'Position',[20 20 620 730]); diff --git a/workflow/apps/matlab/ezview/EZusrSelRefx.m b/workflow/apps/matlab/ezview/EZusrSelRefx.m index 21558476..1d992e7e 100755 --- a/workflow/apps/matlab/ezview/EZusrSelRefx.m +++ b/workflow/apps/matlab/ezview/EZusrSelRefx.m @@ -4,7 +4,7 @@ try if n==1 && ~exist('RF1scanN','var') && ~exist('RF2scanN','var') %change || && %{ - prompt = {'Enter Masterplate Number(s) of Your Reference GeneName spots:',... + prompt={'Enter Masterplate Number(s) of Your Reference GeneName spots:',... 'Enter GeneName of Your Reference:'}; rfMPstr= cell2mat(answer(1)); rfMPcomas=strfind((cell2mat(answer(1))),','); @@ -23,12 +23,12 @@ if n==1 && ~exist('RF1scanN','var') && ~exist('RF2scanN','var') %change || && usrMPs= answer(1); refGene= answer(2); %} - prompt = {'Enter GeneName to use as Reference:',... + prompt={'Enter GeneName to use as Reference:',... 'Enter Specifics Term if used to futher specify Reference '} - dlg_title = 'User Reference Input'; - num_lines = 1; - def = {'None','Specifics Term'}; - answer = inputdlg(prompt,dlg_title,num_lines,def); + dlg_title='User Reference Input'; + num_lines=1; + def={'None','Specifics Term'}; + answer=inputdlg(prompt,dlg_title,num_lines,def); rfGenestr= cell2mat(answer(1)); rfSpec= cell2mat(answer(2)); @@ -172,8 +172,8 @@ uu= horzcat(uu,vv); for d=1:DMnum medianIndxG=[]; NZrfIndxG=[]; - minG = min(nonzeros(vv(:,d))); - maxG = max(nonzeros(vv(:,d))); + minG=min(nonzeros(vv(:,d))); + maxG=max(nonzeros(vv(:,d))); RFmeanG= mean(nonzeros(vv(:,d))); RFstdG= std(nonzeros(vv(:,d))); NZrfIndxG= find(nonzeros(vv(:,d))); diff --git a/workflow/apps/matlab/ezview/EZvDatatip.m b/workflow/apps/matlab/ezview/EZvDatatip.m index 989c9cf5..24de4919 100755 --- a/workflow/apps/matlab/ezview/EZvDatatip.m +++ b/workflow/apps/matlab/ezview/EZvDatatip.m @@ -79,9 +79,9 @@ try K=scan(1,plateNum).plate(1).CFout(indx,3); Ks= num2str(K); r=scan(1,plateNum).plate(1).CFout(indx,4); rs= num2str(r); l=scan(1,plateNum).plate(1).CFout(indx,5); Ls= num2str(l); -try Kstr=Ks(1:5); catch, Kstr = Ks(1:length(Ks)); end -try rstr=rs(1:5); catch, rstr = rs(1:length(rs)); end -try Lstr=Ls(1:5); catch, Lstr = Ls(1:length(Ls)); end +try Kstr=Ks(1:5); catch, Kstr=Ks(1:length(Ks)); end +try rstr=rs(1:5); catch, rstr=rs(1:length(rs)); end +try Lstr=Ls(1:5); catch, Lstr=Ls(1:length(Ls)); end Kl=scan(1,plateNum).plate(1).CFout(indx,7); Ku=scan(1,plateNum).plate(1).CFout(indx,8); @@ -93,7 +93,7 @@ t=1:200; clear g; try -g = K ./ (1 + exp(-r.* (t - l ))); +g= K ./ (1 + exp(-r.* (t - l ))); gSlow= Kl ./ (1 + exp(-rl.* (t - lslow ))); gFast= Ku ./ (1 + exp(-ru.* (t - lfast ))); if K==0||r==0||l==0, g(1:200)=1;gSlow(1:200)=1;gFast(1:200)=1;end @@ -140,7 +140,7 @@ end catch %{ - g = K ./ (1 + exp(-r.* (t - l ))); + g= K ./ (1 + exp(-r.* (t - l ))); if K==0||r==0||l==0, g(1:200)=1;end tser=(scan(1,plateNum).plate(1).t0Series(:)); rawData= scan(1,plateNum).plate(1).intens(indx,:)/scan(1,plateNum).plate(1).Ag(indx); diff --git a/workflow/apps/matlab/ezview/EZvInitLoad.m b/workflow/apps/matlab/ezview/EZvInitLoad.m index 30a4f758..75f8e648 100755 --- a/workflow/apps/matlab/ezview/EZvInitLoad.m +++ b/workflow/apps/matlab/ezview/EZvInitLoad.m @@ -136,7 +136,7 @@ Exp(numExps+1).interacPBsel=0; % directory in the uigetfile to load the experiment .mat file. try - [openExpfile,scansDir] = uigetfile('.mat','Open Experiment folder and data storage .mat file name','MultiSelect','off') + [openExpfile,scansDir]=uigetfile('.mat','Open Experiment folder and data storage .mat file name','MultiSelect','off') load (fullfile(Exp(1).Dexp(1).ExpFoldr,'MasterPlateFiles','MPDMmat.mat')) @@ -180,7 +180,7 @@ try Exp(1).traceN=0; Exp(2).traceN=0; Exp(3).traceN=0; %ZoneRelated Exp(1).hOL =[]; Exp(1).hOLb=[]; - Exp(1).hOLname = {}; Exp(1).hOLexpNm={}; Exp(1).hOLresDir={} + Exp(1).hOLname={}; Exp(1).hOLexpNm={}; Exp(1).hOLresDir={} Exp(1).hOLplateNum=[]; Exp(1).hOLresDir= {}; Exp(1).RFmd1indx=[]; @@ -189,7 +189,7 @@ try Exp(1).RFmd2pltN=[]; Exp(2).hOL =[]; Exp(2).hOLb=[]; - Exp(2).hOLname = {}; Exp(2).hOLexpNm={}; Exp(2).hOLresDir={}; + Exp(2).hOLname={}; Exp(2).hOLexpNm={}; Exp(2).hOLresDir={}; Exp(2).hOLplateNum=[]; Exp(2).hOLresDir= {}; Exp(2).RFmd1indx=[]; @@ -198,7 +198,7 @@ try Exp(2).RFmd2pltN=[]; Exp(3).hOL =[]; Exp(3).hOLb=[]; - Exp(3).hOLname = {}; Exp(3).hOLexpNm={}; Exp(3).hOLresDir={}; + Exp(3).hOLname={}; Exp(3).hOLexpNm={}; Exp(3).hOLresDir={}; Exp(3).hOLplateNum=[]; Exp(3).hOLresDir= {}; Exp(3).RFmd1indx=[]; @@ -274,9 +274,9 @@ try DNLaxes1= handles.DNLaxes1; DNLaxes2= handles.DNLaxes2; DNLaxes3= handles.DNLaxes3; zeroCLn= zeros(1,DMnum); %Exp(expN).expLoadCnt(1)=1; %ZoneRelated - Exp(1).hzeroCLn(1) = plot(DNLaxes1,zeroCLn,1:DMnum,'y'); try set(Exp(1).hzeroCLn,'visible','off'); catch ME, end - Exp(2).hzeroCLn(1) = plot(DNLaxes2,zeroCLn,1:DMnum,'y'); try set(Exp(2).hzeroCLn,'visible','off'); catch ME, end - Exp(3).hzeroCLn(1) = plot(DNLaxes3,zeroCLn,1:DMnum,'y'); try set(Exp(3).hzeroCLn,'visible','off'); catch ME, end + Exp(1).hzeroCLn(1)=plot(DNLaxes1,zeroCLn,1:DMnum,'y'); try set(Exp(1).hzeroCLn,'visible','off'); catch ME, end + Exp(2).hzeroCLn(1)=plot(DNLaxes2,zeroCLn,1:DMnum,'y'); try set(Exp(2).hzeroCLn,'visible','off'); catch ME, end + Exp(3).hzeroCLn(1)=plot(DNLaxes3,zeroCLn,1:DMnum,'y'); try set(Exp(3).hzeroCLn,'visible','off'); catch ME, end Exp(1).expLoadCnt=1; Exp(2).expLoadCnt=1; Exp(3).expLoadCnt=1; @@ -438,7 +438,7 @@ try rf1scN=RF1scanN+d; try %if RF1scanN doesn't exist this addition to list will be skipped - nonZeroIndx = find(Exp(expN).Dexp(1).scan(rf1scN).plate(1).CFout(1:384,5)); + nonZeroIndx=find(Exp(expN).Dexp(1).scan(rf1scN).plate(1).CFout(1:384,5)); if isempty(nonZeroIndx), nonZeroCnt=0; medianIndx= nonZeroIndx; else nonZeroCnt=length(nonZeroIndx); @@ -793,8 +793,8 @@ try for d=1:DMnum medianIndxD=[]; NZrfIndxG=[]; - minG = min(nonzeros(vv(:,d))); - maxG = max(nonzeros(vv(:,d))); + minG=min(nonzeros(vv(:,d))); + maxG=max(nonzeros(vv(:,d))); RFmeanG=mean(nonzeros(vv(:,d))); RFstdG= std(nonzeros(vv(:,d))); NZrfIndxG= find(vv(:,d)); %find(nonzeros(vv(:,d))); WWRONG FOR A WHILE! find(nonzeros(vv(:,d))); diff --git a/workflow/apps/matlab/ezview/EZvNIcircle.m b/workflow/apps/matlab/ezview/EZvNIcircle.m index 1d7576c5..9acce454 100755 --- a/workflow/apps/matlab/ezview/EZvNIcircle.m +++ b/workflow/apps/matlab/ezview/EZvNIcircle.m @@ -26,8 +26,8 @@ diaExt=2*(radius+1); circBoxA=zeros(diaExt,diaExt); center= [radius+2, radius+2]; [m n ]=size(circBoxA); -X = bsxfun(@plus,(1:m)', zeros(1,n)); -Y = bsxfun(@plus,(1:n), zeros(m,1)); +X=bsxfun(@plus,(1:m)', zeros(1,n)); +Y=bsxfun(@plus,(1:n), zeros(m,1)); cirMask= sqrt(sum(bsxfun(@minus,cat(3,X,Y),reshape(center,1,1,[])) .^2,3))<=radius; area=pi*radius^2; @@ -43,8 +43,8 @@ FdiaExt=2*(radExpan); circBoxA=zeros(FdiaExt,FdiaExt); center= [radExpan+1, radExpan+1]; [m n ]=size(circBoxA); -X = bsxfun(@plus,(1:m)', zeros(1,n)); -Y = bsxfun(@plus,(1:n), zeros(m,1)); +X=bsxfun(@plus,(1:m)', zeros(1,n)); +Y=bsxfun(@plus,(1:n), zeros(m,1)); FcirMask= sqrt(sum(bsxfun(@minus,cat(3,X,Y),reshape(center,1,1,[])) .^2,3))<=radExpan; %FcirPixA= nnz(cirMask); diff --git a/workflow/apps/matlab/ezview/EZvapendLabel.m b/workflow/apps/matlab/ezview/EZvapendLabel.m index 0c925162..008dee93 100755 --- a/workflow/apps/matlab/ezview/EZvapendLabel.m +++ b/workflow/apps/matlab/ezview/EZvapendLabel.m @@ -2,25 +2,25 @@ hFstrip=figure; %figure(hFstrip,'Visible','off') -t = text(.05,.05,tmPtTx,'FontSize',8, 'FontWeight','bold'); %, 'FontWeight','demi') +t=text(.05,.05,tmPtTx,'FontSize',8, 'FontWeight','bold'); %, 'FontWeight','demi') %Bspace= zeros(20,size(Fcutsc,2))+255; F=[]; % Capture the text from the screen: -F = getframe(gca,[10 10 200 200]); +F=getframe(gca,[10 10 200 200]); % Close the figure: close cc=[]; c=[]; % Select any plane of the resulting image: -cc = F.cdata(:,:,1); +cc=F.cdata(:,:,1); c= cc(182:195,18:60); % i=[]; j=[]; % Determine where the text was (black is 0): -%[i,j] = find(cc == 0); -[i,j] = find(c < 255); +%[i,j]=find(cc == 0); +[i,j]=find(c < 255); % Read in or load the image that is to contain the text: @@ -29,10 +29,10 @@ j=[]; %Bspace= zeros(20,size(Fcutsc,2))+255; Bspace= zeros((210-size(Fcutsc,1)),size(Fcutsc,2))+255; ind=[]; -ind = sub2ind(size(Bspace),i,j); +ind=sub2ind(size(Bspace),i,j); % Index into new image, replacing pixels with white: -Bspace(ind) = uint8(0); +Bspace(ind)=uint8(0); %figure % Display and color the new image: %imagesc(Bspace) diff --git a/workflow/apps/matlab/ezview/EZviewGui.m b/workflow/apps/matlab/ezview/EZviewGui.m index 155fe371..a619f902 100755 --- a/workflow/apps/matlab/ezview/EZviewGui.m +++ b/workflow/apps/matlab/ezview/EZviewGui.m @@ -3,7 +3,7 @@ function varargout = EZviewGui(varargin) % EZVIEWGUI, by itself, creates a new EZVIEWGUI or raises the existing % singleton*. % -% H = EZVIEWGUI returns the handle to a new EZVIEWGUI or the handle to +% H=EZVIEWGUI returns the handle to a new EZVIEWGUI or the handle to % the existing singleton*. % % EZVIEWGUI('CALLBACK',hObject,eventData,handles,...) calls the local @@ -20,8 +20,8 @@ function varargout = EZviewGui(varargin) % % See also: GUIDE, GUIDATA, GUIHANDLES - gui_Singleton = 0; - gui_State = struct( ... + gui_Singleton=0; + gui_State=struct( ... 'gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @EZviewGui_OpeningFcn, ... @@ -30,11 +30,11 @@ function varargout = EZviewGui(varargin) 'gui_Callback', []); if nargin && ischar(varargin{1}) - gui_State.gui_Callback = str2func(varargin{1}); + gui_State.gui_Callback=str2func(varargin{1}); end if nargout - [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); + [varargout{1:nargout}]=gui_mainfcn(gui_State, varargin{:}); else try gui_mainfcn(gui_State, varargin{:}); @@ -52,7 +52,7 @@ function EZviewGui_OpeningFcn(hObject, eventdata, handles, varargin) % varargin command line arguments to EZviewGui (see VARARGIN) % Choose default command line output for EZviewGui - handles.output = hObject; + handles.output=hObject; % Update handles structure guidata(hObject, handles); @@ -94,13 +94,13 @@ function EZviewGui_OpeningFcn(hObject, eventdata, handles, varargin) end % Outputs from this function are returned to the command line. -function varargout = EZviewGui_OutputFcn(hObject, eventdata, handles) +function varargout=EZviewGui_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure - varargout{1} = handles.output; + varargout{1}=handles.output; end % Menu bar @@ -368,7 +368,7 @@ function clrOlay1_Callback(hObject, eventdata, handles) Exp(1).traceN= 0; %Exp(1).cTraceN= 0; Exp(1).hOL =[]; Exp(1).hOLb=[]; - Exp(1).hOLname = {}; Exp(1).hOLexpNm={}; Exp(1).hOLresDir={}; + Exp(1).hOLname={}; Exp(1).hOLexpNm={}; Exp(1).hOLresDir={}; Exp(1).hOLplateNum=[]; Exp(1).hOLresDir= {}; cla(ghandles.Dlaxes1); cla(ghandles.Dkaxes1); cla(ghandles.Draxes1); @@ -587,7 +587,7 @@ function clrOlay2_Callback(hObject, eventdata, handles) %Exp(2).cTraceN= 0; Exp(2).hOL =[]; Exp(2).hOLb=[]; - Exp(2).hOLname = {}; Exp(2).hOLexpNm={}; Exp(2).hOLresDir={} + Exp(2).hOLname={}; Exp(2).hOLexpNm={}; Exp(2).hOLresDir={} Exp(2).hOLplateNum=[]; Exp(2).hOLresDir= {}; @@ -801,7 +801,7 @@ function clrOlay3_Callback(hObject, eventdata, handles) %Exp(3).cTraceN= 0; Exp(3).hOL =[]; Exp(3).hOLb=[]; - Exp(3).hOLname = {}; Exp(3).hOLexpNm={}; Exp(3).hOLresDir={} + Exp(3).hOLname={}; Exp(3).hOLexpNm={}; Exp(3).hOLresDir={} Exp(3).hOLplateNum=[]; Exp(3).hOLresDir= {}; @@ -1534,7 +1534,7 @@ set(ghandles.OLexp1,'string',{''}) cla(ghandles.OLaxes1) Exp(1).traceN=0; Exp(1).hOL =[]; Exp(1).hOLb=[]; -Exp(1).hOLname = {}; Exp(1).hOLexpNm={}; Exp(1).hOLresDir={} +Exp(1).hOLname={}; Exp(1).hOLexpNm={}; Exp(1).hOLresDir={} Exp(1).hOLplateNum=[]; Exp(1).hOLresDir= {}; @@ -1543,7 +1543,7 @@ set(ghandles.OLexp2,'string',{''}) cla(ghandles.OLaxes2) Exp(2).traceN=0; Exp(2).hOL =[]; Exp(2).hOLb=[]; -Exp(2).hOLname = {}; Exp(2).hOLexpNm={}; Exp(2).hOLresDir={} +Exp(2).hOLname={}; Exp(2).hOLexpNm={}; Exp(2).hOLresDir={} Exp(2).hOLplateNum=[]; Exp(2).hOLresDir= {}; @@ -1552,7 +1552,7 @@ set(ghandles.OLexp3,'string',{''}) cla(ghandles.OLaxes3); Exp(3).traceN=0; Exp(3).hOL =[]; Exp(3).hOLb=[]; -Exp(3).hOLname = {}; Exp(3).hOLexpNm={}; Exp(3).hOLresDir={} +Exp(3).hOLname={}; Exp(3).hOLexpNm={}; Exp(3).hOLresDir={} Exp(3).hOLplateNum=[]; Exp(3).hOLresDir= {}; %} @@ -1946,7 +1946,7 @@ function zonePB2_Callback(hObject, eventdata, handles) global ghandles global zonePB - zonePB = 2 + zonePB=2 %if get(handles.zonePB2,'value')==0, set(handles.zonePB2,'value',1); end set(handles.zonePB2,'value',1); DexpN= get(handles.DN2,'value') diff --git a/workflow/apps/matlab/ezview/datatipp.m b/workflow/apps/matlab/ezview/datatipp.m index 59c641da..181d6c77 100755 --- a/workflow/apps/matlab/ezview/datatipp.m +++ b/workflow/apps/matlab/ezview/datatipp.m @@ -3,14 +3,11 @@ function output_txt = myfunction(obj,event_obj) % obj Currently not used (empty) % event_obj Handle to event object % output_txt Data cursor text string (string or cell array of strings). - - -pos = get(event_obj,'Position'); -output_txt = {['X: ',num2str(pos(1),4)],... - ['Y: ',num2str(pos(2),4)]}; - -% If there is a Z-coordinate in the position, display it as well -if length(pos) > 2 - output_txt{end+1} = ['Z: ',num2str(pos(3),4)]; -end -%waitforbuttonpress \ No newline at end of file + pos=get(event_obj,'Position'); + output_txt={['X: ',num2str(pos(1),4)], ['Y: ',num2str(pos(2),4)]}; + % If there is a Z-coordinate in the position, display it as well + if length(pos) > 2 + output_txt{end+1}=['Z: ',num2str(pos(3),4)]; + end + %waitforbuttonpress +end \ No newline at end of file diff --git a/workflow/apps/matlab/ezview/questdlgJWR.m b/workflow/apps/matlab/ezview/questdlgJWR.m index 5c09af67..838ce43c 100755 --- a/workflow/apps/matlab/ezview/questdlgJWR.m +++ b/workflow/apps/matlab/ezview/questdlgJWR.m @@ -1,12 +1,12 @@ function ButtonName=questdlg(Question,Title,Btn1,Btn2,Btn3,Default) %QUESTDLG Question dialog box. -% ButtonName = QUESTDLG(Question) creates a modal dialog box that +% ButtonName=QUESTDLG(Question) creates a modal dialog box that % automatically wraps the cell array or string (vector or matrix) % Question to fit an appropriately sized window. The name of the % button that is pressed is returned in ButtonName. The Title of % the figure may be specified by adding a second string argument: % -% ButtonName = questdlg(Question, Title) +% ButtonName=questdlg(Question, Title) % % Question will be interpreted as a normal string. % @@ -17,7 +17,7 @@ function ButtonName=questdlg(Question,Title,Btn1,Btn2,Btn3,Default) % This can be changed by adding a third argument which specifies the % default Button: % -% ButtonName = questdlg(Question, Title, 'No') +% ButtonName=questdlg(Question, Title, 'No') % % Up to 3 custom button names may be specified by entering % the button string name(s) as additional arguments to the function @@ -26,7 +26,7 @@ function ButtonName=questdlg(Question,Title,Btn1,Btn2,Btn3,Default) % setting DEFAULT to the same string name as the button you want % to use as the default button: % -% ButtonName = questdlg(Question, Title, Btn1, Btn2, DEFAULT); +% ButtonName=questdlg(Question, Title, Btn1, Btn2, DEFAULT); % % where DEFAULT is set to Btn1. This makes Btn1 the default answer. % If the DEFAULT string does not match any of the button string names, @@ -35,7 +35,7 @@ function ButtonName=questdlg(Question,Title,Btn1,Btn2,Btn3,Default) % To use TeX interpretation for the Question string, a data % structure must be used for the last argument, i.e. % -% ButtonName = questdlg(Question, Title, Btn1, Btn2, OPTIONS); +% ButtonName=questdlg(Question, Title, Btn1, Btn2, OPTIONS); % % The OPTIONS structure must include the fields Default and Interpreter. % Interpreter may be 'none' or 'tex' and Default is the default button @@ -46,7 +46,7 @@ function ButtonName=questdlg(Question,Title,Btn1,Btn2,Btn3,Default) % % Example: % -% ButtonName = questdlg('What is your favorite color?', ... +% ButtonName=questdlg('What is your favorite color?', ... % 'Color Question', ... % 'Red', 'Green', 'Blue', 'Green'); % switch ButtonName, @@ -72,7 +72,7 @@ if nargin<1 end Interpreter='none'; -Question = dialogCellstrHelper(Question); +Question=dialogCellstrHelper(Question); %%%%%%%%%%%%%%%%%%%%% %%% General Info. %%% @@ -109,10 +109,10 @@ end %%%%%%%%%%%%%%%%%%%%%%% %%% Create QuestFig %%% %%%%%%%%%%%%%%%%%%%%%%% -FigPos = get(0,'DefaultFigurePosition'); -FigPos(3) = 267; -FigPos(4) = 70; -FigPos = getnicedialoglocation(FigPos, get(0,'DefaultFigureUnits')); +FigPos =get(0,'DefaultFigurePosition'); +FigPos(3)=267; +FigPos(4)= 70; +FigPos =getnicedialoglocation(FigPos, get(0,'DefaultFigureUnits')); QuestFig=dialog( ... 'Visible' ,'off' , ... @@ -164,7 +164,7 @@ if NumButtons > 1 BtnWidth=max(BtnWidth,BtnExtent(3)*btnMargin); end end -BtnHeight = max(BtnHeight,BtnExtent(4)*btnMargin); +BtnHeight=max(BtnHeight,BtnExtent(4)*btnMargin); delete(ExtControl); @@ -198,36 +198,36 @@ MsgTxtForeClr=Black; MsgTxtBackClr=get(QuestFig,'Color'); CBString='uiresume(gcbf)'; -DefaultValid = false; -DefaultWasPressed = false; -BtnHandle = cell(NumButtons, 1); -DefaultButton = 0; +DefaultValid=false; +DefaultWasPressed=false; +BtnHandle=cell(NumButtons, 1); +DefaultButton=0; % Check to see if the Default string passed does match one of the % strings on the buttons in the dialog. If not, throw a warning. -for i = 1:NumButtons +for i=1:NumButtons switch i case 1 ButtonString=Btn1; ButtonTag='Btn1'; if strcmp(ButtonString, Default) - DefaultValid = true; - DefaultButton = 1; + DefaultValid=true; + DefaultButton=1; end case 2 ButtonString=Btn2; ButtonTag='Btn2'; if strcmp(ButtonString, Default) - DefaultValid = true; - DefaultButton = 2; + DefaultValid=true; + DefaultButton=2; end case 3 ButtonString=Btn3; ButtonTag='Btn3'; if strcmp(ButtonString, Default) - DefaultValid = true; - DefaultButton = 3; + DefaultValid=true; + DefaultButton=3; end end @@ -243,7 +243,7 @@ for i = 1:NumButtons end if ~DefaultValid - warnstate = warning('backtrace','off'); + warnstate=warning('backtrace','off'); warning('MATLAB:QUESTDLG:stringMismatch','Default string does not match any button string name.'); warning(warnstate); end @@ -278,7 +278,7 @@ texthandle=text( ... 'Tag' ,'Question' ... ); -textExtent = get(texthandle, 'Extent'); +textExtent=get(texthandle, 'Extent'); % (g357851)textExtent and extent from uicontrol are not the same. For window, extent from uicontrol is larger %than textExtent. But on Mac, it is reverse. Pick the max value. @@ -395,7 +395,7 @@ end switch(evd.Key) case {'return','space'} if DefaultValid - DefaultWasPressed = true; + DefaultWasPressed=true; uiresume(gcbf); end case 'escape' @@ -407,7 +407,7 @@ end switch(evd.Key) case {'return'} if DefaultValid - DefaultWasPressed = true; + DefaultWasPressed=true; uiresume(gcbf); end case 'escape' diff --git a/workflow/qhtcp-workflow b/workflow/qhtcp-workflow index 215caa07..7527b55b 100755 --- a/workflow/qhtcp-workflow +++ b/workflow/qhtcp-workflow @@ -598,7 +598,7 @@ easy() { # Make EASY dirs debug "mkdir -p $EASY_RESULTS_DIR" mkdir -p "$EASY_RESULTS_DIR" - dirs=('PrintResults' 'CFfigs' 'Fotos' 'Fotos/BkUp' 'matResults') + dirs=('PrintResults' 'CFfigs' 'Fotos') for d in "${dirs[@]}"; do debug "mkdir $EASY_RESULTS_DIR/$d" mkdir "$EASY_RESULTS_DIR/$d" diff --git a/workflow/templates/exp/.Rhistory b/workflow/templates/exp/.Rhistory deleted file mode 100644 index 64b77eee..00000000 --- a/workflow/templates/exp/.Rhistory +++ /dev/null @@ -1,15 +0,0 @@ -is.numeric(NA) -is.numeric(as.numeric(NA) -) -inp= a -inp= "a" -inp <- inp[!is.na(inp)] -inp -!is.na(inp) -is.na(inp) -inp -gsub(pattern = (/D)), replacement= 3) -gsub(pattern = ("[/D)"), replacement= 3) -gsub(pattern = inp("[/D)"), replacement= 3) -list.files -list.files() diff --git a/workflow/templates/exp/ExpFrontend.m b/workflow/templates/exp/ExpFrontend.m deleted file mode 100644 index 76e2513b..00000000 --- a/workflow/templates/exp/ExpFrontend.m +++ /dev/null @@ -1,212 +0,0 @@ -% FrontEnd utility to copy source result sheet into Exp_ folders of -% StudiesQHTCP/StudyName/Exp1(2,3,4). This allow the automation of path -% capture to the StudiesDataArchieve.txt study log. -% Select, copy and Capture Study Exp_ details to study log - -%Exp meta data collection - -% Set path variables -wCodeDir=pwd; -Wstudy=fullfile('../', wCodeDir); -studyDate=datetime('now'); - -%Load results file meta data into workspace -try - ExpLabel= strcat('Exp',wCodeDir(end)) - questdlg('\fontsize{20} Select the !!Results File','File Selection','OK', struct('Default','OK','Interpreter','tex')); - [resFile,resPath]= uigetfile('*.txt') - copyfile((fullfile(resPath,resFile)),fullfile(wCodeDir)) - resDate= char(regexp(resFile, '(\d\d\_\d\d\d\d)|( \d\d\_\d\d\d\d|\d\d\d\d\d\d)','match')) - cd .. - - if ispc - lastSep=max(strfind(Wstudy,'\')) - studyName=Wstudy((lastSep+1):end) - else - lastSep=max(strfind(Wstudy,'/')) - studyName=Wstudy((lastSep+1):end) - end - - % Build the study info array - S.sDate(1)= {studyDate}; - S.sName(1)= {studyName} - S.sPath(1)= {Wstudy} - S.ELabel(1)= {ExpLabel} - S.EresDate(1)= {resDate} - S.EresFile(1)= {resFile} - S.EresPath(1)= {resPath} - - cd .. - - fid = fopen('StudiesDataArchive.txt','a'); - fprintf(fid,'StudyDate\tStudyName\tStudyPath\tExpNum\tExpDate\tExpPath\tResultFile\n'); - fprintf(fid, '%s\t %s\t %s\t %s\t %s\t %s\t %s \n',S.sDate{1},S.sName{1},S.sPath{1},S.ELabel{1},S.EresDate{1},S.EresPath{1},S.EresFile{1}); - fclose(fid); - fclose('all'); - -catch - cd(wCodeDir) - disp('Error: Unable to Execute ExpFrontend.m') -end - -cd(wCodeDir) - -%************************************************************************************* -%************************************************************************************* -%##################################################################################### -%Improved storage ammenable for database use -%FrontEnd utility to copy source result sheet into Exp_ folders of -%StudiesQHTCP/StudyName/Exp1(2,3,4). This allow the automation of path -%capture to the StudiesDataArchieve.txt study log. -%Select, copy and Capture Study Exp_ details to study log -studyDateNow= studyDate %preserve the 'Now' date -nowNumFNm= strcat((int2str(now)),'.mat') % from previous section incase the /StudyName doesn't have a standard date -%capture the /StudiesQHTCP directory for storing log data -cd ../.. -logPath= pwd %is /.../Exp_ -cd(wCodeDir) -%Try to load an existing data set from previous Frontend calls -try %end ~ln121 - load(fullfile(logPath,'.studyLog.mat')) %load(fullfile('../../','studyLog.mat')) -catch %If no studyLog.mat found [Initial First Entry] - ExpLabel= strcat('Exp',wCodeDir(end)) - resDate= char(regexp(resFile, '(\d\d\_\d\d\d\d)|( \d\d\_\d\d\d\d|\d\d\d\d\d\d)','match')) - cd .. %move up to current study folder from ../Exp_ folder; - %Study meta data collection - Wstudy= pwd %Capture the specific current Study directory - try %try to extract study date from folder name - studyDate= char(regexp(Wstudy, '(\d\d\_\d\d\d\d)|( \d\d\_\d\d\d\d|\d\d\d\d\d\d)| \d\d\d\d\d\d)','match')) - S.sDate(1)= {studyDate}; - catch %if unsuccessful, accept the current date and convert to a 6 char string - studyDate= yyyymmdd(studyDateNow); - studyDate= (int2str(studyDate)) - studyDate= studyDate(3:8) - end - %Capture StudyName - if ispc - lastSep=max(strfind(Wstudy,'\')) - studyName= Wstudy((lastSep+1):end) - else - lastSep=max(strfind(Wstudy,'/')) - studyName= Wstudy((lastSep+1):end) - - end - %Put current First data entry into Structure of Save to StudyLog.mat file - S.sDate(1)= {studyDate}; - S.sName(1)= {studyName} - S.sPath(1)= {Wstudy} - S.ELabel(1)= {ExpLabel} - S.EresDate(1)= {resDate} - S.EresFile(1)= {resFile} - S.EresPath(1)= {resPath} - - cd(wCodeDir) - -logFiletxt= fullfile(logPath,'StudiesDataArchive4DB.txt') %relative .txt path -%Initialize the StudiesDataArchive.txt file with the First row of meta data - -%Print to a .txt spreadsheet the first set of data in the logFiletxt file -fid = fopen(logFiletxt,'w'); -fprintf(fid,'StudyDate\tStudyName\tStudyPath\tExpNum\tExpDate\tExpPath\tResultFile\n'); -fprintf(fid, '%s\t %s\t %s\t %s\t %s\t %s\t %s \n',studyDate,studyName,Wstudy,ExpLabel,resDate,resPath,resFile); -fclose(fid); -%Save the first entry meta data into a permanent .mat files for future recall -save(fullfile(logPath,'studyLog4DB.mat'), 'S') -save(fullfile(logPath,'.studyLog.mat'), 'S') -save(fullfile(logPath,'.nowNumFNm.mat'), 'S') - - - -end %end for try for the First entry only -%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -%++++++++END of FIRST ENTRY startup section++++++++++++++++++++++++++++++++ -%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - - - -%Begin routine for all Entries After the Initial data entry**************** -ExpLabel= strcat('Exp',wCodeDir(end)) -resDate= char(regexp(resFile, '(\d\d\_\d\d\d\d)|( \d\d\_\d\d\d\d|\d\d\d\d\d\d)','match')) %Capture date from !!Results file - -cd .. %Move to the current study folder - -%Capture study meta dat -Wstudy= pwd % Capture the path to the current study - - %Attempt to extract study date from folder name and convert to a - %searchable numeric date - studyDate= char(regexp(Wstudy, '(\d\d\_\d\d\d\d)|( \d\d\_\d\d\d\d|\d\d\d\d\d\d)| \d\d\d\d\d\d)','match')) - if ~isempty(studyDate) %If no date in folder name use current date and convert to 6char string - S.sDate(1)= {studyDate}; - if isequal((str2num(studyDate(3))),'_') %Remove '_' so that date is a number for easy DB search - studyDate= strcat(studyDate(1:2),studyDate(4:6)) - end - else - studyDate= yyyymmdd(studyDateNow); - studyDate= (int2str(studyDate)) - studyDate= studyDate(3:8) - end - -if ispc - lastSep=max(strfind(Wstudy,'\')) - studyName= Wstudy((lastSep+1):end) -else - lastSep=max(strfind(Wstudy,'/')) - studyName= Wstudy((lastSep+1):end) -end - -%Put meta data into a structure for storage (studyLog.mat) and future -%compare operations -lastRow= length(S.sPath) - -%Compare these just obtained paths with those stored in the studyLog.mat -%file and add a new row if the study or results sheet meta data is new or different -cd .. %Move the the /QHTPCstudies folder -logtxt= 'StudiesDataArchive4DB.txt' -logFiletxt= fullfile(logPath,logtxt) % -try - matched=0; - for n= 1:(lastRow) - if strcmp(Wstudy,S.sPath(n)) && strcmp(resPath, S.EresPath(n)) && strcmp(ExpLabel, S.ELabel(n)) - matched= 1; - break - end - end - - -%Update the StudiesDataArchive.txt file with a new row of meta data -if matched== 0 %if no match for this entry then add a line to the text archive file - fid = fopen(logFiletxt,'w'); - S.sDate(lastRow+1)= {studyDate}; - S.sName(lastRow+1)= {studyName}; - S.sPath(lastRow+1)= {Wstudy}; - S.ELabel(lastRow+1)= {ExpLabel}; - S.EresDate(lastRow+1)= {resDate}; - S.EresFile(lastRow+1)= {resFile}; - S.EresPath(lastRow+1)= {resPath}; - for n= 1:(lastRow +1) - %Print to a .txt spreadsheet and Save update to .mat files - if n==1 - fprintf(fid,'StudyDate\tStudyName\tStudyPath\tExpNum\tExpDate\tExpPath\tResultFile\n'); - end - fprintf(fid, '%s\t %s\t %s\t %s\t %s\t %s\t %s \n',S.sDate{n},S.sName{n},S.sPath{n},S.ELabel{n},S.EresDate{n},S.EresPath{n},S.EresFile{n}); - end - - fclose(fid); %close DBase amenable study log file after data update - - save((fullfile(logPath,'studyLog4DB.mat')), 'S') % path for studyLog.mat - save((fullfile(logPath,'.studyLog.mat')), 'S') %path backup studyLogBU.mat - save((fullfile(logPath,strcat('.',nowNumFNm))), 'S') -end -fclose('all'); - -catch - cd(wCodeDir) %Return to the location of the frontend.m code (/studyName/Exp_) - fclose('all'); - clear S %clear data structure variable 'S.' -end - -cd(wCodeDir) %Return to the location of the frontend.m code (/studyName/Exp_) -clear all %clear workspace variables - -