%EZhtMap global Exp global ghandles global adj global flip if isempty(adj), adj=1.5; flip='T'; end load('MyColormap1','modJet1') load('MyColormap2','modJet2') %load('MyColormap2','modJet0') %adj=1.5; cleanPallet=zeros(24,16); if expN==1,DexpN=(get(handles.DN1,'value')); end if expN==2,DexpN=(get(handles.DN2,'value')); end if expN==3,DexpN=(get(handles.DN3,'value')); end Exp(expN).DexpN=DexpN; try if expN==1,MPsel=floor(get(ghandles.MPsldr1,'value')); end if expN==2,MPsel=floor(get(ghandles.MPsldr2,'value')); end if expN==3,MPsel=floor(get(ghandles.MPsldr3,'value')); end if expN==1,pertSel=floor(get(ghandles.DMsldr1,'value')); end if expN==2,pertSel=floor(get(ghandles.DMsldr2,'value')); end if expN==3,pertSel=floor(get(ghandles.DMsldr3,'value')); end catch MPsel=1; pertSel=1; end if expN==1, expAxes=ghandles.Iaxes1;end if expN==2, expAxes=ghandles.Iaxes2;end if expN==3, expAxes=ghandles.Iaxes3;end dmN=length(Exp(expN).Dexp(DexpN).DM.drug); mpSel=Exp(expN).Dexp(DexpN).MPsel; dmSel=Exp(expN).Dexp(DexpN).pertSel; scnN=dmSel + (dmN*(mpSel-1)); if expN==1,htTog=Exp(1).htmapPBsel;end if expN==2,htTog=Exp(2).htmapPBsel;end if expN==3,htTog=Exp(3).htmapPBsel;end if htTog==0 colormap(flipud(modJet1)) % colormap(modJet2) L=Exp(expN).Dexp(DexpN).scan(scnN).plate.CFout(:,5); L=reshape(L,24,16); LpStd=mean(nonzeros(L(:)))+(adj*std(nonzeros(L(:)))); LnStd=mean(nonzeros(L(:))-(adj*std(nonzeros(L(:))))); % Data rescaling for Heatmap display (color range- mean+/std*adjustment) for i=1:size(L,1) for j=1:size(L,2) if L(i,j)>LpStd, L4hMap(i,j)=LpStd; elseif L(i,j)=(Rn(j)+RsReduced(j)); deltaYp(i)= Xln{m,j}(i)-Xln{m,1}(i); elseif Xn{m,j}(i) < (Rn(j)-RsReduced(j)); deltaYn(i)= Xhn{m,j}(i)-Xhn{m,1}(i); % Insert else end % Calculate deltaXRp and deltaXRn for each plate based on growth relative to deltaRp or deltaRn if deltaYp(i)>=deltaRp(j) deltaXRp(i)=deltaYp(i)-deltaRp(j); deltaXR{m,j}(i)=deltaXRp(i); %Consoludate into deltaXR{m,j}(i) cell array elseif deltaYn(i) < deltaRn(j) deltaXRn(i)=deltaYn(i)-deltaRn(j); deltaXR{m,j}(i)=deltaXRn(i); %Consoludate into deltaXR{m,j}(i) cell array if deltaYn(i)==0, deltaXR{m,j}(i)=0; end end % Ambiguous results that have delta gene values that are less than the variance of Reference+/-std end deltaXRl=deltaXR{m,j,:}; htMpN1Lzeros999=deltaXR{m,j,:}; deltaXRl(htmpCpyXn==0)=1.2*max(deltaXRl); htMpN1Lzeros999(htmpCpyXn==0)=999; Exp(expN).HtMpIntN1=htMpN1Lzeros999'; I=reshape(deltaXRl,24,16); if prntHt==0 hTogHt=figure; h=image(cleanPallet); else figure h=image(cleanPallet); end % h=figure; h=image(I); colormap(jet); % heat map set(h,'CDataMapping','scale') if expN==1,cla(handles.HtMap1);copyobj(h,ghandles.HtMap1);end if expN==2,cla(handles.HtMap2);copyobj(h,ghandles.HtMap2);end if expN==3,cla(handles.HtMap3);copyobj(h,ghandles.HtMap3);end if prntHt==0 close(hTogHt) else set(gca,'XDir','reverse') set(gca,'XTickMode','manual') % set(gca,'XTickLabel',{'2';'4';'6';'8';'10';'12';'14';'16'}) % set(gca,'XTickLabel',{'16';'14';'12';'10';'8';'6';'4';'2'}) % set(gca,'XTick',{0;2;4;6;8;10;12;14;16;18}) colorbar expLblHtmap=Exp(expN).Dexp.ExpFoldr; mediaLBhtmap=char(strcat(', Agar-',Exp(expN).Dexp(DexpN).DM.media{pertSel},' ',... Exp(expN).Dexp(DexpN).DM.drug{pertSel},Exp(expN).Dexp(DexpN).DM.conc{pertSel},' ',... Exp(expN).Dexp(DexpN).DM.mod1{pertSel},Exp(expN).Dexp(DexpN).DM.conc1{pertSel},' ',... Exp(expN).Dexp(DexpN).DM.mod2{pertSel},Exp(expN).Dexp(DexpN).DM.conc2{pertSel})); title({strcat('N1 HeatMap for - ',expLblHtmap),strcat('MP=',num2str(mpSel),' ,DM=',num2str(dmSel),mediaLBhtmap)}) end elseif htTog==4 answer=Exp(expN).htmapRFanswer; % ZoneRelated RFconfig=Exp(expN).RFconfig; % ZoneRelated answer=Exp(expN).htmapRFanswer; % ZoneRelated j=dmSel; DM0=dmSel; DMj=dmSel; m=mpSel; anN=[1 2]; EZintRFs % Call subroutine to interpret user RF inputs scnNdm1=1 + (dmN*(m-1)) scnN=j + (dmN*(m-1)) % 1,6,11..; 2,7,12 ..; 3,8,13..; Xn{m,j,1}=[]; Xn{m,1,:}=Exp(expN).Dexp(DexpN).scan(scnNdm1).plate(1).CFout(:,5); Xn{m,j,:}=Exp(expN).Dexp(DexpN).scan(scnN).plate(1).CFout(:,5); htmpCpyXn=Xn{m,j,:}'; % Use to find and delineate no growth spots with 999 in text field (infinite interaction) value; intL=((Xn{m,j,:} - Xn{m,1,:}) - (Rn(j)-Rn(1))); Exp(expN).HtMpIntN2=intL; % ZoneRelated intL=Exp(expN).HtMpIntN2; % ZoneRelated I=reshape(intL,24,16); if prntHt==0 hTogHt=figure; h=image(cleanPallet); elseif figure h=image(cleanPallet); end %h=figure h=image(I) colormap(jet); % heat map set(h,'CDataMapping','scale') if expN==1,cla(handles.HtMap1);copyobj(h,ghandles.HtMap1);end if expN==2,cla(handles.HtMap2);copyobj(h,ghandles.HtMap2);end if expN==3,cla(handles.HtMap3);copyobj(h,ghandles.HtMap3);end if prntHt==0 close(hTogHt) else set(gca,'XDir','reverse') set(gca,'XTickMode','manual') % set(gca,'XTickLabel',{'2';'4';'6';'8';'10';'12';'14';'16'}) % set(gca,'XTickLabel',{'16';'14';'12';'10';'8';'6';'4';'2'}) % set(gca,'XTick',{0;2;4;6;8;10;12;14;16;18}) colorbar expLblHtmap=Exp(expN).Dexp.ExpFoldr; mediaLBhtmap=char(strcat(', Agar-',Exp(expN).Dexp(DexpN).DM.media{pertSel},' ',... Exp(expN).Dexp(DexpN).DM.drug{pertSel},Exp(expN).Dexp(DexpN).DM.conc{pertSel},' ',... Exp(expN).Dexp(DexpN).DM.mod1{pertSel},Exp(expN).Dexp(DexpN).DM.conc1{pertSel},' ',... Exp(expN).Dexp(DexpN).DM.mod2{pertSel},Exp(expN).Dexp(DexpN).DM.conc2{pertSel})); title({strcat('N2 HeatMap for - ',expLblHtmap),strcat('MP=',num2str(mpSel),' ,DM=',num2str(dmSel),mediaLBhtmap)}) end end prntHt=0; % Update htMapText for location on the first 'roll thru of htMapPB EZhtMapText