EZinterAgingDev0.m 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. %single gene L based interaction shift display
  2. function EZinterAgingDev0
  3. global Exp
  4. global matFile
  5. [matFile,scansDir]=uigetfile('.mat','Open Experiment folder and data storage .mat file name','MultiSelect','on');
  6. AgMPDM=load(fullfile(scansDir,'MasterPlateFiles','MPDMmat.mat'));
  7. for i=1:size(matFile,2)
  8. ExpOutmat{i}=fullfile(scansDir,matFile{i});
  9. EScan{i}=load(ExpOutmat{1});
  10. end
  11. % single gene L based interaction shift display
  12. % function EZinteractDev3
  13. % expN=1;
  14. % User Input decode for application
  15. prompt={...
  16. 'Enter LeftSide Central Boundary in Percent:',...
  17. 'Enter RightSide Central Boundary in Percent:', ...
  18. 'Enter Perturbation Numbers for set intersect:' ...
  19. 'Remove No Growth Infinite Interactors:' ...
  20. 'Number of Bins for Histograms'...
  21. 'Subplots(Y), Multiple Plots(N), Suspend Plots(S)'};
  22. % 'Select Experiment(zone) number:'
  23. name='Interaction User Input';
  24. numlines=1;
  25. defaultanswer={'80','60','1','N','39','Y'};
  26. answer=inputdlg(prompt,name,numlines,defaultanswer);
  27. negPercent=str2double(cell2mat(answer(1)));
  28. posPercent=str2double(cell2mat(answer(2)));
  29. DMstr=cell2mat(answer(3));
  30. DMcomas=strfind((cell2mat(answer(3))),',');
  31. removInfinL=answer(4);
  32. numBins=str2double(cell2mat(answer(5)));
  33. subplotX=answer(6);
  34. % expN=str2double(cell2mat(answer(7)));
  35. n=0;
  36. for i=DMcomas,
  37. n=n+1
  38. DMsel(n)=str2double(DMstr(i-1:i))
  39. if i==max(DMcomas)
  40. DMsel(n+1)=str2double(DMstr(i:end))
  41. end
  42. end
  43. Rn=Exp(expN).RFmean;
  44. Rs=Exp(expN).RFstd;
  45. dmN=length(Exp(expN).DM.drug);
  46. mpN=length(Exp(expN).MP);
  47. % Intc1=3; IntcLst=5;
  48. % Calculate Interaction values (with and without
  49. % standardDeviation/Upper-Lower boundary compensation
  50. for j=1:dmN
  51. for m=1:mpN
  52. scnN=j + (dmN*(m-1)) % 1,6,11..; 2,7,12 ..; 3,8,13..;
  53. Xn{m,j,:}=Exp(expN).scan(scnN).plate(1).CFout(:,5); % Exp(expN).scan(DM{j}(m)).plate(1).CFout(:,5);
  54. Xn{m,j,:}(Xn{m,j,:}==0)=140;
  55. Xln{m,j,:}=Exp(expN).scan(scnN).plate(1).CFout(:,11); % Exp(expN).scan(DM{j}(m)).plate(1).CFout(:,11);
  56. Xhn{m,j,:}=Exp(expN).scan(scnN).plate(1).CFout(:,12); % Exp(expN).scan(DM{j}(m)).plate(1).CFout(:,12);
  57. intL{m,j,:}=(Xn{m,j,:} - Rn(j));
  58. intL{m,j,:}(Xn{m,j,:}==140)=100;
  59. intLhw{m,j,:}=((Xn{m,1,:}-Xn{m,j,:}) - Rn(1)-Rn(j));
  60. intLhw{m,j,:}(Xn{m,j,:}==140)=100;
  61. deltaXR{m,j}(Xn{m,j} >=(Rn(j)+Rs(j)))=( Xln{m,j}(Xn{m,j} >=(Rn(j)+Rs(j))))- (Rn(j)+Rs(j));
  62. deltaXR{m,j}(Xn{m,j} < (Rn(j)-Rs(j)))=( Xhn{m,j}(Xn{m,j} < (Rn(j)-Rs(j))))- (Rn(j)-Rs(j));
  63. Xneg=Xhn{m,j}- (Rn(j)-Rs(j));
  64. Xpos=Xln{m,j}- (Rn(j)+Rs(j));
  65. deltaXR{m,j}=zeros(1,384);
  66. for i=1:length(Xpos(:))
  67. % deltaXR{m,j}(i)=Xpos(i);
  68. if deltaXR{m,j}(i)==0
  69. try
  70. if abs(Xpos(i))<abs(Xneg(i)), deltaXR{m,j}(i)=Xpos(i);end
  71. catch
  72. end
  73. end
  74. end
  75. for i=1:length(Xneg(:))
  76. if deltaXR{m,j}(i)==0, deltaXR{m,j}(i)=Xneg(i); end
  77. try
  78. if abs(Xpos(i))>abs(Xneg(i)), deltaXR{m,j}(i)=Xneg(i); end
  79. catch
  80. end
  81. end
  82. deltaXR{m,j,:}(Xln{m,j,:}==0)=100;
  83. deltaXR{m,j,:}(isnan(Xln{m,j,:}))=120;
  84. deltaXR{m,j,:}(Xhn{m,j,:}==0)=100;
  85. deltaXR{m,j,:}(isnan(Xhn{m,j,:}))=120;
  86. % Compile all gene related L values for the each pert-DM (j).
  87. addend=(1+((m-1)*384)) % ((((m-1)*j)*384)+1);
  88. intLcmp(addend:addend+383,j)=cell2mat(intL(m,j,:)); % ((addend:addend+383),j)=cell2mat(intL(j,m,:));
  89. intLadjcmp(addend:addend+383,j)=cell2mat(deltaXR(m,j,:)); % ((addend:addend+383),j)=cell2mat(deltaXR(j,m,:));
  90. end
  91. % Remove RFs and Blank (or non annotated ' ') orf data Then
  92. % Filter data per user intput
  93. intLc{j}=intLcmp(:,j);
  94. intLwoRFs{j}(1,:)=intLcmp(Exp(expN).mutSpotIndx.woRFs,j);
  95. intLwoRFs{j}(2,:)=Exp(expN).mutSpotIndx.woRFs; % index of non-RF non-blank spots %Crude early intLcmp(385:(mpN-1)*384,j);
  96. if strcmpi(removInfinL,'Y')
  97. intLwoRFs0{j}(1,:)=intLwoRFs{j}(1,(intLwoRFs{j}(1,:)~=100)); % intLcmp(Exp(1).mutSpotIndx.woRFs,j);
  98. intLwoRFs0{j}(2,:)=intLwoRFs{j}(2,(intLwoRFs{j}(1,:)~=100)); % intLcmp(385:(mpN-1)*384,j);
  99. clear intLwoRFs
  100. intLwoRFs{j}(1,:)=intLwoRFs0{j}(1,:);
  101. intLwoRFs{j}(2,:)=intLwoRFs0{j}(2,:);
  102. end
  103. intLwoRFsorted{j}=sortrows(intLwoRFs{j}',1);
  104. clear intLcmpSortGT0 intLcmpSortLT0
  105. tempIntL=intLwoRFsorted{j}(:,1);
  106. intLcmpSortGT0=tempIntL((tempIntL) >=0);
  107. intLcmpSortLT0=tempIntL((tempIntL) <0);
  108. centPosCnt=round(posPercent/100 * length(intLcmpSortGT0));
  109. centNegCnt=round(negPercent/100 * length(intLcmpSortLT0));
  110. intLposSel{j}=intLwoRFsorted{j}((length(intLcmpSortLT0)+centPosCnt): end,:);
  111. intLnegSel{j}=intLwoRFsorted{j}((1:(length(intLcmpSortLT0)-centNegCnt)),:);
  112. posIntboundryCentralVal(j)=intLcmpSortGT0((centPosCnt),:); % For Histogram use
  113. negIntboundryCentralVal(j)=intLcmpSortLT0(((length(intLcmpSortLT0))-(centNegCnt)),:); % For Histogram use
  114. % Find potential Interactors within selected range
  115. if j==DMsel(1) % Intc1,
  116. InterslstPos{1}=intLposSel{DMsel(1)}(:,2) % intLcmpposInd{Intc1}
  117. InterslstNeg{1}=intLnegSel{DMsel(1)}(:,2) % intLcmpnegInd{Intc1}
  118. elseif sum(ismember(DMsel,j))==1 %Intc1 && j<=IntcLst
  119. InterslstPos{1}=(intersect(InterslstPos{1},intLposSel{j}(:,2))); % ,intLcmpposInd{j}))
  120. InterslstNeg{1}=(intersect(InterslstNeg{1},intLnegSel{j}(:,2))); % ,intLcmpnegInd{j}))
  121. end
  122. % Convolute experiment spot index to get scan#, MP# and plateIndx needed
  123. % later to obtain genename and other descriptors and correlate data
  124. intLposDIndx{j}(:,2)=ceil((intLposSel{j}(:,2))/384); % mp plate numb column
  125. intLposDIndx{j}(:,3)=(rem(intLposSel{j}(:,2),384));
  126. nn=(intLposDIndx{j}(:,3)==0);
  127. intLposDIndx{j}(nn,3)=384;
  128. intLposDIndx{j}(:,1)=j + (dmN*((intLposDIndx{j}(:,2))-1)); % scan numb column %intLposDIndx(:,2)* intLposDIndx(:,3);
  129. intLnegDIndx{j}(:,2)=ceil((intLnegSel{j}(:,2))/384); % mp plate numb column
  130. intLnegDIndx{j}(:,3)=(rem(intLnegSel{j}(:,2),384));
  131. nn=(intLposDIndx{j}(:,3)==0);
  132. intLnegDIndx{j}(nn,3)=384;
  133. intLnegDIndx{j}(:,1)=j + (dmN*((intLnegDIndx{j}(:,2))-1)); % scan numb
  134. % ADJUSTED L for Reference Standard deviation(More conservative) Interaction List compilation
  135. intLadjwoRFs{j}(1,:)=intLadjcmp(Exp(expN).mutSpotIndx.woRFs,j);
  136. intLadjwoRFs{j}(2,:)=Exp(expN).mutSpotIndx.woRFs; % intLadjcmp(385:(mpN-1)*384,j); %intLadjcmp(Exp(expN).mutSpotIndx.woRFs,j);
  137. if strcmpi(removInfinL,'Y')
  138. intLadjwoRFs0{j}(1,:)=intLadjwoRFs{j}(1,(intLadjwoRFs{j}(1,:)~=100)) ; %intLcmp(Exp(1).mutSpotIndx.woRFs,j);
  139. intLadjwoRFs0{j}(2,:)=intLadjwoRFs{j}(2,(intLadjwoRFs{j}(1,:)~=100)) ; % Remove Index where spots are infinite (=100);
  140. clear intLadjwoRFs
  141. intLadjwoRFs{j}(1,:)=intLadjwoRFs0{j}(1,:);
  142. intLadjwoRFs{j}(2,:)=intLadjwoRFs0{j}(2,:);
  143. end
  144. intLwoRFsortedAdj{j}=sortrows(intLadjwoRFs{j}',1);
  145. clear intLadjSortGT0 intLadjSortLT0
  146. tempIntLadj=intLwoRFsortedAdj{j}(:,1);
  147. intLadjSortGT0=tempIntLadj((tempIntLadj) >=0);
  148. intLadjSortLT0=tempIntLadj((tempIntLadj) <0);
  149. centPosCntAdj=round(posPercent/100 * length(intLadjSortGT0));
  150. centNegCntAdj=round(negPercent/100 * length(intLadjSortLT0));
  151. intLposSelAdj{j}=intLwoRFsortedAdj{j}((length(intLadjSortLT0)+centPosCntAdj): end,:);
  152. intLnegSelAdj{j}=intLwoRFsortedAdj{j}((1:(length(intLadjSortLT0)-centNegCntAdj)),:);
  153. posIntboundryCentralValAdj(j)=intLadjSortGT0((centPosCntAdj),:);
  154. negIntboundryCentralValAdj(j)=intLadjSortLT0(((length(intLadjSortLT0))-(centNegCntAdj)),:);
  155. if j==DMsel(1) % Intc1
  156. InterslstPosAdj{1}=intLposSelAdj{DMsel(1)}(:,2) % intLcmpposInd{Intc1}
  157. InterslstNegAdj{1}=intLnegSelAdj{DMsel(1)}(:,2) % intLcmpnegInd{Intc1}
  158. elseif sum(ismember(DMsel,j))==1 % j>Intc1 && j<=IntcLst
  159. InterslstPosAdj{1}=(intersect(InterslstPosAdj{1},intLposSelAdj{j}(:,2))); % ,intLcmpposInd{j}))
  160. InterslstNegAdj{1}=(intersect(InterslstNegAdj{1},intLnegSelAdj{j}(:,2))); % ,intLcmpnegInd{j}))
  161. end
  162. % Convolute experiment spot index to get scan#, MP# and plateIndx needed
  163. % later to obtain genename and other descriptors and correlate data
  164. intLposDIndxAdj{j}(:,2)=ceil((intLposSelAdj{j}(:,2))/384); % mp plate numb column
  165. intLposDIndxAdj{j}(:,3)=(rem(intLposSelAdj{j}(:,2),384));
  166. nn=(intLposDIndxAdj{j}(:,3)==0);
  167. intLposDIndx{j}(nn,3)=384;
  168. intLposDIndxAdj{j}(:,1)=j + (dmN*((intLposDIndxAdj{j}(:,2))-1)); % scan numb column %intLposDIndx(:,2)* intLposDIndx(:,3);
  169. intLnegDIndxAdj{j}(:,2)=ceil((intLnegSelAdj{j}(:,2))/384); % mp plate numb column
  170. intLnegDIndxAdj{j}(:,3)=(rem(intLnegSelAdj{j}(:,2),384));
  171. nn=(intLposDIndxAdj{j}(:,3)==0);
  172. intLnegDIndxAdj{j}(nn,3)=384;
  173. intLnegDIndxAdj{j}(:,1)=j + (dmN*((intLnegDIndxAdj{j}(:,2))-1)); % scan numb
  174. end
  175. % Get interaction values for each DM drugmedia agar type
  176. IntersValsPos=intLcmp(InterslstPos{1},DMsel);
  177. IntersValsNeg=intLcmp(InterslstNeg{1},DMsel);
  178. IntersValsPosAdj=intLadjcmp(InterslstPosAdj{1},DMsel);
  179. IntersValsNegAdj=intLadjcmp(InterslstNegAdj{1},DMsel);
  180. % Build 'genelist' data sheet for interactors
  181. selIntPx{1}(:,6)=InterslstPos{1};
  182. selIntPx{1}(:,2)=ceil((InterslstPos{1})/384); % mp plate numb column
  183. selIntPx{1}(:,3)=(rem(InterslstPos{1},384));
  184. nn=(selIntPx{1}(:,3)==0);
  185. selIntPx{1}(nn,3)=384;
  186. selIntPx{1}(:,4)=ceil(selIntPx{1}(:,3)/24); % row numb
  187. selIntPx{1}(:,5)=rem(selIntPx{1}(:,3),24);
  188. mm=(selIntPx{1}(:,5)==0);
  189. selIntPx{1}(mm,5)=24;
  190. selIntPx{1}(:,1)=j + (dmN*((selIntPx{1}(:,2))-1)); % scan numb column %intLposDIndx(:,2)* intLposDIndx(:,3);
  191. selIntP=cell2mat(selIntPx);
  192. selIntNx{1}(:,6)=InterslstNeg{1};
  193. selIntNx{1}(:,2)=ceil((InterslstNeg{1})/384); % mp plate numb column
  194. selIntNx{1}(:,3)=(rem(InterslstNeg{1},384));
  195. nn=(selIntNx{1}(:,3)==0);
  196. selIntNx{1}(nn,3)=384;
  197. selIntNx{1}(:,4)=ceil(selIntNx{1}(:,3)/24); % row numb
  198. selIntNx{1}(:,5)=rem(selIntNx{1}(:,3),24);
  199. mm=(selIntNx{1}(:,5)==0);
  200. selIntNx{1}(mm,5)=24;
  201. selIntNx{1}(:,1)=j + (dmN*((selIntNx{1}(:,2))-1)); % scan numb
  202. selIntN=cell2mat(selIntNx);
  203. for i=1:size(selIntP,1)
  204. IPgene(i)=Exp(expN).MP(selIntP(i,2)).genename{1}(selIntP(i,3));
  205. IPorf(i)=Exp(expN).MP(selIntP(i,2)).orf{1}(selIntP(i,3));
  206. IPstrain(i)=Exp(expN).MP(selIntP(i,2)).strain{1}(selIntP(i,3));
  207. IPspecifics(i)=Exp(expN).MP(selIntP(i,2)).specifics{1}(selIntP(i,3));
  208. IPorfRep(i)=Exp(expN).MP(selIntP(i,2)).orfRep{1}(selIntP(i,3));
  209. % Bad this is the L data for only the last selected DM perturbation
  210. % Would need to calculate each scan# for each DMsel value
  211. ipL(i)=Exp(expN).scan(selIntP(i,1)).plate(1).CFout(selIntP(i,3),5);
  212. ipLlower(i)=Exp(expN).scan(selIntP(i,1)).plate(1).CFout(selIntP(i,3),11);
  213. ipLupper(i)=Exp(expN).scan(selIntP(i,1)).plate(1).CFout(selIntP(i,3),12);
  214. end
  215. for i=1:size(selIntN,1)
  216. INgene(i)=Exp(expN).MP(selIntN(i,2)).genename{1}(selIntN(i,3));
  217. INorf(i)=Exp(expN).MP(selIntN(i,2)).orf{1}(selIntN(i,3));
  218. INstrain(i)=Exp(expN).MP(selIntN(i,2)).strain{1}(selIntN(i,3));
  219. INspecifics(i)=Exp(expN).MP(selIntN(i,2)).specifics{1}(selIntN(i,3));
  220. INorfRep(i)=Exp(expN).MP(selIntN(i,2)).orfRep{1}(selIntN(i,3));
  221. % Bad this is the L data for only the last selected DM perturbation
  222. % Would need to calculate each scan# for each DMsel value
  223. inL(i)=Exp(expN).scan(selIntN(i,1)).plate(1).CFout(selIntN(i,3),5);
  224. inLlower(i)=Exp(expN).scan(selIntN(i,1)).plate(1).CFout(selIntN(i,3),11);
  225. inLupper(i)=Exp(expN).scan(selIntN(i,1)).plate(1).CFout(selIntN(i,3),12);
  226. end
  227. % ADJUSTED with STD and curve fit boundaries to produce more conservative interaction values
  228. % Build 'genelist' data sheet for interactors
  229. selIntPxAdj{1}(:,2)=ceil((InterslstPosAdj{1})/384); %mp plate numb column
  230. selIntPxAdj{1}(:,3)=(rem(InterslstPosAdj{1},384));
  231. nn=(selIntPxAdj{1}(:,3)==0);
  232. selIntPxAdj{1}(nn,3)=384;
  233. selIntPxAdj{1}(:,4)=ceil(selIntPxAdj{1}(:,3)/24); %row numb
  234. selIntPxAdj{1}(:,5)=rem(selIntPxAdj{1}(:,3),24);
  235. mm=(selIntPxAdj{1}(:,5)==0);
  236. selIntPxAdj{1}(mm,5)=24;
  237. selIntPxAdj{1}(:,1)=j + (dmN*((selIntPxAdj{1}(:,2))-1)); %scan numb column %intLposDIndx(:,2)* intLposDIndx(:,3);
  238. selIntPAdj=cell2mat(selIntPxAdj);
  239. selIntNxAdj{1}(:,2)=ceil((InterslstNegAdj{1})/384); %mp plate numb column
  240. selIntNxAdj{1}(:,3)=(rem(InterslstNegAdj{1},384));
  241. nn=(selIntNxAdj{1}(:,3)==0);
  242. selIntNxAdj{1}(nn,3)=384;
  243. selIntNxAdj{1}(:,4)=ceil(selIntNxAdj{1}(:,3)/24); %row numb
  244. selIntNxAdj{1}(:,5)=rem(selIntNxAdj{1}(:,3),24);
  245. mm=(selIntNxAdj{1}(:,5)==0);
  246. selIntNxAdj{1}(mm,5)=24;
  247. selIntNxAdj{1}(:,1)=j + (dmN*((selIntNxAdj{1}(:,2))-1)); %scan numb
  248. selIntNAdj=cell2mat(selIntNxAdj);
  249. for i=1:size(selIntPAdj,1)
  250. IPgeneAdj(i)=Exp(expN).MP(selIntPAdj(i,2)).genename{1}(selIntPAdj(i,3));
  251. IPorfAdj(i)=Exp(expN).MP(selIntPAdj(i,2)).orf{1}(selIntPAdj(i,3));
  252. IPstrainAdj(i)=Exp(expN).MP(selIntPAdj(i,2)).strain{1}(selIntPAdj(i,3));
  253. IPspecificsAdj(i)=Exp(expN).MP(selIntPAdj(i,2)).specifics{1}(selIntPAdj(i,3));
  254. IPorfRepAdj(i)=Exp(expN).MP(selIntPAdj(i,2)).orfRep{1}(selIntPAdj(i,3));
  255. % Bad this is the L data for only the last selected DM perturbation
  256. % Would need to calculate each scan# for each DMsel value
  257. ipLAdj(i)=Exp(expN).scan(selIntPAdj(i,1)).plate(1).CFout(selIntPAdj(i,3),5);
  258. ipLlowerAdj(i)=Exp(expN).scan(selIntPAdj(i,1)).plate(1).CFout(selIntPAdj(i,3),11);
  259. ipLupperAdj(i)=Exp(expN).scan(selIntPAdj(i,1)).plate(1).CFout(selIntPAdj(i,3),12);
  260. end
  261. for i=1:size(selIntNAdj,1)
  262. INgeneAdj(i)=Exp(expN).MP(selIntNAdj(i,2)).genename{1}(selIntNAdj(i,3));
  263. INorfAdj(i)=Exp(expN).MP(selIntNAdj(i,2)).orf{1}(selIntNAdj(i,3));
  264. INstrainAdj(i)=Exp(expN).MP(selIntNAdj(i,2)).strain{1}(selIntNAdj(i,3));
  265. INspecificsAdj(i)=Exp(expN).MP(selIntNAdj(i,2)).specifics{1}(selIntNAdj(i,3));
  266. INorfRepAdj(i)=Exp(expN).MP(selIntNAdj(i,2)).orfRep{1}(selIntNAdj(i,3));
  267. %Bad this is the L data for only the last selected DM perturbation
  268. %Would need to calculate each scan# for each DMsel value
  269. inLAdj(i)=Exp(expN).scan(selIntNAdj(i,1)).plate(1).CFout(selIntNAdj(i,3),5);
  270. inLlowerAdj(i)=Exp(expN).scan(selIntNAdj(i,1)).plate(1).CFout(selIntNAdj(i,3),11);
  271. inLupperAdj(i)=Exp(expN).scan(selIntNAdj(i,1)).plate(1).CFout(selIntNAdj(i,3),12);
  272. end
  273. % Plot Histogram
  274. % subplotX=1;
  275. figure
  276. if strcmpi(subplotX,'Y')
  277. for j=1:dmN
  278. histLdata=intLwoRFsorted{j}(:,1); % intLcmp(385:(mpN-1)*384,j);
  279. % histLadjData=intLadjcmp(385:(mpN-1)*384,j);
  280. hgLdat{j}=histfitJR(histLdata,numBins,'kernel');
  281. x{j}=get(hgLdat{j}(2),'xdata');
  282. y{j}=get(hgLdat{j}(2),'ydata');
  283. xb{j}=get(hgLdat{j}(1),'xdata');
  284. yb{j}=get(hgLdat{j}(1),'ydata');
  285. ybpostot{j}=sum(yb{j}(2,(xb{j}(1,:)>=0)));
  286. ybnegtot{j}=sum(yb{j}(2,(xb{j}(1,:) <0)));
  287. xbb(j,:)=xb{j}(2,:);
  288. ybb(j,:)=yb{j}(2,:);
  289. clf
  290. end
  291. % Figure
  292. for j=1:dmN
  293. histLdata=intLwoRFsorted{j}(:,1); % intLcmp(385:(mpN-1)*384,j);
  294. hgL{j}=subplot(2, 4, j), histfitJR(histLdata,numBins,'kernel') ; hold %hgL{j}=histfit(intLcmp(:,j),31,'kernel')
  295. subplot(2, 4, j),plot(posIntboundryCentralVal(j), 1:3000,'--r')
  296. subplot(2, 4, j),plot(negIntboundryCentralVal(j), 1:3000,'--g')
  297. hold off
  298. end
  299. scnsize=get(0,'screensize')
  300. pos1=[round(scnsize(3)/40), round(scnsize(4)/2 +(scnsize(3)/80)),...
  301. round(scnsize(3) -round(scnsize(3)/80)),round(scnsize(4)/2 -round(scnsize(4)/80))]
  302. set(gcf,'outerposition',pos1)
  303. set(gcf,'Name', 'Interaction Values ');
  304. figure
  305. for j=1:dmN
  306. histLadjData=intLwoRFsortedAdj{j}(:,1); %intLadjcmp(385:(mpN-1)*384,j);
  307. hgLadj{j}=subplot(2, 4, j),histfitJR(histLadjData,numBins,'kernel') ; hold %hgLadj{j}=histfit(intLadjcmp(:,j),31,'kernel')
  308. subplot(2, 4, j),plot(posIntboundryCentralValAdj(j), 1:3000,'--r')
  309. subplot(2, 4, j),plot(negIntboundryCentralValAdj(j), 1:3000,'--g')
  310. hold off
  311. end
  312. pos2=[round(scnsize(3)/40), round(scnsize(4)/30),...
  313. round(scnsize(3) -scnsize(3)/80),round(scnsize(4)/2 -scnsize(4)/80)]
  314. set(gcf,'outerposition',pos2)
  315. set(gcf,'Name', 'Interaction Compensated by Standard Deviation and Upper/Lower Curvefit boundaries')
  316. elseif strcmpi(subplotX,'N')
  317. for j=1:dmN
  318. histLdata=intLwoRFsorted{j}(:,1); %intLcmp(385:(mpN-1)*384,j);
  319. histLadjData=intLwoRFsortedAdj{j}(:,1); %intLadjcmp(385:(mpN-1)*384,j);%intLadjcmp(385:(mpN-1)*384,j); %intLcmp(:,j); %intLadjcmp(:,j);
  320. figure
  321. hgL{j}=histfitJR(histLdata,numBins,'kernel') ; hold %hgL{j}=histfit(intLcmp(:,j),31,'kernel')
  322. plot(posIntboundryCentralVal(j), 1:3000,'--r')
  323. plot(negIntboundryCentralVal(j), 1:3000,'--g')
  324. hold off
  325. figure
  326. hgLadj{j}=histfitJR(histLadjData,numBins,'kernel') ; hold %hgLadj{j}=histfit(intLadjcmp(:,j),31,'kernel')
  327. plot(posIntboundryCentralValAdj(j), 1:3000,'--r')
  328. plot(negIntboundryCentralValAdj(j), 1:3000,'--g')
  329. hold off
  330. x{j}=get(hgL{j}(2),'xdata')
  331. y{j}=get(hgL{j}(2),'ydata');
  332. xb{j}=get(hgL{j}(1),'xdata')
  333. yb{j}=get(hgL{j}(1),'ydata')
  334. ybpostot{j}=sum(yb{j}(2,(xb{j}(1,:)>=0)))
  335. ybnegtot{j}=sum(yb{j}(2,(xb{j}(1,:) <0)))
  336. xbb(j,:)=xb{j}(2,:);
  337. ybb(j,:)=yb{j}(2,:);
  338. end
  339. if strcmpi(subplotX,'N')
  340. figure
  341. bar3(ybb);
  342. % xxbb=yb{1}(2,:);
  343. % figure
  344. end
  345. else
  346. end
  347. % histograms placed in subplot figure else multiple histogram plots
  348. if strcmpi(subplotX,'Y')
  349. figure
  350. bar3(ybb);
  351. set(gcf,'Name', 'Unfiltered Interaction Histogram for all DrugMedias; NoGrowth Interactors set to 100hr (highest bin)')
  352. %xxbb=yb{1}(2,:);
  353. %figure
  354. end
  355. EZintPrint
  356. a=1 % TODO what is this for
  357. end