EZmultiGeneRFsLst.m 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. % EZmultiGeneRFsLst Called by EZmultiExLoad
  2. % Called by EZmultiExLoad about line173 Which is called by EZexpSel
  3. % User Select Reference Gene and Specifics Added
  4. % Compile GeneList and OrfList
  5. % Sort and add the medians of Ref Plates if RF1,RF2 exist
  6. clear aa bb c uu vv drf drfPindx drfr drfc
  7. clear RF1scanN RF2scanN
  8. for mx=1:length(Exp(expN).Dexp(n).MP)
  9. try
  10. char((Exp(expN).Dexp(n).MP(mx).genename{1}(384)))
  11. MPnum=mx;
  12. catch
  13. break
  14. end
  15. end
  16. DMnum=length(Exp(expN).Dexp(n).DM.drug);
  17. tPtsSize=size(Exp(expN).Dexp(n).FexpScanBMtp{1,1},(3)); %size(FexpScanBMtp{1,1},3);
  18. lstindx=0;
  19. lstindxOrf=0;
  20. spN=0;
  21. Exp(expN).Dexp(n).RFrnames %<--???
  22. rfcnt=0;
  23. dRF1indx=0;
  24. RF1mp=[]; RF2mp=[];
  25. rfSp=cell2mat(rfSpec); % user entry of Specifics for Ref selection
  26. for mp=1:MPnum
  27. % RF1fullPlate=0;
  28. for ind384=1:384
  29. spN=spN+1;
  30. try
  31. r=ceil(ind384/24);
  32. if rem(ind384,24)==0, c=24; else c=rem(ind384,24); end
  33. % Insert test for numeric in genename and orf if isnumeric
  34. % Correct common EXCEL problem of converting OCT1 into a date numeric
  35. if cell2mat(Exp(expN).Dexp(n).MP(mp).genename{1}(ind384))==38991,
  36. Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)={'OCT1_'};
  37. elseif isnumeric(cell2mat(Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)))
  38. Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)={' '};
  39. end
  40. %****Check for full(384spot) Reference Plates (RF1 or/and RF2)**************
  41. RF1fullPlate=0;
  42. try RF1fullPlate=sum(ismember((Exp(expN).Dexp(n).MP(mp).genename{1}),rfGene))==384; catch, mp, msg=strcat(num2str(mp),' genename ERROR'), end
  43. RF2fullPlate=0;
  44. try RF2fullPlate=sum(ismember((Exp(expN).Dexp(n).MP(mp).genename{1}),'RF2'))==384; catch, mp, msg=strcat(num2str(mp),' genename ERROR'), end
  45. % Capture non-reference spot location and ORF data
  46. if isempty(regexpi(char((Exp(expN).Dexp(n).MP(mp).orf{1}(ind384))),'blank'))... %'\<blank\>'
  47. && ~isnumeric(Exp(expN).Dexp(n).MP(mp).orf{1}(ind384))...
  48. && ~strcmpi((Exp(expN).Dexp(n).MP(mp).orf{1}(ind384)),' ')...
  49. && ~strcmpi((Exp(expN).Dexp(n).MP(mp).orf{1}(ind384)),' ')...
  50. && ~strcmpi((Exp(expN).Dexp(n).MP(mp).orf{1}(ind384)),'')...
  51. && ~isempty((Exp(expN).Dexp(n).MP(mp).orf{1}(ind384)))...
  52. && ((~strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),rfGene)|| ~strcmpi((Exp(expN).Dexp(n).MP(mp).specifics{1}(ind384)),rfSp))...
  53. && (~strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),rfGene)|| ~strcmpi(rfSp,'None')))...
  54. && ((~strcmpi((Exp(expN).Dexp(n).MP(mp).orf{1}(ind384)),rfGene)|| ~strcmpi((Exp(expN).Dexp(n).MP(mp).specifics{1}(ind384)),rfSp))...
  55. && (~strcmpi((Exp(expN).Dexp(n).MP(mp).orf{1}(ind384)),rfGene)|| ~strcmpi(rfSp,'None')))...
  56. && (~strcmpi((Exp(expN).Dexp(n).MP(mp).orf{1}(ind384)),'RF2')||~strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),'RF2'))...
  57. && iscellstr((Exp(expN).Dexp(n).MP(mp).orf{1}(ind384)))
  58. lstindxOrf=lstindxOrf+1;
  59. Exp(expN).Dexp(n).MP(mp).orf{1}(ind384)=strrep((Exp(expN).Dexp(n).MP(mp).orf{1}(ind384)),':',' ');
  60. bb(lstindxOrf,1)=(Exp(expN).Dexp(n).MP(mp).orf{1}(ind384));
  61. bb(lstindxOrf,2)={strcat(':',num2str(mp),':',num2str(r),':',num2str(c))};
  62. bb(lstindxOrf,3)={mp};
  63. bb(lstindxOrf,4)={r};
  64. bb(lstindxOrf,5)={c};
  65. mutorfs(lstindxOrf)=spN; %16_0318 added for Interaction EZinteract
  66. % Exp(expN).Dexp(n).mutSpotIndx(lstindxOrf)=spN; %16_0318 added for Interaction EZinteract
  67. end
  68. % Capture non-reference spot location and GENENAME data
  69. if isempty(regexpi(char((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384))),'blank'))... %'\<blank\>'
  70. && ~isnumeric(Exp(expN).Dexp(n).MP(mp).genename{1}(ind384))...
  71. && ~strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),' ')...
  72. && ~strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),' ')...
  73. && ~strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),'')...
  74. && ~isempty((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)))...
  75. && (~strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),rfGene)...
  76. || ~strcmpi((Exp(expN).Dexp(n).MP(mp).specifics{1}(ind384)),rfSp))... % AddSpecifics rfSp && ~RF1fullPlate)...
  77. && (~strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),rfGene) || ~strcmpi(rfSp,'None'))...
  78. && (~strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),'RF2'))... % && ~RF2fullPlate)...
  79. && iscellstr((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)))
  80. lstindx=lstindx+1;
  81. Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)=strrep((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),':',' ');
  82. aa(lstindx,1)=(Exp(expN).Dexp(n).MP(mp).genename{1}(ind384));
  83. aa(lstindx,2)={strcat(':',num2str(mp),':',num2str(r),':',num2str(c))};
  84. aa(lstindx,3)={mp};
  85. aa(lstindx,4)={r};
  86. aa(lstindx,5)={c};
  87. mutgenes(lstindx)=spN;
  88. elseif (RF1fullPlate==1 ... % sum(ismember((Exp(expN).Dexp(n).MP(mp).genename{1}),rfGene))==384 || ...
  89. || (((length(unique(Exp(expN).Dexp(n).MP(mp).genename{1}(1:384))))==1 && mp==1 ) ... % (isequal((Exp(expN).Dexp(n).MP(mp).genename{1}(1:384)), (Exp(expN).Dexp(n).MP(mp).genename{1}(384:-1:1)))&& mp==1 )) && ...
  90. && ~exist('RF1scanN','var')))
  91. RF1mp=mp
  92. RF1scanN=(mp*DMnum)-(DMnum-1)
  93. rfcnt=rfcnt+1;
  94. RFs(spN:spN+383)=spN:spN+383;
  95. elseif (RF2fullPlate==1|| ... % sum(ismember((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),'RF2'))==384 ||...
  96. (((length(unique(Exp(expN).Dexp(n).MP(mp).genename{1}(1:384))))==1 && mp==MPnum ) && ...
  97. ~exist('RF2scanN','var')))
  98. RF2mp=mp
  99. rfcnt=rfcnt+1;
  100. RFs(spN:spN+383)=spN:spN+383;
  101. RF2scanN=(mp*DMnum)-(DMnum-1)
  102. % DISPersed REFerence capture and find Medians
  103. elseif ( ((strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),rfGene) ...
  104. && strcmpi((Exp(expN).Dexp(n).MP(mp).specifics{1}(ind384)),rfSp))) ...
  105. || ((strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),rfGene) ...
  106. && strcmpi(rfSp,'None'))) ) &&(RF1fullPlate~=1)
  107. dRF1indx=dRF1indx+1;
  108. Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)=strrep((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),':',' ');
  109. drf(dRF1indx,1)=(Exp(expN).Dexp(n).MP(mp).genename{1}(ind384));
  110. drf(dRF1indx,2)={strcat(':',num2str(mp),':',num2str(r),':',num2str(c))};
  111. drf(dRF1indx,3)={mp}; drfMP(dRF1indx,mp)=mp;
  112. drf(dRF1indx,4)={r}; drfr(dRF1indx,mp)=r;
  113. drf(dRF1indx,5)={c}; drfc(dRF1indx,mp)=c;
  114. drf(dRF1indx,6)={ind384}; drfPindx(dRF1indx,mp)=ind384;
  115. % drf(dRF1indx,7)=(Exp(expN).Dexp(n).MP(mp).specifics{1}(ind384));
  116. end % if isempty(regexpi(char((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384))),'blank'))...
  117. catch
  118. mp % Disable in future to prevent a bomb out OR put into a nested TryCatch
  119. ind384 % Disable in future to prevent a bomb out OR put into a nested TryCatch
  120. msgBadGeneName=strcat('check genename at mp=',num2str(mp),' indx=',num2str(ind384))
  121. end
  122. end
  123. mp
  124. end
  125. % Cover case if mutorfs RFs are labeled RF1 or RF2
  126. try
  127. Exp(expN).Dexp(n).mutSpotIndx.wRFs=union(RFs, mutorfs);
  128. catch
  129. msg='No RFs Found in Exp! wRFs'
  130. Exp(expN).Dexp(n).mutSpotIndx.wRFs=mutorfs;
  131. end
  132. try
  133. Exp(expN).Dexp(n).mutSpotIndx.woRFs=setdiff(mutorfs,RFs);
  134. catch
  135. msg='No RFs Found in Exp! woRFs'
  136. Exp(expN).Dexp(n).mutSpotIndx.woRFs=mutorfs;
  137. end
  138. Exp(expN).Dexp(n).RFmd1indx=[];
  139. Exp(expN).Dexp(n).RFmd1pltN=[];
  140. Exp(expN).Dexp(n).RFmd1LB={[]};
  141. Exp(expN).Dexp(n).RFmd1indx=[];
  142. Exp(expN).Dexp(n).RFmd1pltN={};
  143. Exp(expN).Dexp(n).RFmd1val=[];
  144. Exp(expN).Dexp(n).mean1=[];
  145. Exp(expN).Dexp(n).std1=[];
  146. Exp(expN).Dexp(n).min1=[];
  147. Exp(expN).Dexp(n).max1=[];
  148. Exp(expN).Dexp(n).RFcmpK=[]; %For Ref Composite 17_1009
  149. Exp(expN).Dexp(n).RFcmpr=[]; %For Ref Composite 17_1009
  150. Exp(expN).Dexp(n).RFcmpL=[]; %For Ref Composite 17_1009
  151. Exp(expN).Dexp(n).RFmd2LB={[]};
  152. Exp(expN).Dexp(n).RFmd2indx=[];
  153. Exp(expN).Dexp(n).RFmd2pltN=[];
  154. Exp(expN).Dexp(n).RFmd2val=[];
  155. Exp(expN).Dexp(n).mean2=[];
  156. Exp(expN).Dexp(n).std2=[];
  157. Exp(expN).Dexp(n).min2=[];
  158. Exp(expN).Dexp(n).max2=[];
  159. Exp(expN).Dexp(n).RFmean=[];
  160. Exp(expN).Dexp(n).RFstd=[];
  161. Exp(expN).Dexp(n).RFmin=[];
  162. Exp(expN).Dexp(n).RFmax=[];
  163. Exp(expN).Dexp(n).RFmdPLB={[]};
  164. Exp(expN).Dexp(n).RFmdPindx=[];
  165. Exp(expN).Dexp(n).RFmdPpltN=[];
  166. Exp(expN).Dexp(n).RFmdPscanN=[];
  167. Exp(expN).Dexp(n).RFmedianP=[];
  168. Exp(expN).Dexp(n).stdP=[];
  169. Exp(expN).Dexp(n).meanP=[];
  170. Exp(expN).Dexp(n).minP=[];
  171. Exp(expN).Dexp(n).maxP=[];
  172. Exp(expN).Dexp(n).RFmdGLB={[]};
  173. Exp(expN).Dexp(n).RFmdGindx=[];
  174. Exp(expN).Dexp(n).RFmdGpltN=[];
  175. Exp(expN).Dexp(n).RFmdGscanN=[];
  176. Exp(expN).Dexp(n).RFmedianG=[];
  177. Exp(expN).Dexp(n).RFminG=[];
  178. Exp(expN).Dexp(n).RFmaxG=[];
  179. Exp(expN).Dexp(n).RFstdG=[];
  180. Exp(expN).Dexp(n).RFmeanG=[];
  181. Exp(expN).Dexp(n).RFcmpGK=[]; %For Ref Composite 17_1009
  182. Exp(expN).Dexp(n).RFcmpGr=[]; %For Ref Composite 17_1009
  183. Exp(expN).Dexp(n).RFcmpGL=[]; %For Ref Composite 17_1009
  184. if exist('RF1scanN','var')
  185. for d=0:(DMnum-1)
  186. medianIndx=[];
  187. nonZeroIndx=[];
  188. medValList=[];
  189. rf1scN=RF1scanN+d;
  190. try %if RF1scanN doesn't exist this addition to list will be skipped
  191. nonZeroIndx=find(Exp(expN).Dexp(n).scan(rf1scN).plate(1).CFout(1:384,5));
  192. if isempty(nonZeroIndx)
  193. nonZeroCnt=0
  194. medianIndx=nonZeroIndx;
  195. else
  196. nonZeroCnt=length(nonZeroIndx);
  197. end
  198. if ~isempty(nonZeroIndx) && mod(nonZeroCnt,2)==0, medianIndx=nonZeroIndx(1:nonZeroCnt-1); end
  199. if ~isempty(nonZeroIndx) && mod(nonZeroCnt,2)~=0, medianIndx=nonZeroIndx; end
  200. clear medValLst
  201. clear kValLst
  202. clear rValLst
  203. if ~isempty(nonZeroIndx) && length(medianIndx) > (.15*384) % To calc. a median, more than 15% of spots must be nonZero
  204. medValLst=Exp(expN).Dexp(n).scan(rf1scN).plate(1).CFout(medianIndx,5);
  205. medValList1{d+1}=medValLst;
  206. min1=min(medValLst);
  207. max1=max(medValLst);
  208. std1=std(medValLst);
  209. mean1=mean(medValLst);
  210. kValLst=Exp(expN).Dexp(n).scan(rf1scN).plate(1).CFout(medianIndx,3); % For Ref Composite 17_1009
  211. rValLst=Exp(expN).Dexp(n).scan(rf1scN).plate(1).CFout(medianIndx,4); % For Ref Composite 17_1009
  212. mval1=median(medValLst); %mval1=median(Exp(expN).Dexp(n).scan(RF1mps).plate(1).CFout(1:384,5)); %CFout(1:383,5));
  213. RFmd1pos=find(mval1==(Exp(expN).Dexp(n).scan(rf1scN).plate(1).CFout(1:384,5)));
  214. RFmd1loc(1)=ceil(RFmd1pos/24); %calc r value
  215. RFmd1loc(2)=RFmd1pos - ((RFmd1loc(1)-1)*24); %calc c value
  216. lstindx=lstindx+1;
  217. lstindxOrf=lstindxOrf+1;
  218. aa(lstindx,1)={strcat('RF1md(',num2str(d+1),')')}; %{'RF1md'};
  219. aa(lstindx,2)={strcat(':',num2str(RF1mp),':',num2str(RFmd1loc(1)),':',num2str(RFmd1loc(2)))}; %,'std_',num2str(std1))};
  220. bb(lstindxOrf,1)={strcat('RF1md(',num2str(d+1),')')}; %remove string2cell brackets {...} %{'RF1md'};
  221. bb(lstindxOrf,2)={strcat(':',num2str(RF1mp),':',num2str(RFmd1loc(1)),':',num2str(RFmd1loc(2)))}; %,'std_',num2str(std1))};
  222. % Composite Reference Amalgum Plot
  223. lstindx=lstindx+1;
  224. lstindxOrf=lstindxOrf+1;
  225. aa(lstindx,1)={strcat('RF1cmp(',num2str(d+1),')')};
  226. aa(lstindx,2)={''};
  227. bb(lstindxOrf,1)={strcat('RF1cmp(',num2str(d+1),')')};
  228. bb(lstindxOrf,2)={''};
  229. Exp(expN).Dexp(n).RFmd1LB(d+1)=strcat(aa(lstindx,1),aa(lstindx,2));
  230. Exp(expN).Dexp(n).RFmd1indx(d+1)=RFmd1pos;
  231. Exp(expN).Dexp(n).RFmd1pltN=RF1mp;
  232. Exp(expN).Dexp(n).RFmd1val(d+1)=mval1;
  233. Exp(expN).Dexp(n).mean1(d+1)=mean1;
  234. Exp(expN).Dexp(n).std1(d+1)=std1;
  235. Exp(expN).Dexp(n).min1(d+1)=min1;
  236. Exp(expN).Dexp(n).max1(d+1)=max1;
  237. Exp(expN).Dexp(n).RFcmpL(1).dm(d+1).Lvals=medValLst; %17_1201 TrendOL
  238. Exp(expN).Dexp(n).RFcmpL(1).dm(d+1).med=median(medValLst); %For Ref Composite 17_1009
  239. Exp(expN).Dexp(n).RFcmpL(1).dm(d+1).mean=mean(medValLst); %For Ref Composite 17_1009
  240. Exp(expN).Dexp(n).RFcmpL(1).dm(d+1).std=std(medValLst); %For Ref Composite 17_1009
  241. Exp(expN).Dexp(n).RFcmpL(1).dm(d+1).min=min(medValLst); %For Ref Composite 17_1009
  242. Exp(expN).Dexp(n).RFcmpL(1).dm(d+1).max=max(medValLst); %For Ref Composite 17_1009
  243. Exp(expN).Dexp(n).RFcmpK(1).dm(d+1).Kvals=kValLst;
  244. Exp(expN).Dexp(n).RFcmpK(1).dm(d+1).med=median(kValLst); %For Ref Composite 17_1009
  245. Exp(expN).Dexp(n).RFcmpK(1).dm(d+1).mean=mean(kValLst); %For Ref Composite 17_1009
  246. Exp(expN).Dexp(n).RFcmpK(1).dm(d+1).std=std(kValLst); %For Ref Composite 17_1009
  247. Exp(expN).Dexp(n).RFcmpK(1).dm(d+1).min=min(kValLst); %For Ref Composite 17_1009
  248. Exp(expN).Dexp(n).RFcmpK(1).dm(d+1).max=max(kValLst); %For Ref Composite 17_1009
  249. Exp(expN).Dexp(n).RFcmpr(1).dm(d+1).rvals=rValLst;
  250. Exp(expN).Dexp(n).RFcmpr(1).dm(d+1).med=median(rValLst); %For Ref Composite 17_1009
  251. Exp(expN).Dexp(n).RFcmpr(1).dm(d+1).mean=mean(rValLst); %For Ref Composite 17_1009
  252. Exp(expN).Dexp(n).RFcmpr(1).dm(d+1).std=std(rValLst); %For Ref Composite 17_1009
  253. Exp(expN).Dexp(n).RFcmpr(1).dm(d+1).min=min(rValLst); %For Ref Composite 17_1009
  254. Exp(expN).Dexp(n).RFcmpr(1).dm(d+1).max=max(rValLst); %For Ref Composite 17_1009
  255. else
  256. % Need to set L r K values to zeros or pick the first spot with zeros
  257. % Spot 1 could be other than zero as the median isn't calculated if
  258. % fewer than some percent are nonzero
  259. medianCalcFailed='To Few nonZero spots for valid median RF1 selection'
  260. firstZero=find(((Exp(expN).Dexp(n).scan(rf1scN).plate(1).CFout(1:384,5))==0),1,'first')
  261. Exp(expN).Dexp(n).RFmd1indx(d+1)=firstZero;
  262. Exp(expN).Dexp(n).RFmd1pltN=RF1mp;
  263. try medValList1{d+1}=Exp(expN).Dexp(n).scan(rf1scN).plate(1).CFout(medianIndx,5); nonZeroCnt; catch, catcherror='Ln356', end
  264. end
  265. catch
  266. medianCalcTryFailed1='Failed! Failed! Ln362 But process continued with placeholder P1ind384 spot value!'
  267. try
  268. firstZero=find(((Exp(expN).Dexp(n).scan(rf1scN).plate(1).CFout(1:384,5))==0),1,'first')
  269. Exp(expN).Dexp(n).RFmd1indx(d+1)=firstZero;
  270. catch
  271. Exp(expN).Dexp(n).RFmd1indx(d+1)=384; %if crapout,Then use spot384 as default to keep going
  272. end
  273. try
  274. Exp(expN).Dexp(n).RFmd1pltN=RF1mp;
  275. catch
  276. Exp(expN).Dexp(n).RFmd1pltN=1;
  277. end
  278. end
  279. end
  280. end
  281. % Calc RF2 median if a full plate of RF2s exist
  282. Exp(expN).Dexp(n).RFmd2indx=[];
  283. Exp(expN).Dexp(n).RFmd2pltN=[];
  284. if exist('RF2scanN','var')
  285. for d=0:(DMnum-1)
  286. medianIndx2=[];
  287. nonZeroIndx2=[];
  288. medValList2=[];
  289. rf2scN=RF2scanN+d;
  290. try %if RF2scanN doesn't exist this addition to list will be skipped
  291. nonZeroIndx2=find(Exp(expN).Dexp(n).scan(rf2scN).plate(1).CFout(1:384,5));
  292. if isempty(nonZeroIndx2)
  293. nonZeroCnt2=0;
  294. medianIndx2=nonZeroIndx2;
  295. else
  296. nonZeroCnt2=length(nonZeroIndx2);
  297. end
  298. if ~isempty(nonZeroIndx2) && mod(nonZeroCnt2,2)==0, medianIndx2=nonZeroIndx2(1:nonZeroCnt2-1); end
  299. if ~isempty(nonZeroIndx2) && mod(nonZeroCnt2,2)~=0, medianIndx2=nonZeroIndx2; end
  300. clear medValLst2
  301. clear kValLst2
  302. clear rValLst2
  303. if ~isempty(nonZeroIndx2) && length(medianIndx2) > (.15*384) % to calc. a median, more than 15% of spots must be nonZero
  304. medValLst2=Exp(expN).Dexp(n).scan(rf2scN).plate(1).CFout(medianIndx2,5);
  305. medValList2{d+1}=medValLst2;
  306. min2=min(medValLst2);
  307. max2=max(medValLst2);
  308. std2=std(medValLst2);
  309. mean2=mean(medValLst2);
  310. kValLst2=Exp(expN).Dexp(n).scan(rf2scN).plate(1).CFout(medianIndx2,3); %For Ref Composite 17_1009
  311. rValLst2=Exp(expN).Dexp(n).scan(rf2scN).plate(1).CFout(medianIndx2,4); %For Ref Composite 17_1009
  312. mval2=median(medValLst2); %mval2=median(Exp(expN).Dexp(n).scan(RF2mps).plate(1).CFout(1:383,5));
  313. RFmd2pos=find(mval2==(Exp(expN).Dexp(n).scan(rf2scN).plate(1).CFout(1:384,5)));
  314. RFmd2loc(1)=ceil(RFmd2pos/24); %calc r value
  315. RFmd2loc(2)=RFmd2pos - ((RFmd2loc(1)-1)*24); %calc c value
  316. lstindx=lstindx+1;
  317. lstindxOrf=lstindxOrf+1;
  318. aa(lstindx,1)={strcat('RF2md(',num2str(d+1),')')}; %{'RF2md'};
  319. aa(lstindx,2)={strcat(':',num2str(RF2mp),':',num2str(RFmd2loc(1)),':',num2str(RFmd2loc(2)))}; %,'std_',num2str(std2))};
  320. bb(lstindxOrf,1)={strcat('RF2md(',num2str(d+1),')')}; %remove string2cell brackets {...} %{'RF2md'};
  321. bb(lstindxOrf,2)={strcat(':',num2str(RF2mp),':',num2str(RFmd2loc(1)),':',num2str(RFmd2loc(2)))}; %,'std_',num2str(std2))};
  322. % Composite Reference Amalgum Plot (CRAP)
  323. lstindx=lstindx+1;
  324. lstindxOrf=lstindxOrf+1;
  325. aa(lstindx,1)={strcat('RF2cmp(',num2str(d+1),')')};
  326. aa(lstindx,2)={''};
  327. bb(lstindxOrf,1)={strcat('RF2cmp(',num2str(d+1),')')};
  328. bb(lstindxOrf,2)={''};
  329. Exp(expN).Dexp(n).RFmd2LB(d+1)=strcat(aa(lstindx,1),aa(lstindx,2));
  330. Exp(expN).Dexp(n).RFmd2indx(d+1)=RFmd2pos;
  331. Exp(expN).Dexp(n).RFmd2pltN=RF2mp;
  332. Exp(expN).Dexp(n).RFmd2val(d+1)=mval2;
  333. Exp(expN).Dexp(n).mean2(d+1)=mean2;
  334. Exp(expN).Dexp(n).std2(d+1)=std2;
  335. Exp(expN).Dexp(n).min2(d+1)=min2;
  336. Exp(expN).Dexp(n).max2(d+1)=max2;
  337. Exp(expN).Dexp(n).RFcmpL(2).dm(d+1).Lvals=medValLst2; %17_1201 TrendOL
  338. Exp(expN).Dexp(n).RFcmpL(2).dm(d+1).med=median(medValLst2); %For Ref Composite 17_1009
  339. Exp(expN).Dexp(n).RFcmpL(2).dm(d+1).mean=mean(medValLst2); %For Ref Composite 17_1009
  340. Exp(expN).Dexp(n).RFcmpL(2).dm(d+1).std=std(medValLst2); %For Ref Composite 17_1009
  341. Exp(expN).Dexp(n).RFcmpL(2).dm(d+1).min=min(medValLst2); %For Ref Composite 17_1009
  342. Exp(expN).Dexp(n).RFcmpL(2).dm(d+1).max=max(medValLst2); %For Ref Composite 17_1009
  343. Exp(expN).Dexp(n).RFcmpK(2).dm(d+1).Kvals=kValLst2;
  344. Exp(expN).Dexp(n).RFcmpK(2).dm(d+1).med=median(kValLst2); %For Ref Composite 17_1009
  345. Exp(expN).Dexp(n).RFcmpK(2).dm(d+1).mean=mean(kValLst2); %For Ref Composite 17_1009
  346. Exp(expN).Dexp(n).RFcmpK(2).dm(d+1).std=std(kValLst2); %For Ref Composite 17_1009
  347. Exp(expN).Dexp(n).RFcmpK(2).dm(d+1).min=min(kValLst2); %For Ref Composite 17_1009
  348. Exp(expN).Dexp(n).RFcmpK(2).dm(d+1).max=max(kValLst2); %For Ref Composite 17_1009
  349. Exp(expN).Dexp(n).RFcmpr(2).dm(d+1).rvals=rValLst2;
  350. Exp(expN).Dexp(n).RFcmpr(2).dm(d+1).med=median(rValLst2); %For Ref Composite 17_1009
  351. Exp(expN).Dexp(n).RFcmpr(2).dm(d+1).mean=mean(rValLst2); %For Ref Composite 17_1009
  352. Exp(expN).Dexp(n).RFcmpr(2).dm(d+1).std=std(rValLst2); %For Ref Composite 17_1009
  353. Exp(expN).Dexp(n).RFcmpr(2).dm(d+1).min=min(rValLst2); %For Ref Composite 17_1009
  354. Exp(expN).Dexp(n).RFcmpr(2).dm(d+1).max=max(rValLst); %For Ref Composite 17_1009
  355. else
  356. % Pick the first spot with zeros
  357. % Use that position to satisfy and keep process OK
  358. medianCalcFailed2='To Few nonZero spots for valid median RF2 selection'
  359. firstZero2=find(((Exp(expN).Dexp(n).scan(rf2scN).plate(1).CFout(1:384,5))==0),1,'first')
  360. Exp(expN).Dexp(n).RFmd2indx(d+1)=firstZero2;
  361. Exp(expN).Dexp(n).RFmd2pltN=RF2mp;
  362. try medValList2{d+1}=Exp(expN).Dexp(n).scan(rf2scN).plate(1).CFout(medianIndx2,5); nonZeroCnt2; catch, catchissue='Ln431', end
  363. end
  364. catch
  365. medianCalcTryFailed2='Failed! Failed! Ln436 No RF1median But process continued with placeholder P1ind384 spot value!'
  366. try
  367. firstZero2=find(((Exp(expN).Dexp(n).scan(rf2scN).plate(1).CFout(1:384,5))==0),1,'first');
  368. Exp(expN).Dexp(n).RFmd2indx(d+1)=firstZero2;
  369. catch
  370. catchissue='Ln442'
  371. Exp(expN).Dexp(n).RFmd2indx(d+1)=384; %if crapout,Then use spot384 as default to keep going
  372. end
  373. try
  374. Exp(expN).Dexp(n).RFmd2pltN=RF2mp;
  375. catch
  376. catchissue='Ln448'
  377. Exp(expN).Dexp(n).RFmd2pltN=1;
  378. end
  379. end
  380. clear RFcombValList
  381. RFcombValList=cat(1,medValList1{d+1},medValList2{d+1});
  382. Exp(expN).Dexp(n).RFmean(d+1)=mean(RFcombValList);
  383. Exp(expN).Dexp(n).RFstd(d+1)=std(RFcombValList);
  384. try, Exp(expN).Dexp(n).RFmin(d+1)=min(RFcombValList);
  385. catch, Exp(expN).Dexp(n).RFmin(d+1)=0; end
  386. try, Exp(expN).Dexp(n).RFmax(d+1)=max(RFcombValList);
  387. catch, Exp(expN).Dexp(n).RFmax(d+1)=0; end
  388. end
  389. elseif exist('RF1scanN','var')
  390. Exp(expN).Dexp(n).RFmean=Exp(expN).Dexp(n).mean1;
  391. Exp(expN).Dexp(n).RFstd=Exp(expN).Dexp(n).std1;
  392. Exp(expN).Dexp(n).RFmin=Exp(expN).Dexp(n).min1;
  393. Exp(expN).Dexp(n).RFmax=Exp(expN).Dexp(n).max1;
  394. end
  395. % Disperse reference plates
  396. Exp(expN).Dexp(n).RFmdPindx=[];
  397. Exp(expN).Dexp(n).RFmdPpltN=[];
  398. if exist('drf','var') % ('RF1scanN','var')
  399. % Det. index of change from one MP to the next
  400. i=2;
  401. clear chgIndx
  402. chgIndx(1)=1;
  403. for j=1:length(drf(:,3))
  404. if j>1
  405. if cell2mat(drf(j,3))~=cell2mat(drf((j-1),3)), chgIndx(i)=j; i=i+1; end
  406. end
  407. end
  408. chgIndx(length(chgIndx)+1)=length(drf)+1;
  409. uu=zeros(size(drf,1),4);
  410. uu(:,1:4)=cell2mat(drf(:,3:6));
  411. vv=zeros(size(drf,1),DMnum); %(length(drf),DMnum);
  412. dMPs=unique(cell2mat(drf(:,3)));
  413. %{
  414. for mm=1:MPnum
  415. nonZrfIndx.mp{mm,:}=drfPindx((find(drfPindx(:,mm))),mm);
  416. end
  417. %}
  418. % nzValsG=zeros(DMnum,size(drf,1));
  419. % nzValsAcc=zeros(DMnum,384);
  420. for mm=1:length(dMPs) % length(chgIndx)
  421. for d=1:(DMnum)
  422. medianIndxDisp=[];
  423. NZrefIndxP=[];
  424. nonZeroValsP=[];
  425. medValLstDisp=[];
  426. rf1scNdisp=((dMPs(mm)-1)*DMnum)+(d);
  427. % Determine the dispersed RFs median mean and std if such exist
  428. try
  429. NZrefIndxP=drfPindx((find(drfPindx(:,dMPs(mm)))),dMPs(mm)); % find(Exp(expN).Dexp(n).scan(rf1scNdisp).plate(1).CFout(drf(chgIndx(cI):chgIndx(cI+1)),5));
  430. % vv=Exp(expN).Dexp(n).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5);
  431. vv(chgIndx(mm):(chgIndx(mm+1)-1),d)=Exp(expN).Dexp(n).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5);
  432. % For Global Ref Composite 17_1009
  433. vvK(chgIndx(mm):(chgIndx(mm+1)-1),d)=Exp(expN).Dexp(n).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,3);
  434. vvr(chgIndx(mm):(chgIndx(mm+1)-1),d)=Exp(expN).Dexp(n).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,4);
  435. nonZeroValsP=nonzeros(Exp(expN).Dexp(n).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5));
  436. std1Disp=std(nonZeroValsP);
  437. mean1Disp=mean(nonZeroValsP);
  438. minDisp=min(nonZeroValsP);
  439. maxDisp=max(nonZeroValsP);
  440. drfVals=Exp(expN).Dexp(n).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5);
  441. % nzValsAcc(mm).DM(d,:)=nonZeroValsP;
  442. % MEDIAN Determination for PLATES with Dispersed RFs
  443. % NZrefIndxP=NZrefIndxP %find(Exp(expN).Dexp(n).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5));
  444. if isempty(NZrefIndxP)
  445. nonZeroCntDisp=0;
  446. medianIndxDisp=NZrefIndxP;
  447. else
  448. nonZeroCntDisp=length(NZrefIndxP);
  449. end
  450. if ~isempty(NZrefIndxP) && mod(nonZeroCntDisp,2)==0, medianIndxDisp=NZrefIndxP(1:nonZeroCntDisp-1); end
  451. if ~isempty(NZrefIndxP) && mod(nonZeroCntDisp,2)~=0, medianIndxDisp=NZrefIndxP; end
  452. if ~isempty(NZrefIndxP) && length(medianIndxDisp) > 0 %(.15*384) %To calc. a median, more than 15% of spots must be nonZero
  453. medValLstDisp=Exp(expN).Dexp(n).scan(rf1scNdisp).plate(1).CFout(medianIndxDisp,5);
  454. %medValList1Disp{d}=medValLstDisp;
  455. mval1Disp=median(medValLstDisp); % mval1=median(Exp(expN).Dexp(n).scan(RF1mps).plate(1).CFout(1:384,5)); %CFout(1:383,5));
  456. nonZeroMedPosIndx=find(mval1Disp==nonZeroValsP); % (Exp(expN).Dexp(n).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5))); %(nonZeroIndxDisp,5))); %((nonZrfIndx.mp{dMPs(mm),:}),5)));
  457. RFmd1posD=NZrefIndxP(nonZeroMedPosIndx); % drfPindx((RFmd1posIndx),dMPs(mm));
  458. RFmd1locD(1)=ceil(RFmd1posD/24); % calc r value
  459. RFmd1locD(2)=RFmd1posD - ((RFmd1locD(1)-1)*24); % calc c value
  460. lstindx=lstindx+1;
  461. lstindxOrf=lstindxOrf+1;
  462. if usrRefFg==0, rfPLbl='RF1mdP('; else rfPLbl=strcat('RF-',rfGnSp,'mdP('); end % accomodate User Ref Selection
  463. if iscell(strcat(rfPLbl,num2str(d),')')),
  464. aa(lstindx,1)=strcat(rfPLbl,num2str(d),')');
  465. bb(lstindxOrf,1)=strcat(rfPLbl,num2str(d),')'); % remove string2cell brackets {...}
  466. else
  467. aa(lstindx,1)={strcat(rfPLbl,num2str(d),')')};
  468. bb(lstindxOrf,1)={strcat(rfPLbl,num2str(d),')')}; %remove string2cell brackets {...}
  469. end
  470. aa(lstindx,2)={strcat(':',num2str(dMPs(mm)),':',num2str(RFmd1locD(1)),':',num2str(RFmd1locD(2)))};
  471. bb(lstindxOrf,2)={strcat(':',num2str(dMPs(mm)),':',num2str(RFmd1locD(1)),':',num2str(RFmd1locD(2)))};
  472. Exp(expN).Dexp(n).RFmdPLB(d,dMPs(mm))=strcat(aa(lstindx,1),aa(lstindx,2));
  473. Exp(expN).Dexp(n).RFmdPindx(d,dMPs(mm))=RFmd1posD;
  474. Exp(expN).Dexp(n).RFmdPpltN(d,dMPs(mm))=dMPs(mm); %This is a storage of the MasterPlate used NOT the ScanPlate? WeMight wish to store the ScanPlateNumber also???
  475. Exp(expN).Dexp(n).RFmdPscanN(d,dMPs(mm))=rf1scNdisp;
  476. Exp(expN).Dexp(n).RFmedianP(d,dMPs(mm))=mval1Disp;
  477. Exp(expN).Dexp(n).stdP(d,dMPs(mm))=std1Disp;
  478. Exp(expN).Dexp(n).meanP(d,dMPs(mm))=mean1Disp;
  479. Exp(expN).Dexp(n).minP(d,dMPs(mm))=minDisp;
  480. Exp(expN).Dexp(n).maxP(d,dMPs(mm))=maxDisp;
  481. else
  482. % Need to set L r K values to zeros or pick the first spot with zeros
  483. % Spot 1 could be other than zero as the median isn't calculated if fewer than some percent are nonzero
  484. medianCalcFailedD='To Few nonZero spots for valid median RF1 selection'
  485. firstZeroDindx=find(((Exp(expN).Dexp(n).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5))==0),1,'first');
  486. firstZeroD=drfPindx((firstZeroDindx),dMPs(mm));
  487. Exp(expN).Dexp(n).RFmdPindx(d,dMPs(mm))=firstZeroD;
  488. Exp(expN).Dexp(n).RFmdPpltN(d,dMPs(mm))=dMPs(mm); % RF1mp; % Is this supposed to be the MP number or the ScanPlate number???
  489. end
  490. catch
  491. medianCalcTryFailed1D='Failed! Failed! Ln565 {Dispersed RF1s} "try" But process continued with placeholder Plate spot value!'
  492. try
  493. firstZeroindxD=find(vv((chgIndx(d):chgIndx(d+1)-1),5)==0,1,'first');
  494. firstZeroPindx=uu(firstZeroindxD,4);
  495. Exp(expN).Dexp(n).RFmdPpltN(d,dMPs(mm))=dMPs(mm);
  496. Exp(expN).Dexp(n).RFmdPindx(d,dMPs(mm))=firstZeroPindx;
  497. catch
  498. catchissue='try at Ln565'
  499. Exp(expN).Dexp(n).RFmdPpltN(d,dMPs(mm))=dMPs(mm);
  500. Exp(expN).Dexp(n).RFmdPindx(d,dMPs(mm))=384; % if crapout,Then use spot384 as default to keep going
  501. end
  502. try
  503. Exp(expN).Dexp(n).RFmdPpltN=dMPs(mm);
  504. catch
  505. catchissue='Ln619'
  506. Exp(expN).Dexp(n).RFmdPpltN=1; % this might keep from breaking BUT ???
  507. end
  508. end
  509. end
  510. end
  511. % Calc. Global Mean, Std, And Median For Distributed References
  512. uu=horzcat(uu,vv);
  513. for d=1:DMnum
  514. medianIndxG=[];
  515. NZrfIndxG=[];
  516. minG=min(nonzeros(vv(:,d)));
  517. maxG=max(nonzeros(vv(:,d)));
  518. RFmeanG=mean(nonzeros(vv(:,d)));
  519. RFstdG=std(nonzeros(vv(:,d)));
  520. NZrfIndxG=find(vv(:,d)); % find(nonzeros(vv(:,d)));
  521. if isempty(RFmeanG)
  522. nonZeroCntD=0 % medianIndxDisp=RFmeanG(d);
  523. else
  524. nonZeroCntD=length(nonzeros(vv(:,d)));
  525. end
  526. % Calc. of median requires an odd number of indx items
  527. if ~isempty(NZrfIndxG) && mod(nonZeroCntD,2)==0, medianIndxD=NZrfIndxG(1:(size(NZrfIndxG,1)-1)); end
  528. if ~isempty(NZrfIndxG) && mod(nonZeroCntD,2)~=0, medianIndxD=NZrfIndxG(:); end
  529. if ~isempty(NZrfIndxG) && length(medianIndxD) > 0 %(.15*size(drf,1)) % to calc. a median, more than 15% of spots must be nonZero
  530. mvalsDG=median(vv(medianIndxD,d)); % (nonzeros(vv(:,d)));
  531. nzPosIndxDG=find(mvalsDG==vv(:,d));
  532. RFmdDGloc(d,1)=uu(nzPosIndxDG,1); % MP of distributedGlobal Median value
  533. RFmdDGloc(d,2)=uu(nzPosIndxDG,2); % calc r value
  534. RFmdDGloc(d,3)=uu(nzPosIndxDG,3); % calc c value
  535. lstindx=lstindx+1;
  536. lstindxOrf=lstindxOrf+1;
  537. if usrRefFg==0, rfGLbl='RF1mdG('; else rfGLbl=strcat('RF-',rfGnSp,'mdG('); end %accomodate User Ref Selection
  538. if iscell(strcat(rfPLbl,num2str(d),')')),
  539. aa(lstindx,1)=strcat(rfGLbl,num2str(d),')'); % remove string2cell brackets {...}
  540. bb(lstindxOrf,1)=strcat(rfGLbl,num2str(d),')'); % remove string2cell brackets {...}
  541. else
  542. aa(lstindx,1)={strcat(rfGLbl,num2str(d),')')};
  543. bb(lstindxOrf,1)={strcat(rfGLbl,num2str(d),')')};
  544. end
  545. aa(lstindx,2)={strcat(':',num2str(RFmdDGloc(d,1)),':',num2str(RFmdDGloc(d,2)),':',num2str(RFmdDGloc(d,3)))}; %,'std_',num2str(std2))};
  546. bb(lstindxOrf,2)={strcat(':',num2str(RFmdDGloc(d,1)),':',num2str(RFmdDGloc(d,2)),':',num2str(RFmdDGloc(d,3)))}; %,'std_',num2str(std2))};
  547. % Composite Reference Amalgum Plot
  548. lstindx=lstindx+1;
  549. lstindxOrf=lstindxOrf+1;
  550. if usrRefFg==0, rfcmpGLbl='RFcmpG('; else rfcmpGLbl=strcat('RFcmpG-',rfGnSp,'('); end %accomodate User Ref Selection
  551. if iscell(strcat(rfcmpGLbl,num2str(d),')')),
  552. aa(lstindx,1)=strcat(rfcmpGLbl,num2str(d),')'); % strcat('RFcmpG(',num2str(d),')');
  553. bb(lstindxOrf,1)=strcat(rfcmpGLbl,num2str(d),')'); % strcat('RFcmpG(',num2str(d),')');
  554. else
  555. aa(lstindx,1)={strcat(rfcmpGLbl,num2str(d),')')};
  556. bb(lstindxOrf,1)={strcat(rfcmpGLbl,num2str(d),')')};
  557. end
  558. aa(lstindx,2)={''};
  559. bb(lstindxOrf,2)={''};
  560. Exp(expN).Dexp(n).RFmdGLB(d)=strcat(aa(lstindx,1),aa(lstindx,2));
  561. Exp(expN).Dexp(n).RFmdGindx(d)=nzPosIndxDG;
  562. Exp(expN).Dexp(n).RFmdGpltN(d)=RFmdDGloc(d,1);
  563. Exp(expN).Dexp(n).RFmdGscanN(d)=uu(nzPosIndxDG,4);
  564. Exp(expN).Dexp(n).RFmedianG(d)=mvalsDG;
  565. Exp(expN).Dexp(n).RFminG(d)=minG;
  566. Exp(expN).Dexp(n).RFmaxG(d)=maxG;
  567. Exp(expN).Dexp(n).RFstdG(d)=RFstdG;
  568. Exp(expN).Dexp(n).RFmeanG(d)=RFmeanG;
  569. Exp(expN).Dexp(n).RFcmpGL.dm(d).Lvals=vv(medianIndxD,d); %17_1201 TrendOL
  570. Exp(expN).Dexp(n).RFcmpGL.dm(d).med=median(vv(medianIndxD,d)); %For Ref Composite 17_1009
  571. Exp(expN).Dexp(n).RFcmpGL.dm(d).mean=mean(vv(medianIndxD,d)); %For Ref Composite 17_1009
  572. Exp(expN).Dexp(n).RFcmpGL.dm(d).std=std(vv(medianIndxD,d)); %For Ref Composite 17_1009
  573. Exp(expN).Dexp(n).RFcmpGL.dm(d).min=min(vv(medianIndxD,d)); %For Ref Composite 17_1009
  574. Exp(expN).Dexp(n).RFcmpGL.dm(d).max=max(vv(medianIndxD,d)); %For Ref Composite 17_1009
  575. Exp(expN).Dexp(n).RFcmpGK.dm(d).Kvals=vvK(medianIndxD,d); %17_1201 TrendOL
  576. Exp(expN).Dexp(n).RFcmpGK.dm(d).med=median(vvK(medianIndxD,d)); %For Ref Composite 17_1009
  577. Exp(expN).Dexp(n).RFcmpGK.dm(d).mean=mean(vvK(medianIndxD,d)); %For Ref Composite 17_1009
  578. Exp(expN).Dexp(n).RFcmpGK.dm(d).std=std(vvK(medianIndxD,d)); %For Ref Composite 17_1009
  579. Exp(expN).Dexp(n).RFcmpGK.dm(d).min=min(vvK(medianIndxD,d)); %For Ref Composite 17_1009
  580. Exp(expN).Dexp(n).RFcmpGK.dm(d).max=max(vvK(medianIndxD,d)); %For Ref Composite 17_1009
  581. Exp(expN).Dexp(n).RFcmpGr.dm(d).rvals=vvr(medianIndxD,d); %17_1201 TrendOL
  582. Exp(expN).Dexp(n).RFcmpGr.dm(d).med=median(vvr(medianIndxD,d)); %For Ref Composite 17_1009
  583. Exp(expN).Dexp(n).RFcmpGr.dm(d).mean=mean(vvr(medianIndxD,d)); %For Ref Composite 17_1009
  584. Exp(expN).Dexp(n).RFcmpGr.dm(d).std=std(vvr(medianIndxD,d)); %For Ref Composite 17_1009
  585. Exp(expN).Dexp(n).RFcmpGr.dm(d).min=min(vvr(medianIndxD,d)); %For Ref Composite 17_1009
  586. Exp(expN).Dexp(n).RFcmpGr.dm(d).max=max(vvr(medianIndxD,d)); %For Ref Composite 17_1009
  587. end
  588. end
  589. end
  590. % EZusrSelRef
  591. gnLstRaw=strcat(aa(:,1),aa(:,2));
  592. Exp(expN).Dexp(n).srtGnLst=sort(gnLstRaw);
  593. orfLstRaw=strcat(bb(:,1),bb(:,2));
  594. Exp(expN).Dexp(n).srtOrfLst=sort(orfLstRaw);
  595. %{
  596. %set(handles.MPsldr2,'max',length(MP));
  597. %set(handles.DMsldr2,'max',length(DM.drug));
  598. %set(handles.Tptsldr2,'max',tPtsSize);
  599. %set(handles.MPsldr2,'min',1,'max',MPnum)
  600. %set(handles.DMsldr2,'min',1,'max',DMnum)
  601. %tPtsSize=size(Exp(expN).Dexp(n).FexpScanBMtp{1,1},(3));
  602. %set(handles.Tptsldr2,'min',1,'max',tPtsSize)
  603. %set(handles.MPsldr2,'value',1)
  604. %set(handles.DMsldr2,'value',1)
  605. %set(handles.Tptsldr2,'value',1)
  606. %set(handles.MPed2,'string','1')
  607. %set(handles.DMed2,'string','1')
  608. %set(handles.Tpted2,'string','1')
  609. %set(handles.MPsldr2,'SliderStep',[1/length(MP) 1/length(MP)]);
  610. %set(handles.DMsldr2,'SliderStep',[1/length(DM.drug) 1/length(DM.drug)]);
  611. %set(handles.Tptsldr2,'SliderStep',[1/tPtsSize 1/tPtsSize]);
  612. %}