EZlstBoxCmpExt.m 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. %EZlstBoxExtCmp.m
  2. %Called by EZviewGui.m NOT by EZvDatatip.m and EZlstBoxExt.m
  3. %Provides Trace data storage for use by EZfigTrendOL.m
  4. RFcmpGFlg=0;
  5. if isequal(tempLB(4:6),'cmp')
  6. RFnum=str2double(tempLB(3));
  7. elseif isequal(tempLB(3:6),'cmpG')
  8. RFcmpGFlg=1;
  9. elseif isequal(tempLB(3:6),'cmpP')
  10. RFcmpGFlg=1; %I beleive handling will be the same as RFcmpG
  11. end
  12. Exp(expN).cLmdEven=0; %Added for Cummulative Median and Mean 'C' plot
  13. RFDMflg=0;
  14. if zoneSel==1,DexpN=(get(ghandles.DN1,'value')); end
  15. if zoneSel==2,DexpN=(get(ghandles.DN2,'value')); end
  16. if zoneSel==3,DexpN=(get(ghandles.DN3,'value')); end
  17. try
  18. p1=cell2mat(strfind(selGnOrf,'('));
  19. p2=cell2mat(strfind(selGnOrf,')'));
  20. dmNum=str2num(selGnOrf{1}(p1+1:p2-1));
  21. inDM=str2num(selGnOrf{1}(p1+1:p2-1));
  22. if (~isempty(dmNum)&& isnumeric(dmNum)),RFDMflg=1; end
  23. catch
  24. end
  25. if RFDMflg, Exp(zoneSel).Dexp(DexpN).pertSel=dmNum; end %pertSel=pert;
  26. sgdInfoOnly=get(handles.InfoToggle,'value');
  27. if sgdInfoOnly==1
  28. EZviewInfoBox
  29. else % Runs to end of EZlstBoxExt.m within this else condition
  30. % Plot Selected Gene/Orf Spot
  31. %try
  32. if RFcmpGFlg==0
  33. K=Exp(expN).Dexp(DexpN).RFcmpK(RFnum).dm(inDM).med; Ks=num2str(K);
  34. r=Exp(expN).Dexp(DexpN).RFcmpr(RFnum).dm(inDM).med; rs=num2str(r);
  35. l=Exp(expN).Dexp(DexpN).RFcmpL(RFnum).dm(inDM).med; Ls=num2str(l);
  36. Kl=K - Exp(expN).Dexp(DexpN).RFcmpK(RFnum).dm(inDM).std;
  37. Ku=K + Exp(expN).Dexp(DexpN).RFcmpK(RFnum).dm(inDM).std;
  38. rl=r - Exp(expN).Dexp(DexpN).RFcmpr(RFnum).dm(inDM).std;
  39. ru=r + Exp(expN).Dexp(DexpN).RFcmpr(RFnum).dm(inDM).std;
  40. lfast=l - Exp(expN).Dexp(DexpN).RFcmpL(RFnum).dm(inDM).std;
  41. lslow=l + Exp(expN).Dexp(DexpN).RFcmpL(RFnum).dm(inDM).std;
  42. elseif RFcmpGFlg==1
  43. K=Exp(expN).Dexp(DexpN).RFcmpGK.dm(inDM).med; Ks=num2str(K);
  44. r=Exp(expN).Dexp(DexpN).RFcmpGr.dm(inDM).med; rs=num2str(r);
  45. l=Exp(expN).Dexp(DexpN).RFcmpGL.dm(inDM).med; Ls=num2str(l);
  46. Kl=K - Exp(expN).Dexp(DexpN).RFcmpGK.dm(inDM).std;
  47. Ku=K + Exp(expN).Dexp(DexpN).RFcmpGK.dm(inDM).std;
  48. rl=r - Exp(expN).Dexp(DexpN).RFcmpGr.dm(inDM).std;
  49. ru=r + Exp(expN).Dexp(DexpN).RFcmpGr.dm(inDM).std;
  50. lfast=l - Exp(expN).Dexp(DexpN).RFcmpGL.dm(inDM).std;
  51. lslow=l + Exp(expN).Dexp(DexpN).RFcmpGL.dm(inDM).std;
  52. end
  53. try Kstr=Ks(1:5); catch, Kstr=Ks(1:length(Ks)); end
  54. try rstr=rs(1:5); catch, rstr=rs(1:length(rs)); end
  55. try Lstr=Ls(1:5); catch, Lstr=Ls(1:length(Ls)); end
  56. t=1:200;
  57. clear g;
  58. %try
  59. g=K ./ (1 + exp(-r.* (t - l )));
  60. gSlow=Kl ./ (1 + exp(-rl.* (t - lslow )));
  61. gFast=Ku ./ (1 + exp(-ru.* (t - lfast )));
  62. if K==0||r==0||l==0, g(1:200)=1;gSlow(1:200)=1;gFast(1:200)=1;end
  63. %tser=(scan(1,plateNum).plate(1).t0Series(:));
  64. %rawData=scan(1,plateNum).plate(1).intens(indx,:)/scan(1,plateNum).plate(1).Ag(indx);
  65. if zoneSel==1
  66. plotAxes=ghandles.Paxes1; OLaxes=ghandles.OLaxes1;
  67. Dlaxes=ghandles.Dlaxes1;Dkaxes=ghandles.Dkaxes1;Draxes=ghandles.Draxes1;
  68. Exp(1).traceN=Exp(1).traceN+1;
  69. traceN=Exp(1).traceN;
  70. end
  71. if zoneSel==2
  72. plotAxes=ghandles.Paxes2; OLaxes=ghandles.OLaxes2;Daxes=ghandles.Daxes2;
  73. Dlaxes=ghandles.Dlaxes2;Dkaxes=ghandles.Dkaxes2;Draxes=ghandles.Draxes2;
  74. Exp(2).traceN=Exp(2).traceN+1;
  75. traceN=Exp(2).traceN;
  76. end
  77. if zoneSel==3
  78. plotAxes=ghandles.Paxes3; OLaxes=ghandles.OLaxes3;Daxes=ghandles.Daxes3;
  79. Dlaxes=ghandles.Dlaxes3;Dkaxes=ghandles.Dkaxes3;Draxes=ghandles.Draxes3;
  80. Exp(3).traceN=Exp(3).traceN+1;
  81. traceN=Exp(3).traceN;
  82. end
  83. plot(plotAxes,t,g);hold (plotAxes,'on'); % plot(plotAxes,tser,rawData,'g*');
  84. plot(plotAxes,t,gSlow,'y'); plot(plotAxes,t,gFast,'r');hold (plotAxes,'off');
  85. % Store L R and K valves for Composite [C] plots
  86. Exp(expN).ll(traceN)=l; Exp(expN).rr(traceN)=r; Exp(expN).kk(traceN)=K;
  87. if RFcmpGFlg==0
  88. Exp(expN).lstd(traceN)=Exp(expN).Dexp(DexpN).RFcmpL(RFnum).dm(inDM).std;
  89. Exp(expN).kstd(traceN)=Exp(expN).Dexp(DexpN).RFcmpK(RFnum).dm(inDM).std;
  90. Exp(expN).rstd(traceN)=Exp(expN).Dexp(DexpN).RFcmpr(RFnum).dm(inDM).std;
  91. for dm=1:length(Exp(expN).Dexp(DexpN).DM.drug)
  92. Exp(expN).Trace(traceN).Dexp(DexpN).DM(dm).UsrLvals={Exp(expN).Dexp(DexpN).RFcmpL(RFnum).dm(dm).Lvals};
  93. Exp(expN).Trace(traceN).Dexp(DexpN).DM(dm).UsrKvals={Exp(expN).Dexp(DexpN).RFcmpK(RFnum).dm(dm).Kvals};
  94. Exp(expN).Trace(traceN).Dexp(DexpN).DM(dm).Usrrvals={Exp(expN).Dexp(DexpN).RFcmpr(RFnum).dm(dm).rvals};
  95. end
  96. Exp(expN).Trace(traceN).dmSel=inDM;
  97. Exp(expN).Trace(traceN).DexpN=DexpN;
  98. Exp(expN).Trace(traceN).UsrGLB=selGnOrf;
  99. elseif RFcmpGFlg==1
  100. Exp(expN).lstd(traceN)=Exp(expN).Dexp(DexpN).RFcmpGL.dm(inDM).std;
  101. Exp(expN).kstd(traceN)=Exp(expN).Dexp(DexpN).RFcmpGK.dm(inDM).std;
  102. Exp(expN).rstd(traceN)=Exp(expN).Dexp(DexpN).RFcmpGr.dm(inDM).std;
  103. if strcmp(Exp(expN).DexpType,'chrono')
  104. for nn=1:length(Exp(expN).Dexp) %replaced dmSel with inDM for 'chrono' and RFcmpGFlg
  105. Exp(expN).Trace(traceN).Dexp(nn).DM(inDM).UsrLvals=Exp(expN).Dexp(nn).RFcmpGL.dm(inDM).Lvals;
  106. Exp(expN).Trace(traceN).Dexp(nn).DM(inDM).UsrKvals=Exp(expN).Dexp(nn).RFcmpGK.dm(inDM).Kvals;
  107. Exp(expN).Trace(traceN).Dexp(nn).DM(inDM).Usrrvals=Exp(expN).Dexp(nn).RFcmpGr.dm(inDM).rvals;
  108. end
  109. else
  110. for dm=1:length(Exp(expN).Dexp(DexpN).DM.drug)
  111. Exp(expN).Trace(traceN).Dexp(DexpN).DM(dm).UsrLvals=Exp(expN).Dexp(DexpN).RFcmpGL.dm(dm).Lvals;
  112. Exp(expN).Trace(traceN).Dexp(DexpN).DM(dm).UsrKvals=Exp(expN).Dexp(DexpN).RFcmpGK.dm(dm).Kvals;
  113. Exp(expN).Trace(traceN).Dexp(DexpN).DM(dm).Usrrvals=Exp(expN).Dexp(DexpN).RFcmpGr.dm(dm).rvals;
  114. end
  115. end
  116. Exp(expN).Trace(traceN).dmSel=inDM;
  117. Exp(expN).Trace(traceN).DexpN=DexpN;
  118. Exp(expN).Trace(traceN).UsrGLB=selGnOrf;
  119. end
  120. Exp(expN).lslow(traceN)=lslow; Exp(expN).lfast(traceN)=lfast;
  121. Exp(expN).lKl(traceN)=Kl; Exp(expN).Ku(traceN)=Ku;
  122. Exp(expN).lrl(traceN)=rl; Exp(expN).ru(traceN)=ru;
  123. try
  124. for i=1:length(Exp(zoneSel).hOL(:))
  125. set(Exp(zoneSel).hOL(i),'color',[0 0 1]);
  126. end
  127. catch
  128. end
  129. Exp(zoneSel).hOL(traceN)=plot(OLaxes,t,g);hold on;
  130. set(Exp(zoneSel).hOL(traceN),'color',[1 0 0])
  131. % Exp(zoneSel).hOLb(traceN)=plot(OLaxes,tser,rawData,'g*'); %No Raw Data, Ref Composite 17_1009
  132. % catch
  133. % catchissue='Ln68 EZlstBoxCmpExt'
  134. % end %trycatch
  135. % Get the DM agar description
  136. if expN==1,DMstr=char(get(handles.DM1,'string'));end
  137. if expN==2,DMstr=char(get(handles.DM2,'string'));end
  138. if expN==3,DMstr=char(get(handles.DM3,'string'));end
  139. if isequal(selGnOrf{1}(1:3),'RF1')|| isequal(selGnOrf{1}(1:3),'RF2')|| RFcmpGFlg==1
  140. gene={selGnOrf{1}(1:p2)};
  141. geneOrfstr=gene;
  142. grfgenestr=gene;
  143. else
  144. gene=MP(1,LBmp).genename{1,1}(indx); orf=MP(1,LBmp).orf{1,1}(indx);
  145. geneOrfstr=strcat(gene,'_',orf,'_','m',num2str(LBmp),'r',num2str(LBr),'c',num2str(LBc),'_',tPtStr);
  146. grfgenestr=strcat(gene,'_',orf,'_','m',num2str(LBmp),'r',num2str(LBr),'c',num2str(LBc));
  147. end
  148. %spec=MP(1,LBmp).specifics{1,1}(indx); %orfrep=MP(1,plateNum).orfRep{1,1}(indx);
  149. %tPtStr=strcat('T=', num2str(scan(1,plateNum).plate(1).t0Series(tPtSel)));
  150. graphStr=strcat(grfgenestr,'_','L=',Lstr,'_','r=',rstr,'_','K=',Kstr);
  151. spotDescrip=strcat(graphStr,'->',DMstr);
  152. xp=char(Exp(zoneSel).Dexp(DexpN).resDir);
  153. if ispc,
  154. slashPos=strfind(char(Exp(zoneSel).Dexp(DexpN).resDir),'\');
  155. else
  156. slashPos=strfind(char(Exp(zoneSel).Dexp(DexpN).resDir),'/');
  157. end
  158. startPos=slashPos(length(slashPos)-1) +1;
  159. endPos=slashPos(length(slashPos)) -1;
  160. expStr={xp(startPos:endPos)}
  161. Exp(zoneSel).hOLname(traceN)=spotDescrip; %graphStr; %ghandles.Exp(zoneSel).hOLname(traceN)=graphStr;
  162. Exp(zoneSel).hOLexpNm(traceN)=expStr; %ghandles.Exp(expN).hOLexpNm(traceN)=expStr;
  163. Exp(zoneSel).hOLresDir(traceN)={Exp(zoneSel).Dexp(DexpN).resDir};
  164. %Exp(zoneSel).hOLplateNum(traceN)=plateNum;
  165. %traceData=vertcat(get(Exp(OLay).hOL(traceN),'XData'),get(ghandles.Exp(OLay).hOL(traceN),'YData'));
  166. if zoneSel==1,set(ghandles.GeneOrfLoc1,'string',geneOrfstr);end % Displays the value.
  167. if zoneSel==2,set(ghandles.GeneOrfLoc2,'string',geneOrfstr);end
  168. if zoneSel==3,set(ghandles.GeneOrfLoc3,'string',geneOrfstr);end
  169. if zoneSel==1,set(ghandles.graphStrLoc1,'string',spotDescrip);end %graphStr);end % Displays the value.
  170. if zoneSel==2,set(ghandles.graphStrLoc2,'string',spotDescrip);end %graphStr);end
  171. if zoneSel==3,set(ghandles.graphStrLoc3,'string',spotDescrip);end %graphStr);end
  172. % Write Spot and Exp Info to OLay title areas
  173. if zoneSel==1, %&& get(ghandles.rotPB1,'value')~=1
  174. if length(char(Exp(zoneSel).hOLname(traceN)))>40,set(ghandles.OLay1,'FontSize',8);end
  175. set(ghandles.OLay1,'string', Exp(zoneSel).hOLname(traceN));
  176. if length(char(Exp(zoneSel).hOLexpNm(traceN)))>40,set(ghandles.OLexp1,'FontSize',8);end
  177. set(ghandles.OLexp1,'string',Exp(zoneSel).hOLexpNm(traceN));
  178. end
  179. if zoneSel==2 %&& get(ghandles.rotPB2,'value') ~=1
  180. if length(char(Exp(zoneSel).hOLname(traceN)))>40,set(ghandles.OLay2,'FontSize',8);end
  181. set(ghandles.OLay2,'string', Exp(zoneSel).hOLname(traceN));
  182. if length(char(Exp(zoneSel).hOLexpNm(traceN)))>40,set(ghandles.OLexp2,'FontSize',8);end
  183. set(ghandles.OLexp2,'string',Exp(zoneSel).hOLexpNm(traceN));
  184. end
  185. if zoneSel==3 %&& get(ghandles.rotPB3,'value') ~=1
  186. if length(char(Exp(zoneSel).hOLname(traceN)))>40,set(ghandles.OLay3,'FontSize',8);end
  187. set(ghandles.OLay3,'string', Exp(OLay).hOLname(traceN));
  188. if length(char(Exp(zoneSel).hOLexpNm(traceN)))>40,set(ghandles.OLexp3,'FontSize',8);end
  189. set(ghandles.OLexp3,'string',Exp(OLay).hOLexpNm(traceN));
  190. end
  191. end
  192. % GraphicDestinationPerturbationComparison**15_0821
  193. lstBoxCmpFlg=1;
  194. EZdatatip=0;
  195. if strcmp((Exp(expN).DexpType),'single') || strcmp((Exp(expN).DexpType),'multi')
  196. EZdestComp
  197. elseif strcmp((Exp(expN).DexpType),'chrono')
  198. EZmDayTrend
  199. end