Complete EZview reformatting

This commit is contained in:
2024-07-31 00:36:40 -04:00
parent 79e3676ed3
commit 019fb07f79
36 changed files with 7526 additions and 8544 deletions

View File

@@ -40,7 +40,6 @@ function varargout = EASYconsole(varargin)
fprintf('This script name: %s\n', easyFileName);
% Set scansDir (project scans directory) intelligently
if exist('PROJECT_SCANS_DIR', 'var') && ~isempty(getenv('PROJECT_SCANS_DIR'))
scansDir=fullfile(getenv('PROJECT_SCANS_DIR'));
if exist(scansDir, 'dir')

View File

@@ -6,7 +6,6 @@ RFconfig= Exp(zoneSel).Dexp(DexpN).RFconfig;
RFsel=Exp(zoneSel).htmapRFanswer;
j=pertSel; m=MPsel;
if RFconfig==1
try
RF1mdIndx(nn)=Exp(zoneSel).Dexp(nn).RFmd1indx(pertSel);
RF1mdPltN(nn)=Exp(zoneSel).Dexp(nn).RFmd1pltN; %This is the MP number for RF1
@@ -20,7 +19,6 @@ if RFconfig==1
try Rn(nn)=Exp(expN).Dexp(nn).RFmean(pertSel); catch, Rn(nn)=0; end
try Rs(nn)=Exp(expN).Dexp(nn).RFstd(pertSel); catch, Rs(nn)=0; end
end
if RFconfig==2
ctrlRF=RFsel{1};
j=pertSel; m=MPsel;
@@ -42,8 +40,8 @@ if RFconfig==2
if Exp(expN).Dexp(nn).meanP(j,m)~=0
Rn(nn)=Exp(expN).Dexp(nn).meanP(j,m);
Rs(nn)=Exp(expN).Dexp(nn).stdP(j,m);
elseif Exp(expN).Dexp(nn).meanP(j,m)==0||isempty(Exp(expN).Dexp(nn).meanP(j,m)) &&...
strcmpi(ctrlRF,'G')
elseif Exp(expN).Dexp(nn).meanP(j,m)==0||isempty(Exp(expN).Dexp(nn).meanP(j,m)) ...
&& strcmpi(ctrlRF,'G')
Rn(nn)=Exp(expN).Dexp(nn).RFmeanG(pertSel);
Rs(nn)=Exp(expN).Dexp(nn).RFstdG(pertSel);
end
@@ -61,16 +59,14 @@ if RFconfig==2
if Exp(expN).Dexp(nn).meanP(j,m)~=0
Rn(nn)=Exp(expN).Dexp(nn).meanP(j,m);
Rs(nn)=Exp(expN).Dexp(nn).stdP(j,m);
elseif Exp(expN).Dexp(nn).meanP(j,m)==0||isempty(Exp(expN).Dexp(nn).meanP(j,m)) &&...
strcmpi(ctrlRF,'G')
elseif Exp(expN).Dexp(nn).meanP(j,m)==0||isempty(Exp(expN).Dexp(nn).meanP(j,m)) ...
&& strcmpi(ctrlRF,'G')
Rn(nn)=Exp(expN).Dexp(nn).RFmeanG(j);
Rs(nn)=Exp(expN).Dexp(nn).RFstdG(j);
end
end
end
if RFconfig==3
j=pertSel; m=MPsel;
ctrlRF=RFsel{1};
@@ -97,7 +93,7 @@ if RFconfig==3
case {'L','l'}
Rn(nn)=Exp(expN).Dexp(nn).meanP(j,m);
Rs(nn)=Exp(expN).Dexp(nn).stdP(j,m);
if Exp(expN).Dexp(nn).meanP(j,m)~=0,
if Exp(expN).Dexp(nn).meanP(j,m)~=0
Rn(nn)=Exp(expN).Dexp(nn).meanP(j,m);
Rs(nn)=Exp(expN).Dexp(nn).stdP(j,m);
elseif Exp(expN).Dexp(nn).meanP(j,m)==0 && strcmpi(ctrlRF,'G')

View File

@@ -14,17 +14,15 @@ prntHt=0;
break
end
end
%*************************************************
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;
if strcmp(Exp(expN).DexpType,'single'),
if strcmp(Exp(expN).DexpType,'single')
DexpN=1;
elseif ~strcmp(Exp(expN).DexpType,'single')
if expN==1
set(handles.MPsldr1,'min',1,'max',MPnum)
DMnum=length(Exp(expN).Dexp(DexpN).DM.drug);
set(handles.DMsldr1,'min',1,'max',DMnum)
@@ -32,7 +30,6 @@ elseif ~strcmp(Exp(expN).DexpType,'single')
set(handles.Tptsldr1,'min',1,'max',tPtsSize)
end
if expN==2
set(handles.MPsldr2,'min',1,'max',MPnum)
DMnum=length(Exp(expN).Dexp(DexpN).DM.drug);
set(handles.DMsldr2,'min',1,'max',DMnum)
@@ -40,7 +37,6 @@ elseif ~strcmp(Exp(expN).DexpType,'single')
set(handles.Tptsldr2,'min',1,'max',tPtsSize)
end
if expN==3
set(handles.MPsldr3,'min',1,'max',MPnum)
DMnum=length(Exp(expN).Dexp(DexpN).DM.drug);
set(handles.DMsldr3,'min',1,'max',DMnum)
@@ -59,13 +55,9 @@ ghandles=handles;
if expN==1,pertSel=floor(get(handles.DMsldr1,'value')); end
if expN==2,pertSel=floor(get(handles.DMsldr2,'value')); end
if expN==3,pertSel=floor(get(handles.DMsldr3,'value')); end
if expN==1,tPtSel=floor(get(handles.Tptsldr1,'value')); end
if expN==2,tPtSel=floor(get(handles.Tptsldr2,'value')); end
if expN==3,tPtSel=floor(get(handles.Tptsldr3,'value')); end
plateNum=(MPsel-1)*destPerMP + pertSel;
tPtsSize=[];
tPtsSize=length(Exp(expN).Dexp(DexpN).scan(plateNum).plate(1).tSeries(:))
@@ -76,9 +68,11 @@ for ii= 1:tPtsSize
n=n+1
end
end
if tPtSel> tPtsSize
tPtSel=tPtsSize
end
if exist(fullfile(Exp(expN).Dexp(DexpN).ExpFoldr,num2str(plateNum),strcat((num2str(tPtSel)),'.bmp'))) ==0; %the .bmp file exists
tPtSel=bmpLst(find(bmpLst>tPtSel,1,'first'))
end
@@ -123,8 +117,6 @@ end
end
end
%---------------------------------------------------------
Exp(expN).Dexp(DexpN).MPsel=MPsel;
Exp(expN).Dexp(DexpN).destPerMP=destPerMP;
Exp(expN).Dexp(DexpN).pertSel=pertSel;
@@ -133,7 +125,6 @@ end
%try
I=imread(fullfile(Exp(expN).Dexp(DexpN).ExpFoldr,num2str(plateNum),strcat(num2str(tPtSel),'.bmp')));
%set(ghandles.Iaxes1,'CurrentAxes')
if expN==1, expAxes=ghandles.Iaxes1;end
if expN==2, expAxes=ghandles.Iaxes2;end
@@ -143,9 +134,10 @@ end
imshow(I)
set(expAxes,'xtick',[],'ytick',[])
DMstr= 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}))
DMstr=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}))
if expN==1,set(handles.DM1,'string',DMstr); end
if expN==2,set(handles.DM2,'string',DMstr); end
@@ -156,13 +148,13 @@ end
if expN==2,set(handles.tptTm2,'string',tPtStr); end
if expN==3,set(handles.tptTm3,'string',tPtStr); end
xp=char(Exp(expN).Dexp(DexpN).resDir);
if ispc
slashPos=strfind(char(Exp(expN).Dexp(DexpN).resDir),'\');
else
slashPos=strfind(char(Exp(expN).Dexp(DexpN).resDir),'/');
end
startPos=slashPos(length(slashPos)-2) +1;
endPos=(slashPos(length(slashPos)) -1);
expStrg=xp(startPos:end);
@@ -171,21 +163,15 @@ end
if expN==2,set(handles.expName2,'string',expStrg); end
if expN==3,set(handles.expName3,'string',expStrg); end
%********************
try
htMapTogPBfg=0;
EZhtMap %
EZhtMap
catch
end
%********************
%********************************************************************
% zonePB handle control from left graph spot side to communicate to right side 23_0818
% This section was based on the zoneRad Section for Radiobuttons which were
% unusable with the new form of Radio Buttons in AppDesigner.
%********************
if expN==1
zonesel=1;
zonePB=1;
@@ -195,8 +181,6 @@ if expN==1
set(handles.zonePB1,'BackgroundColor',[1.0 0.6 0.6])
set(handles.zonePB2,'BackgroundColor',[1.0 1.0 1.0])
set(handles.zonePB3,'BackgroundColor',[1.0 1.0 1.0])
orfLstSel=get(handles.GeneOrfTog,'value');
if orfLstSel==1
set(handles.listboxGnOrf,'string',Exp(1).Dexp(DexpN).srtOrfLst)
@@ -214,7 +198,6 @@ if expN==2
set(handles.zonePB2,'BackgroundColor',[1.0 0.6 0.6])
set(handles.zonePB1,'BackgroundColor',[1.0 1.0 1.0])
set(handles.zonePB3,'BackgroundColor',[1.0 1.0 1.0])
orfLstSel=get(handles.GeneOrfTog,'value');
if orfLstSel==1
set(handles.listboxGnOrf,'string',Exp(2).Dexp(DexpN).srtOrfLst)
@@ -232,7 +215,6 @@ if expN==3
set(handles.zonePB3,'BackgroundColor',[1.0 0.6 0.6]);
set(handles.zonePB1,'BackgroundColor',[1.0 1.0 1.0]);
set(handles.zonePB2,'BackgroundColor',[1.0 1.0 1.0]);
orfLstSel=get(handles.GeneOrfTog,'value');
if orfLstSel==1
set(handles.listboxGnOrf,'string',Exp(3).Dexp(DexpN).srtOrfLst)

View File

@@ -56,8 +56,7 @@ if AddCplot==1,
end
end
end
%for n= 1:length(RFcmpTraces +1)
%end
maxLstd=max(std(mlstL), maxRFcmpLStd);
maxKstd=max(std(mlstK), maxRFcmpKStd);
maxrstd=max(std(mlstR), maxRFcmprStd);
@@ -65,10 +64,7 @@ if AddCplot==1,
Exp(expN).cRmean(cTraceN)=mean(mlstR); Exp(expN).cKstd(cTraceN)=maxKstd; %std(mlstR);
Exp(expN).cKmean(cTraceN)=mean(mlstK); Exp(expN).cRstd(cTraceN)=maxrstd; %std(mlstK);
%******MEAN calculation Plot********************
%try
% Mean calculation plot
l=Exp(expN).cLmean(cTraceN);
r=Exp(expN).cRmean(cTraceN);
K=Exp(expN).cKmean(cTraceN);
@@ -80,17 +76,16 @@ if AddCplot==1,
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 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
Exp(expN).hCmean(cTraceN)=plot(OLaxes,t,g);hold on; % plot the composit mean of traces
Exp(expN).hBound1(cTraceN)=plot(OLaxes,t,gSlow,'y');
Exp(expN).hBound2(cTraceN)=plot(OLaxes,t,gFast,'y');
%c1=c1-((cTraceN-1)*0.2); c2=c2+((cTraceN-1)*0.2); c3=c3+((cTraceN-1)*0.2);
set(Exp(expN).hCmean(cTraceN),'color',colour) %[c1 c2 c3]) %Set latest trace red
set(Exp(expN).hCmean(cTraceN),'linewidth',3)
%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Lstr=num2str(Exp(expN).cLmean(cTraceN)); Lsstr=num2str(Exp(expN).cLstd(cTraceN));
Rstr=num2str(Exp(expN).cRmean(cTraceN)); Rsstr=num2str(Exp(expN).cRstd(cTraceN));
Kstr=num2str(Exp(expN).cKmean(cTraceN)); Ksstr=num2str(Exp(expN).cKstd(cTraceN));
@@ -99,9 +94,11 @@ try
cPlotLB=strcat('Composite', num2str(cTraceN),'->','L=',Lstr(1:4),';','Ls=',Lsstr(1:4),';',...
'r=',Rstr(1:4),';','rs=',Rsstr(2:6),';','K=',Kstr(1:4),';','Ks=',Ksstr(1:4))
catch
try cPlotLB= strcat('Composite', num2str(cTraceN),'->','L=',Lstr(1:4),';','r=',Rstr(1:4),';','K=',Kstr(1:4),'-SingleSource'); catch, end
try
cPlotLB=strcat('Composite', num2str(cTraceN),'->','L=',Lstr(1:4),';','r=',Rstr(1:4),';','K=',Kstr(1:4),'-SingleSource');
catch
end
end
%}
Exp(expN).cName(cTraceN)={cPlotLB};
if expN==1, set(ghandles.OLay1,'string', cPlotLB); end
@@ -111,19 +108,15 @@ if expN==3, set(ghandles.OLay3,'string', cPlotLB); end
% Hide source traces leaving only the Composite traces and STD traces
for i=1:length(Exp(expN).hOL)
set(Exp(expN).hOL(i),'Visible','off')
try set(Exp(expN).hOLb(i),'Visible','off'); catch, msg= 'No raw data RFcmp'; end
try set(Exp(expN).hOLb(i),'Visible','off')
catch
msg='No raw data RFcmp'
end
end
% Increment the CompositeTrace count and update the correlated reference OLAY cTraceIndx
Exp(expN).cTraceN=(Exp(expN).cTraceN) + 1 ;
Exp(expN).cTraceIndx(Exp(expN).cTraceN)=length(Exp(expN).hOL(:))+1;
%cPlotLB=strcat('Composite', num2str(cTraceN),'L=',num2str(Exp(expN).cLmean(cTraceN)),'Ls=',num2str(Exp(expN).cLstd(cTraceN))) %,'-',(Exp(expN).hOLname(cTraceIndx)))
%Exp(expN).cName(cTraceN)={cPlotLB};

View File

@@ -23,11 +23,9 @@ if EZdatatip==1 %adaptation for image spot selection
if zoneSel==1,Dlaxes=ghandles.Dlaxes1;Dkaxes=ghandles.Dkaxes1;Draxes=ghandles.Draxes1; end
if zoneSel==2,Dlaxes=ghandles.Dlaxes2;Dkaxes=ghandles.Dkaxes2;Draxes=ghandles.Draxes2; end
if zoneSel==3,Dlaxes=ghandles.Dlaxes3;Dkaxes=ghandles.Dkaxes3;Draxes=ghandles.Draxes3; end
if zoneSel==1,DNLaxes=ghandles.DNLaxes1;end
if zoneSel==2,DNLaxes=ghandles.DNLaxes2;end
if zoneSel==3,DNLaxes=ghandles.DNLaxes3;end
elseif EZdatatip==2 % adaption for Overlay plot selection
% destPerMP=Exp(expN).Dexp(DexpN).destPerMP;
MPlateN=ceil(OLplateNum/destPerMP);
@@ -40,7 +38,6 @@ elseif EZdatatip==2 %adaption for Overlay plot selection
if zoneSel==1,DNLaxes=ghandles.DNLaxes1;end %2016_0222
if zoneSel==2,DNLaxes=ghandles.DNLaxes2;end %2016_0222
if zoneSel==3,DNLaxes=ghandles.DNLaxes3;end %2016_0222
elseif EZdatatip==0
if lstBoxCmpFlg~=1
DexpN=Exp(expN).DexpN;
@@ -55,8 +52,6 @@ elseif EZdatatip==0
Lbl=cell2mat(selGnOrf);
if ~isempty(strfind(Lbl,'RF')) && ~isempty(strfind(Lbl,'md'))
strLoc=strfind(Lbl,'md');
MPloc=strfind(Lbl,':');
dMP=str2double(Lbl((MPloc(1)+1):(MPloc(2)-1)));
if strcmp(Lbl(strLoc:strLoc+3),'-mdG(');
@@ -74,7 +69,6 @@ elseif EZdatatip==0
end % if EZdatatip==1 %adaptation for image spot selection
if EZdatatip==2 % Response to Overlay click
%++++++++++++++++++++LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL+++++++++++++++++++++++
% seltraceN comes from EZvDatatip;
% Exp(OLay).seltraceN iscaptured from EZvDatatip
% if an OLay trace is selected
@@ -96,8 +90,7 @@ if EZdatatip==2 %Response to Overlay click
catch, end
if zoneSel==1,set(ghandles.DNLaxes1,'xlim',[-75,75]); end
%++++++++++++++++++++++KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK++++++++++++++++++++++
for J=1:(tracN),
for J=1:(tracN)
try
set(Exp(zoneSel).hKRF1(J),'visible','off'); set(Exp(zoneSel).hKRF2(J),'visible','off');
catch, end
@@ -111,7 +104,7 @@ if EZdatatip==2 %Response to Overlay click
try
set(Exp(zoneSel).hK(seltraceN),'visible','on'); set(Exp(zoneSel).hKb(seltraceN),'visible','on');
catch, end
%+++++++++++++++++++++rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr+++++++++++++++++++++++++++++
for J=1:(tracN),
try
set(Exp(zoneSel).hrRF1(J),'visible','off'); set(Exp(zoneSel).hrRF2(J),'visible','off');
@@ -126,11 +119,9 @@ if EZdatatip==2 %Response to Overlay click
try
set(Exp(zoneSel).hr(seltraceN),'visible','on'); set(Exp(zoneSel).hrb(seltraceN),'visible','on');
catch, end
else %if EZdatatip==1 or if EZdatatip==0 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%*************Plot RFmd1 and RFmd2 indexes*********************
else
% Plot RFmd1 and RFmd2 indexes
if EZdatatip==0
end
%if ~exist(RFmdFlg)
RF1mdIndx=Exp(zoneSel).Dexp(DexpN).RFmd1indx;
@@ -149,7 +140,7 @@ if lstBoxCmpFlg~= 1
Exp(zoneSel).seltraceN=tracN;
seltraceN=tracN;
end
%**************Plot L K r for all pertibation(destination) Plates***************
% Plot L K r for all pertibation(destination) Plates
if lstBoxCmpFlg~=1 % If selection is a "normal" item with a location in the label
try RF1mdNums=(RF1mdPltN-1)*destPerMP + (1:destPerMP); catch, end %RF1mdPltN %
try RF2mdNums=(RF2mdPltN-1)*destPerMP + (1:destPerMP); catch, end %RF2mdPltN %
@@ -163,7 +154,6 @@ if lstBoxCmpFlg~= 1 % If selection is a "normal" item with a location in the lab
if lvals(I)==0, lvals(I)=140; end
kvals(I)=scan(1,plNums(I)).plate(1).CFout(indx,3);
rvals(I)=scan(1,plNums(I)).plate(1).CFout(indx,4);
Exp(expN).Trace(tracN).Dexp(DexpN).DM(I).UsrLvals=lvals(I);
Exp(expN).Trace(tracN).Dexp(DexpN).DM(I).UsrKvals=kvals(I);
Exp(expN).Trace(tracN).Dexp(DexpN).DM(I).Usrrvals=rvals(I);
@@ -172,7 +162,6 @@ if lstBoxCmpFlg~= 1 % If selection is a "normal" item with a location in the lab
if lvals(I)==0, lvals(I)=140; end
kvals(I)=Exp(expN).Dexp(DexpN).RFcmpGK.dm(I).med;
rvals(I)=Exp(expN).Dexp(DexpN).RFcmpGr.dm(I).med;
Exp(expN).Trace(tracN).Dexp(DexpN).DM(I).UsrLvals=lvals(I);
Exp(expN).Trace(tracN).Dexp(DexpN).DM(I).UsrKvals=kvals(I);
Exp(expN).Trace(tracN).Dexp(DexpN).DM(I).Usrrvals=rvals(I);
@@ -181,7 +170,6 @@ if lstBoxCmpFlg~= 1 % If selection is a "normal" item with a location in the lab
if lvals(I)==0, lvals(I)=140; end
kvals(I)=scan(1,plNums(I)).plate(1).CFout(indx,3); %No P med.Kvals /dms currently avail.
rvals(I)=scan(1,plNums(I)).plate(1).CFout(indx,4); %No P med.rvals /dms currently avail.
Exp(expN).Trace(tracN).Dexp(DexpN).DM(I).UsrLvals=lvals(I);
Exp(expN).Trace(tracN).Dexp(DexpN).DM(I).UsrKvals=kvals(I);
Exp(expN).Trace(tracN).Dexp(DexpN).DM(I).Usrrvals=rvals(I);
@@ -190,20 +178,16 @@ if lstBoxCmpFlg~= 1 % If selection is a "normal" item with a location in the lab
if lvals(I)==0, lvals(I)=140; end
kvals(I)=scan(1,plNums(I)).plate(1).CFout(indx,3); %No P med.Kvals /dms currently avail.
rvals(I)=scan(1,plNums(I)).plate(1).CFout(indx,4); %No P med.rvals /dms currently avail.
Exp(expN).Trace(tracN).Dexp(DexpN).DM(I).UsrLvals=lvals(I);
Exp(expN).Trace(tracN).Dexp(DexpN).DM(I).UsrKvals=kvals(I);
Exp(expN).Trace(tracN).Dexp(DexpN).DM(I).Usrrvals=rvals(I);
end
elseif CompositeTrendFlg==1 && EZdatatip==0 %Gene-Specifics Composite from listBox
lvals(I)=median(cell2mat(Exp(expN).Trace(tracN).Dexp(DexpN).DM(I).UsrLvals));
if lvals(I)==0, lvals(I)=140; end
kvals(I)=median(cell2mat(Exp(expN).Trace(tracN).Dexp(DexpN).DM(I).UsrKvals));
rvals(I)=median(cell2mat(Exp(expN).Trace(tracN).Dexp(DexpN).DM(I).Usrrvals));
end %if CompositeTrendFlg==0 || EZdatatip==1
end
try
if ~isempty(RF1mdIndx)
lvalsRF1md(I)=scan(1,RF1mdNums(I)).plate(1).CFout(RF1mdIndx(I),5);
@@ -218,7 +202,6 @@ if lstBoxCmpFlg~= 1 % If selection is a "normal" item with a location in the lab
end
catch
end
try
lvalsRF2md(I)=scan(1,RF2mdNums(I)).plate(1).CFout(RF2mdIndx(I),5);
if lvalsRF2md(I)==0, lvalsRF2md(I)=140; end
@@ -226,8 +209,6 @@ if lstBoxCmpFlg~= 1 % If selection is a "normal" item with a location in the lab
rvalsRF2md(I)=scan(1,RF2mdNums(I)).plate(1).CFout(RF2mdIndx(I),4);
catch
end
% Added for INTERACTION Calculating Utility 2016_0219
try
if CompositeTrendFlg==0 || EZdatatip==1
@@ -247,14 +228,10 @@ if lstBoxCmpFlg~= 1 % If selection is a "normal" item with a location in the lab
else
deltaXR(I)=Xhn(I)-(Rn(I)-Rs(I));
end
catch
msg='No Refs! ->No Interaction Calculations!'
end
end %for I=1:length(plNums)
end
elseif lstBoxCmpFlg==1 %Determine values of RF1cmp or RFcmpG or RFcmpP composites
for dm=1:destPerMP
if RFcmpGFlg==0 %RF1cmp or RF2cmp clicked
@@ -268,13 +245,11 @@ elseif lstBoxCmpFlg==1 %Determine values of RF1cmp or RFcmpG or RFcmpP composit
kvals(dm)=Exp(expN).Dexp(DexpN).RFcmpGK.dm(inDM).med; %Ks=num2str(K);
rvals(dm)=Exp(expN).Dexp(DexpN).RFcmpGr.dm(inDM).med; %rs=num2str(r);
end
% Added for INTERACTION Calculating Utility 2016_0219
try
Xn(dm)=lvals(dm);
Xln(dm)=lvals(dm)- Exp(expN).Dexp(DexpN).RFcmpL(RFnum).dm(inDM).std ;
Xhn(dm)=lvals(dm)+ Exp(expN).Dexp(DexpN).RFcmpL(RFnum).dm(inDM).std;
if Xn(dm)==0, deltaXR(dm)=140; end
if isnan(Xhn(dm))||isnan(Xln(dm))|| Xhn(dm)==0||Xln(dm)==0||isnan(Rs(dm))
deltaXR(dm)=140;
@@ -283,21 +258,16 @@ elseif lstBoxCmpFlg==1 %Determine values of RF1cmp or RFcmpG or RFcmpP composit
else
deltaXR(dm)=Xhn(dm)-(Rn(dm)-Rs(dm));
end
catch
msg='No Refs! ->No Interaction Calculations!'
end
end % for dm=1:destPerMP
Exp(expN).Trace(traceN).UsrGLB=selGnOrf; %Added 18_0118 for tickLabelStr issue in EZfigTrendOL.m assoc'd with RFcmpG(-)
end
end %if lstBoxCmpFlg==1
%***********INTERACTION Plotting Utility 2016_0219*********************************************
% INTERACTION Plotting Utility 2016_021
try
if Rn(1)==0, % If Ref mean is zero
if Rn(1)==0 % if Ref mean is zero
intL=0; proGrIntL=0; intLadj=0; proGrIntLadj=0;
intNormL=6.66;intNormLadj=6.66; proGrIntNormL=6.66;proGrIntNormLadj=6.66;
else
@@ -305,9 +275,7 @@ else
intL=(Xn-Rn);
intL(Xn==0)=140;
intLadj=(deltaXR);
Exp(expN).Trace(tracN).Dexp(DexpN).UsrIntL=intL;
%{
intNormL=(intL) ./ Rn(1)
intNormLadj=((deltaXR)./ Rn(1))
@@ -326,25 +294,21 @@ catch
FailMessage='Problem with Reference Rn value; Unable to produce Interaction values! Ln119 EZdestComp'
end
hidem(ghandles.Daxes1)
if zoneSel==1,showm(ghandles.Dlaxes1);showm(ghandles.Dkaxes1);showm(ghandles.Draxes1);end
if zoneSel==2,showm(ghandles.Dlaxes2);showm(ghandles.Dkaxes2);showm(ghandles.Draxes2);end
if zoneSel==3,showm(ghandles.Dlaxes3);showm(ghandles.Dkaxes3);showm(ghandles.Draxes3);end
set(Dlaxes,'NextPlot','add'); set(Dkaxes,'NextPlot','add'); set(Draxes,'NextPlot','add')
if zoneSel==1,showm(ghandles.DNLaxes1); end
if zoneSel==2,showm(ghandles.DNLaxes2); end
if zoneSel==3,showm(ghandles.DNLaxes3); end
set(DNLaxes,'NextPlot','add');
%+++++++++++++++++LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL+++++++++++++++++++++++++++++++++
% Make visible the current L plot and store it for retrieval by OLay code
if verLessThan('matlab','8.4')
else % accomodate new matlab changes after 2014a fix 23_0807
tempFig2=figure;
end
try %Some experiments do not have ref. plates
try % some experiments do not have ref. plates
Exp(zoneSel).hLRF1(tracN)=plot(Dlaxes,lvalsRF1md,1:destPerMP,'b'); hold on
catch
end
@@ -352,7 +316,6 @@ end
Exp(zoneSel).hLRF2(tracN)=plot(Dlaxes,lvalsRF2md,1:destPerMP,'c'); hold on
catch
end
try
Exp(zoneSel).hL(tracN)=plot(Dlaxes,lvals,1:destPerMP); Exp(zoneSel).hLb(tracN)=plot(Dlaxes,lvals,1:destPerMP,'rs');
catch
@@ -360,7 +323,6 @@ end
if zoneSel==1,set(ghandles.Dlaxes1,'xlim',[0,140]); end
if zoneSel==2,set(ghandles.Dlaxes2,'xlim',[0,140]); end
if zoneSel==3,set(ghandles.Dlaxes3,'xlim',[0,140]); end
%*************************************************
% Make visible Plot for Interaction Data, Store and Hide unless a N (InteractionPBsel) set that plot on Top of the RawData Plots.
% Plot new intL
try
@@ -368,56 +330,45 @@ end
% 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,
catch
end
if zoneSel==1,set(ghandles.DNLaxes1,'xlim',[-75,75]); end
if zoneSel==2,set(ghandles.DNLaxes2,'xlim',[-75,75]); end
if zoneSel==3,set(ghandles.DNLaxes3,'xlim',[-75,75]); end
% intNormL
% intNormLadj
%********************************************
% ProGrIntLadj Plot
% ProGrintLadj Plot
% ProGrintNormL
% proGrintNormLadj
%+++++++++++++++++KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK+++++++++++++++++++++++++++++++++++++++++++++++++++++++
% Hide all K plots
for J=1:(tracN-1),
try
set(Exp(zoneSel).hKRF1(J),'visible','off'); set(Exp(zoneSel).hKRF2(J),'visible','off');
catch, end
catch
end
try
set(Exp(zoneSel).hK(J),'visible','off'); set(Exp(zoneSel).hKb(J),'visible','off');
catch, end
catch
end
end
% Make visible the current L plot and store it for retrieval by OLay code
try %Some experiments do not have ref. plates
try % some experiments do not have ref. plates
Exp(zoneSel).hKRF1(tracN)=plot(Dkaxes,kvalsRF1md,1:destPerMP,'b');
Exp(zoneSel).hKRF2(tracN)=plot(Dkaxes,kvalsRF2md,1:destPerMP,'c');
catch, end
catch
end
try
Exp(zoneSel).hK(tracN)=plot(Dkaxes,kvals,1:destPerMP,'b'); Exp(zoneSel).hKb(tracN)=plot(Dkaxes,kvals,1:destPerMP,'rs');
catch, end
catch
end
set(Dkaxes,'xlim',[0,200]) % max(kvals+20)
set(Dkaxes,'ycolor',[.9,.9,1])
%++++++++++++++++++rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr+++++++++++++++++++++++++++++++++++++++++++++++
%Hide all r plots
% Hide all r plots
for J=1:(tracN-1),
try
set(Exp(zoneSel).hrRF1(J),'visible','off'); set(Exp(zoneSel).hrRF2(J),'visible','off');
@@ -426,6 +377,7 @@ end
set(Exp(zoneSel).hr(J),'visible','off'); set(Exp(zoneSel).hrb(J),'visible','off');
catch, end
end
% Make visible the current r plot and store it for retrieval by OLay code
try %Some experiments do not have ref. plates
Exp(zoneSel).hrRF1(tracN)=plot(Draxes,rvalsRF1md,1:destPerMP,'b');
@@ -436,24 +388,14 @@ end
catch, end
set(Draxes,'xlim',[0,1])
set(Draxes,'ycolor',[.9,.9,1])
end %if EZdatatip==2 Response to Overlay click
end
if zoneSel==1, set(ghandles.geneOrfLKr1,'string', grfgenestr);end
if zoneSel==2, set(ghandles.geneOrfLKr2,'string', grfgenestr);end
if zoneSel==3, set(ghandles.geneOrfLKr3,'string', grfgenestr);end
%*********************************************************************************************************************
%*********************************************************************************************************************
%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%___________________________________Display Selection PlotFilter ____________________
if Exp(4).interacPBsel==0 %00000000000000000000000000000
% Display Selection PlotFilter
if Exp(4).interacPBsel==0
% replace ghandles.DNLaxes1 (Dlaxes2)etc. with a single
% Exp(zoneSel).DNLaxes,....
set(ghandles.Dlaxes1,'Visible','on')
@@ -470,7 +412,6 @@ end %if EZdatatip==2 Response to Overlay click
try
set(Exp(zoneSel).hL(n),'visible','off'); set(Exp(zoneSel).hLb(n),'visible','off');
catch, end
try
set(Exp(zoneSel).hintL(n),'visible','off'); set(Exp(zoneSel).hintLb(n),'visible','off');
catch, end
@@ -488,10 +429,7 @@ end %if EZdatatip==2 Response to Overlay click
for i=1:Exp(zoneSel).expLoadCnt,
try set(Exp(zoneSel).hzeroCLn(i),'visible','off'); catch ME, end
end
elseif Exp(4).interacPBsel==1 %111111111111111111111111111
elseif Exp(4).interacPBsel==1
set(ghandles.DNLaxes1,'Visible','on')
set(ghandles.DNLaxes2,'Visible','on')
set(ghandles.DNLaxes3,'Visible','on')
@@ -512,45 +450,16 @@ end %if EZdatatip==2 Response to Overlay click
for i=1:Exp(zoneSel).expLoadCnt,
try set(Exp(zoneSel).hzeroCLn(i),'visible','on'); catch ME, end
end
elseif Exp(4).interacPBsel==2 %2222222222222222222222222222 TEMPorily Same as interacPBsel==1
% set(ghandles.DNLaxes1,'Visible','on')
%set(ghandles.Dlaxes1,'Visible','off')
end %if Exp(4).interacPBsel==0
elseif Exp(4).interacPBsel==2
end
if verLessThan('matlab','8.4')
else % accomodate new matlab changes after 2014a fix update 23_0807
close(tempFig2)
end
%------------------------------------------------------------------------------------------------------------
%=====================================================================================================================
%end %if isempty(msg)
%BONEYARD BONEYARD BONEYARD BONEYARD BONEYARD BONEYARD BONEYARD BONEYARD BONEYARD
%*********************************************************************************
% Deprecated functions
%{
for J=1:(tracN),

View File

@@ -7,7 +7,7 @@ ln=1;
fprintf(fid,'%d\t',ln);
fprintf(fid,'%s\ExpName:::','Reference Diagnostic Values');
%will need to reverse the equals pulling data from the Exp source as needed
% Will need to reverse the equals pulling data from the Exp source as needed
% to populate the printout diagnostice sheet.
for d=1:DMnum
fprintf(fid,'RF Name\Median\Mean\STD\Max\Min');
@@ -36,10 +36,7 @@ for d=1:DMnum
RFmeanG=Exp(expN).minG(d,dMPs(mm));
maxG= Exp(expN).maxG(d,dMPs(mm));
minG= Exp(expN).minG(d,dMPs(mm));
end %for d=1:DMnum
end
for mm=1:length(dMPs)
for d=1:DMnum
@@ -51,10 +48,8 @@ for mm=1:length(dMPs)
mean1Disp= Exp(expN).meanP(d,dMPs(mm));
minDisp= Exp(expN).minP(d,dMPs(mm));
maxDisp= Exp(expN).maxP(d,dMPs(mm));
end %for d=1:DMnum
end %for mm=1:length(dMPs)
end
end
%{
RFcombValList= cat(1,medValList1{d+1},medValList2{d+1});
@@ -65,11 +60,4 @@ end %for mm=1:length(dMPs)
%}
fclose(fid)

View File

@@ -105,7 +105,7 @@ Exp(expN).Dexp(1).srtGnLst={('CheckMP/MPDMfile')};
Exp(expN).Dexp(1).srtOrfLst={('CheckMP/MPDMfile')};
set(handles.listboxGnOrf,'value',1) %Fix accomodation for bug in App Designer .. .wlapp converter 230906
set(handles.listboxGnOrf,'string',cellstr([{'Failed To Load'}; {' '}]));
%try
ExpOutmat=fullfile(scansDir,openExpfile);
load(ExpOutmat);
cd(scansDir)
@@ -113,7 +113,7 @@ set(handles.listboxGnOrf,'string',cellstr([{'Failed To Load'}; {' '}]));
resDir=pwd;
Exp(expN).Dexp(1).resDir=resDir;
cd ..;
try %This try-catch is to go up one more dir if the images aren't found (from /OtherResults)
try % this try-catch is to go up one more dir if the images aren't found (from /OtherResults)
test4imageDir=imread(fullfile(pwd,'1','1.bmp'));
ExpPath=pwd;
Exp(expN).Dexp(1).ExpFoldr=ExpPath;
@@ -128,7 +128,8 @@ set(handles.listboxGnOrf,'string',cellstr([{'Failed To Load'}; {' '}]));
end
end
cd(w)
%Experiment LOADs
% Experiment Loads
% load (fullfile(ExpFoldr,'MasterPlateFiles','MPDMmat.mat'))
load(fullfile(Exp(expN).Dexp(1).ExpFoldr,'MasterPlateFiles','MPDMmat.mat'))
load(fullfile(resDir,'Fotos','Coordinates'))
@@ -157,8 +158,6 @@ Exp(expN).Dexp(1).ImParMat=Exp(expN).Dexp(1).temp.ImParMat;
Exp(expN).DexpLength=1;
Exp(expN).Dexp((Exp(expN).DexpLength+1):end)=[];
% Load new ExpJob
if expN==1,
% Exp(1).traceN=0;
@@ -226,7 +225,6 @@ DMnum= length(Exp(expN).Dexp(1).DM.drug);
set(handles.DMsldr3,'min',1,'max',DMnum)
tPtsSize=size(Exp(expN).Dexp(1).FexpScanBMtp{1,1},(3));
set(handles.Tptsldr3,'min',1,'max',tPtsSize)
set(handles.MPsldr3,'value',1)
set(handles.DMsldr3,'value',1)
set(handles.Tptsldr3,'value',1)
@@ -241,15 +239,18 @@ set(handles.DN3,'value',1)
set(handles.DN3,'string',1)
end
if expN==1,set(handles.GeneOrfLoc1,'string',{''});
if expN==1,
set(handles.GeneOrfLoc1,'string',{''});
set(handles.graphStrLoc1,'string',{''});
cla(handles.Paxes1)
cla(handles.Paxes1);
end
if expN==2,set(handles.GeneOrfLoc2,'string',{''});
if expN==2
set(handles.GeneOrfLoc2,'string',{''});
set(handles.graphStrLoc2,'string',{''});
cla(handles.Paxes2)
end
if expN==3,set(handles.GeneOrfLoc3,'string',{''});
if expN==3
set(handles.GeneOrfLoc3,'string',{''});
set(handles.graphStrLoc3,'string',{''})
cla(handles.Paxes3)
end
@@ -258,7 +259,6 @@ Exp(expN).Dexp(1).srtOrfLst={('CheckMP/MPDMfile')};
set(handles.listboxGnOrf,'string',Exp(expN).Dexp(1).srtGnLst)
set(handles.listboxGnOrf,'string',Exp(expN).Dexp(1).srtOrfLst)
EZVimDisplay
% Capture Exp Name
@@ -279,26 +279,25 @@ catch
catchissue='Ln198'
end % nested try-catch-end
% Compile GeneList and OrfList
% Sort and add the medians of Ref Plates if RF1,RF2 exist
% Added 17-1023 For User Addition of Gene Composites to ListBox
Expaa{expN,1}= []; Expbb{expN,1}= [];
Expaa{expN,1}=[];
Expbb{expN,1}=[];
lstindx=0;
lstindxOrf=0;
spN=0;
rfcnt=0;
dRF1indx=0;
RF1mp=[]; RF2mp=[];
RF1mp=[];
RF2mp=[];
for mp=1:MPnum % length(Exp(expN).Dexp(1).MP)
for ind384=1:384
spN=spN+1;
try % Temp find data error
r=ceil(ind384/24);
if rem(ind384,24)==0, c=24; else c=rem(ind384,24); end
% 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(1).MP(mp).genename{1}(ind384))==38991,
@@ -306,7 +305,7 @@ for mp=1:MPnum %length(Exp(expN).Dexp(1).MP)
elseif isnumeric(cell2mat(Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)))
Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)={' '};
end
%****Check for full(384spot) Reference Plates (RF1 or/and RF2)**************
% Check for full(384spot) Reference Plates (RF1 or/and RF2)
RF1fullPlate=0;
try RF1fullPlate=sum(ismember((Exp(expN).Dexp(1).MP(mp).genename{1}),'RF1'))==384; catch, mp, msg=strcat(num2str(mp),' genename ERROR'), end
RF2fullPlate=0;
@@ -321,7 +320,6 @@ for mp=1:MPnum %length(Exp(expN).Dexp(1).MP)
&& (~strcmpi((Exp(expN).Dexp(1).MP(mp).orf{1}(ind384)),'RF1'))... %||~strcmpi((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),'RF1'))... %&& mp==1)...
&& (~strcmpi((Exp(expN).Dexp(1).MP(mp).orf{1}(ind384)),'RF2'))... %||~strcmpi((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),'RF2'))... %&& mp==length(Exp(expN).Dexp(1).MP))...
&& iscellstr((Exp(expN).Dexp(1).MP(mp).orf{1}(ind384)))
lstindxOrf=lstindxOrf+1;
Exp(expN).Dexp(1).MP(mp).orf{1}(ind384)=strrep((Exp(expN).Dexp(1).MP(mp).orf{1}(ind384)),':',' ');
bb(lstindxOrf,1)=(Exp(expN).Dexp(1).MP(mp).orf{1}(ind384));
@@ -329,7 +327,6 @@ for mp=1:MPnum %length(Exp(expN).Dexp(1).MP)
bb(lstindxOrf,3)={mp};
bb(lstindxOrf,4)={r};
bb(lstindxOrf,5)={c};
mutorfs(lstindxOrf)=spN; %16_0318 added for Interaction EZinteract
%Exp(expN).Dexp(1).mutSpotIndx(lstindxOrf)=spN; %16_0318 added for Interaction EZinteract
end
@@ -343,7 +340,6 @@ for mp=1:MPnum %length(Exp(expN).Dexp(1).MP)
&& (~strcmpi((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),'RF1'))... %&& ~RF1fullPlate)...
&& (~strcmpi((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),'RF2'))... %&& ~RF2fullPlate)...
&& iscellstr((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)))
lstindx=lstindx+1;
Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)=strrep((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),':',' ');
aa(lstindx,1)=(Exp(expN).Dexp(1).MP(mp).genename{1}(ind384));
@@ -351,30 +347,24 @@ for mp=1:MPnum %length(Exp(expN).Dexp(1).MP)
aa(lstindx,3)={mp};
aa(lstindx,4)={r};
aa(lstindx,5)={c};
mutgenes(lstindx)=spN;
elseif (RF1fullPlate==1 ||... %sum(ismember((Exp(expN).Dexp(1).MP(mp).genename{1}),'RF1'))==384 || ...
(((length(unique(Exp(expN).Dexp(1).MP(mp).genename{1}(1:384)))) ==1 && mp==1 ) && ... %(isequal((Exp(expN).Dexp(1).MP(mp).genename{1}(1:384)), (Exp(expN).Dexp(1).MP(mp).genename{1}(384:-1:1)))&& mp==1 )) && ...
~exist('RF1scanN','var')))
elseif (RF1fullPlate==1 ... % sum(ismember((Exp(expN).Dexp(1).MP(mp).genename{1}),'RF1'))==384 || ...
|| (((length(unique(Exp(expN).Dexp(1).MP(mp).genename{1}(1:384))))==1 && mp==1 ) ... %(isequal((Exp(expN).Dexp(1).MP(mp).genename{1}(1:384)), (Exp(expN).Dexp(1).MP(mp).genename{1}(384:-1:1)))&& mp==1 )) && ...
&& ~exist('RF1scanN','var')))
rfcnt=rfcnt+1;
RFs(spN:spN+383)=spN:spN+383;
RF1mp=mp
RF1scanN=(mp*DMnum)-(DMnum-1)
elseif (RF2fullPlate==1||... % sum(ismember((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),'RF2'))==384 ||...
(((length(unique(Exp(expN).Dexp(1).MP(mp).genename{1}(1:384)))) ==1 && mp== MPnum ) && ...
~exist('RF2scanN','var')))
(((length(unique(Exp(expN).Dexp(1).MP(mp).genename{1}(1:384))))==1 && mp==MPnum ) ...
&& ~exist('RF2scanN','var')))
rfcnt=rfcnt+1;
RFs(spN:spN+383)=spN:spN+383;
RF2mp=mp
RF2scanN=(mp*DMnum)-(DMnum-1)
% Dispersed Reference capture and find Medians
elseif strcmpi((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),'RF1') && ...
(RF1fullPlate~=1)
elseif strcmpi((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),'RF1') ...
&& (RF1fullPlate~=1)
dRF1indx=dRF1indx+1;
Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)=strrep((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),':',' ');
drf(dRF1indx,1)=(Exp(expN).Dexp(1).MP(mp).genename{1}(ind384));
@@ -383,20 +373,17 @@ for mp=1:MPnum %length(Exp(expN).Dexp(1).MP)
drf(dRF1indx,4)={r}; drfr(dRF1indx,mp)=r;
drf(dRF1indx,5)={c}; drfc(dRF1indx,mp)=c;
drf(dRF1indx,6)={ind384}; drfPindx(dRF1indx,mp)=ind384;
end %if isempty(regexpi(char((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384))),'blank'))...
%*******************************************************************************
end
catch
error='EZexpSel lineAfter 236 EZexpSel.m'
mp
ind384
msgBadGeneName=strcat('check genename at mp=',num2str(mp),' indx=',num2str(ind384))
end
end %end associated with for ind384=1:384
end
mp
end %end associated with for mp=1:length(Exp(expN).Dexp(1).MP)
%*****************************************************
end
% Cover case if mutorfs RFs are labeled RF1 or RF2
try
Exp(expN).Dexp(1).mutSpotIndx.wRFs=union(RFs, mutorfs);
@@ -411,11 +398,6 @@ end %end associated with for mp=1:length(Exp(expN).Dexp(1).MP)
msg='No RFs Found in Exp! woRFs'
end
%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Exp(expN).Dexp(1).RFmd1indx=[];
Exp(expN).Dexp(1).RFmd1LB={[]};
Exp(expN).Dexp(1).RFmd1pltN={};
@@ -424,7 +406,6 @@ Exp(expN).Dexp(1).mean1= [];
Exp(expN).Dexp(1).std1=[];
Exp(expN).Dexp(1).min1=[];
Exp(expN).Dexp(1).max1=[];
Exp(expN).Dexp(1).RFcmpK=[]; %For Ref Composite 17_1009
Exp(expN).Dexp(1).RFcmpr=[]; %For Ref Composite 17_1009
Exp(expN).Dexp(1).RFcmpL=[]; %For Ref Composite 17_1009
@@ -489,14 +470,14 @@ if exist('RF1scanN','var')
nonZeroIndx=[];
medValList=[];
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));
if isempty(nonZeroIndx), nonZeroCnt=0; medianIndx= nonZeroIndx;
else nonZeroCnt=length(nonZeroIndx);
if isempty(nonZeroIndx)
nonZeroCnt=0
medianIndx=nonZeroIndx;
else
nonZeroCnt=length(nonZeroIndx);
end
%
if ~isempty(nonZeroIndx) && mod(nonZeroCnt,2)==0, medianIndx=nonZeroIndx(1:nonZeroCnt-1); end
if ~isempty(nonZeroIndx) && mod(nonZeroCnt,2)~=0, medianIndx=nonZeroIndx; end
clear medValLst
@@ -509,10 +490,8 @@ if ~isempty(nonZeroIndx) && length(medianIndx) > (.15*384) %To calc. a median, m
max1=max(medValLst);
std1=std(medValLst);
mean1=mean(medValLst);
kValLst=Exp(expN).Dexp(1).scan(rf1scN).plate(1).CFout(medianIndx,3); %For Ref Composite 17_1009
rValLst=Exp(expN).Dexp(1).scan(rf1scN).plate(1).CFout(medianIndx,4); %For Ref Composite 17_1009
mval1=median(medValLst); %mval1=median(Exp(expN).Dexp(1).scan(RF1mps).plate(1).CFout(1:384,5)); %CFout(1:383,5));
RFmd1pos=find(mval1==(Exp(expN).Dexp(1).scan(rf1scN).plate(1).CFout(1:384,5)));
RFmd1loc(1)=ceil(RFmd1pos/24); %calc r value
@@ -530,7 +509,6 @@ aa(lstindx,1)= {strcat('RF1cmp(',num2str(d+1),')')};
aa(lstindx,2)={''};
bb(lstindxOrf,1)={strcat('RF1cmp(',num2str(d+1),')')};
bb(lstindxOrf,2)={''};
%*******************************************************
Exp(expN).Dexp(1).RFmd1LB(d+1)=strcat(aa(lstindx,1),aa(lstindx,2));
Exp(expN).Dexp(1).RFmd1indx(d+1)=RFmd1pos;
@@ -559,7 +537,6 @@ Exp(expN).Dexp(1).RFcmpr(1).dm(d+1).mean= mean(rValLst); %For Ref Composite 17_1
Exp(expN).Dexp(1).RFcmpr(1).dm(d+1).std=std(rValLst); %For Ref Composite 17_1009
Exp(expN).Dexp(1).RFcmpr(1).dm(d+1).min=min(rValLst); %For Ref Composite 17_1009
Exp(expN).Dexp(1).RFcmpr(1).dm(d+1).max=max(rValLst); %For Ref Composite 17_1009
else
% Need to set L r K values to zeros or pick the first spot with zeros
% Spot 1 could be other than zero as the median isn't calculated if
@@ -568,15 +545,14 @@ else
firstZero=find(((Exp(expN).Dexp(1).scan(rf1scN).plate(1).CFout(1:384,5))==0),1,'first')
Exp(expN).Dexp(1).RFmd1indx(d+1)=firstZero;
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',
try
medValList1{d+1}=Exp(expN).Dexp(1).scan(rf1scN).plate(1).CFout(medianIndx,5); nonZeroCnt;
catch
catcherror='Ln356'
end
end % ~isempty(nonZeroIndx) && length(medianIndx) > (.15*384)
catch %try ~ln375
catch
medianCalcTryFailed1='Failed! Failed! Ln362 But process continued with bogus P1ind384 spot value!'
try
firstZero=find(((Exp(expN).Dexp(1).scan(rf1scN).plate(1).CFout(1:384,5))==0),1,'first')
Exp(expN).Dexp(1).RFmd1indx(d+1)=firstZero;
@@ -590,49 +566,40 @@ catch %try ~ln375
catchissue='Ln372'
Exp(expN).Dexp(1).RFmd1pltN=1;
end
end
end
end
error='EZexpSel lineAfter 258'
end %try ~ln375
end %for d=0:DMnum
end % if exist('RF1scanN','var')
%**********************************************************************************
%Calc RF2 median if a full plate of RF2s exist**************************
% Calc RF2 median if a full plate of RF2s exist
Exp(expN).Dexp(1).RFmd2indx=[];
Exp(expN).Dexp(1).RFmd2pltN=[];
if exist('RF2scanN','var')
for d=0:(DMnum-1)
medianIndx2=[];
nonZeroIndx2=[];
medValList2=[];
rf2scN=RF2scanN+d;
try % if RF2scanN doesn't exist this addition to list will be skipped
nonZeroIndx2=find(Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(1:384,5));
if isempty(nonZeroIndx2), nonZeroCnt2=0; medianIndx2= nonZeroIndx2;
if isempty(nonZeroIndx2)
nonZeroCnt2=0
medianIndx2=nonZeroIndx2;
else nonZeroCnt2=length(nonZeroIndx2);
end
%
if ~isempty(nonZeroIndx2) && mod(nonZeroCnt2,2)==0, medianIndx2=nonZeroIndx2(1:nonZeroCnt2-1); end
if ~isempty(nonZeroIndx2) && mod(nonZeroCnt2,2)~=0, medianIndx2=nonZeroIndx2; end
clear medValLst2
clear kValLst2
clear rValLst2
if ~isempty(nonZeroIndx2) && length(medianIndx2) > (.15*384) %To calc. a median, more than 15% of spots must be nonZero
if ~isempty(nonZeroIndx2) && length(medianIndx2) > (.15*384) % to calc. a median, more than 15% of spots must be nonZero
medValLst2=Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(medianIndx2,5);
medValList2{d+1}=medValLst2;
min2=min(medValLst2);
max2=max(medValLst2);
std2=std(medValLst2);
mean2=mean(medValLst2);
kValLst2= Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(medianIndx2,3); %For Ref Composite 17_1009
rValLst2= Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(medianIndx2,4); %For Ref Composite 17_1009
kValLst2=Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(medianIndx2,3); % for Ref Composite 17_1009
rValLst2=Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(medianIndx2,4); % for Ref Composite 17_1009
mval2=median(medValLst2); %mval2=median(Exp(expN).Dexp(1).scan(RF2mps).plate(1).CFout(1:383,5));
RFmd2pos=find(mval2==(Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(1:384,5)));
RFmd2loc(1)=ceil(RFmd2pos/24); %calc r value
@@ -650,7 +617,6 @@ aa(lstindx,1)= {strcat('RF2cmp(',num2str(d+1),')')};
aa(lstindx,2)={''};
bb(lstindxOrf,1)={strcat('RF2cmp(',num2str(d+1),')')};
bb(lstindxOrf,2)={''};
Exp(expN).Dexp(1).RFmd2LB(d+1)=strcat(aa(lstindx,1),aa(lstindx,2));
Exp(expN).Dexp(1).RFmd2indx(d+1)=RFmd2pos;
Exp(expN).Dexp(1).RFmd2pltN=RF2mp;
@@ -678,7 +644,6 @@ Exp(expN).Dexp(1).RFcmpr(2).dm(d+1).mean= mean(rValLst2); %For Ref Composite 17_
Exp(expN).Dexp(1).RFcmpr(2).dm(d+1).std=std(rValLst2); %For Ref Composite 17_1009
Exp(expN).Dexp(1).RFcmpr(2).dm(d+1).min=min(rValLst2); %For Ref Composite 17_1009
Exp(expN).Dexp(1).RFcmpr(2).dm(d+1).max=max(rValLst); %For Ref Composite 17_1009
else
% Pick the first spot with zeros
% Use that position to satisfy and keep process OK
@@ -686,19 +651,14 @@ Exp(expN).Dexp(1).RFcmpr(2).dm(d+1).max= max(rValLst); %For Ref Composite 17_100
firstZero2=find(((Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(1:384,5))==0),1,'first')
Exp(expN).Dexp(1).RFmd2indx(d+1)=firstZero2;
Exp(expN).Dexp(1).RFmd2pltN=RF2mp;
try medValList2{d+1}=Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(medianIndx2,5); nonZeroCnt2; catch, catchissue='Ln431', end
end
catch
medianCalcTryFailed2='Failed! Failed! Ln436 No RF1median But process continued with bogus P1ind384 spot value!'
try
firstZero2=find(((Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(1:384,5))==0),1,'first');
Exp(expN).Dexp(1).RFmd2indx(d+1)=firstZero2;
catch
catchissue='Ln442'
Exp(expN).Dexp(1).RFmd2indx(d+1)=384; %if crapout,Then use spot384 as default to keep going
end
try
@@ -707,10 +667,7 @@ catch
catchissue='Ln448'
Exp(expN).Dexp(1).RFmd2pltN=1;
end
error='EZexpSel lineAfter 279'
end %if RF2scanN doesn't exist this addition to list will be skipped
end
clear RFcombValList
RFcombValList=cat(1,medValList1{d+1},medValList2{d+1});
Exp(expN).Dexp(1).RFmean(d+1)=mean(RFcombValList);
@@ -719,28 +676,22 @@ end %if RF2scanN doesn't exist this addition to list will be skipped
catch, Exp(expN).Dexp(1).RFmin(d+1)=0; end
try, Exp(expN).Dexp(1).RFmax(d+1)=max(RFcombValList);
catch, Exp(expN).Dexp(1).RFmax(d+1)=0; end
end %for d=0:DMnum ln446
end
elseif exist('RF1scanN','var')
Exp(expN).Dexp(1).RFmean=Exp(expN).Dexp(1).mean1;
Exp(expN).Dexp(1).RFstd=Exp(expN).Dexp(1).std1;
Exp(expN).Dexp(1).RFmin=Exp(expN).Dexp(1).min1;
Exp(expN).Dexp(1).RFmax=Exp(expN).Dexp(1).max1;
end %if exist('RF2scanN','var') ln445
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%*************************************************************************************************
%***********DISPERSE REFERENCE PLATES
% Disperse Reference Plates
Exp(expN).Dexp(1).RFmdPindx=[];
Exp(expN).Dexp(1).RFmdPpltN=[];
if exist('drf','var')
% Det. index of change from one MP to the next
i=2;
chgIndx(1)=1;
for j=1:length(drf(:,3))
if j>1
if cell2mat(drf(j,3))~=cell2mat(drf((j-1),3)), chgIndx(i)=j; i=i+1; end
end
@@ -749,27 +700,21 @@ chgIndx(length(chgIndx)+1)= length(drf)+1;
uu=zeros(size(drf,1),4);
uu(:,1:4)=cell2mat(drf(:,3:6))
vv=zeros(length(drf),DMnum);
%************************************
dMPs=unique(cell2mat(drf(:,3)));
%*****************************************
for mm=1:length(dMPs) % length(chgIndx)
for d=1:(DMnum)
medianIndxDisp=[];
NZrefIndxP=[];
nonZeroValsP=[];
medValLstDisp=[];
rf1scNdisp=((dMPs(mm)-1)*DMnum)+(d);
try % Determine the dispersed RFs median mean and std if such exist
NZrefIndxP=drfPindx((find(drfPindx(:,dMPs(mm)))),dMPs(mm)); %find(Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(drf(chgIndx(cI):chgIndx(cI+1)),5));
%vv=Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5);
vv(chgIndx(mm):(chgIndx(mm+1)-1),d)=Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5);
%For Global Ref Composite 17_1009 %**************************************************************************
%For Global Ref Composite 17_1009
vvK(chgIndx(mm):(chgIndx(mm+1)-1),d)=Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,3);
vvr(chgIndx(mm):(chgIndx(mm+1)-1),d)=Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,4);
%*****************************************************************************************************
nonZeroValsP=nonzeros(Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5));
std1Disp=std(nonZeroValsP);
mean1Disp=mean(nonZeroValsP);
@@ -779,13 +724,16 @@ try % Determine the dispersed RFs median mean and std if such exist
% MEDIAN Determination for PLATES with Dispersed RFs
% NZrefIndxP=NZrefIndxP %find(Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5));
if isempty(NZrefIndxP), nonZeroCntDisp=0, medianIndxDisp= NZrefIndxP;
else nonZeroCntDisp=length(NZrefIndxP);
if isempty(NZrefIndxP)
nonZeroCntDisp=0
medianIndxDisp=NZrefIndxP;
else
nonZeroCntDisp=length(NZrefIndxP);
end
if ~isempty(NZrefIndxP) && mod(nonZeroCntDisp,2)==0, medianIndxDisp=NZrefIndxP(1:nonZeroCntDisp-1); end
if ~isempty(NZrefIndxP) && mod(nonZeroCntDisp,2)~=0, medianIndxDisp=NZrefIndxP; end
if ~isempty(NZrefIndxP) && length(medianIndxDisp) > 3 %(.15*384) %To calc. a median, more than 15% of spots must be nonZero
if ~isempty(NZrefIndxP) && length(medianIndxDisp) > 3 %(.15*384) % to calc. a median, more than 15% of spots must be nonZero
medValLstDisp=Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(medianIndxDisp,5);
% medValList1Disp{d}=medValLstDisp;
mval1Disp=median(medValLstDisp); % mval1=median(Exp(expN).Dexp(1).scan(RF1mps).plate(1).CFout(1:384,5)); %CFout(1:383,5));
@@ -793,7 +741,6 @@ if ~isempty(NZrefIndxP) && length(medianIndxDisp) > 3 %(.15*384) %To calc. a med
RFmd1posD=NZrefIndxP(nonZeroMedPosIndx); % drfPindx((RFmd1posIndx),dMPs(mm));
RFmd1locD(1)=ceil(RFmd1posD/24); % calc r value
RFmd1locD(2)=RFmd1posD - ((RFmd1locD(1)-1)*24); % calc c value
lstindx=lstindx+1;
lstindxOrf=lstindxOrf+1;
aa(lstindx,1)={strcat('RF1mdP(',num2str(d),')')};
@@ -819,18 +766,14 @@ else
firstZeroD=drfPindx((firstZeroDindx),dMPs(mm));
Exp(expN).Dexp(1).RFmdPindx(d,dMPs(mm))=firstZeroD;
Exp(expN).Dexp(1).RFmdPpltN(d,dMPs(mm))=dMPs(mm); %RF1mp; %Is this supposed to be the MP number or the ScanPlate number???
end %~isempty(NZrefIndxP) && length(medianIndxDisp) > 3 ln584
catch %try ln565
end
catch
medianCalcTryFailed1D='Failed! Failed! Ln565 {Dispersed RF1s} "try" But process continued with bogus Plate spot value!'
try
firstZeroindxD=find(vv((chgIndx(d):chgIndx(d+1)-1),5)==0,1,'first');
firstZeroPindx=uu(firstZeroindxD,4);
Exp(expN).Dexp(1).RFmdPpltN(d,dMPs(mm))=dMPs(mm);
Exp(expN).Dexp(1).RFmdPindx(d,dMPs(mm))=firstZeroPindx;
catch
catchissue='try at Ln565'
Exp(expN).Dexp(1).RFmdPpltN(d,dMPs(mm))=dMPs(mm);
@@ -842,13 +785,11 @@ catch %try ln565
catchissue='Ln619'
Exp(expN).Dexp(1).RFmdPpltN=1; %This might keep from breaking BUT ???
end
error='EZexpSel lineAfter 565'
end %try ~ln565
end
end
end
end %for d=0:DMnum
end %for mm=1:length(dMPs)
%****************CALC. GLOBAL MEAN, STD, AND MEDIAN FOR DISTRIBUTED REFERENCES******************************************************************
% Calc. Global Mean, Std, And Median For Distributed References
uu=horzcat(uu,vv);
for d=1:DMnum
medianIndxG=[];
@@ -858,16 +799,15 @@ for d=1:DMnum
RFmeanG=mean(nonzeros(vv(:,d)));
RFstdG=std(nonzeros(vv(:,d)));
NZrfIndxG=find(vv(:,d)); % find(nonzeros(vv(:,d))); WWRONG FOR A WHILE!
if isempty(RFmeanG), nonZeroCntD=0, %medianIndxDisp= RFmeanG(d);
else nonZeroCntD= length(nonzeros(vv(:,d)));
if isempty(RFmeanG)
nonZeroCntD=0; % medianIndxDisp=RFmeanG(d);
else
nonZeroCntD=length(nonzeros(vv(:,d)));
end
% Calc. of median requires an odd number of indx items
if ~isempty(NZrfIndxG) && mod(nonZeroCntD,2)==0, medianIndxD=NZrfIndxG(1:(size(NZrfIndxG,1)-1)); end
if ~isempty(NZrfIndxG) && mod(nonZeroCntD,2)~=0, medianIndxD=NZrfIndxG(:); end
if ~isempty(NZrfIndxG) && length(medianIndxD) > (.15*size(drf,1)) %To calc. a median, more than 15% of spots must be nonZero
if ~isempty(NZrfIndxG) && length(medianIndxD) > (.15*size(drf,1)) % to calc. a median, more than 15% of spots must be nonZero
mvalsDG=median(vv(medianIndxD,d)); % (nonzeros(vv(:,d)));
nzPosIndxDG=find(mvalsDG==vv(:,d));
RFmdDGloc(d,1)=uu(nzPosIndxDG,1); % MP of distributedGlobal Median value
@@ -879,14 +819,13 @@ aa(lstindx,1)= {strcat('RF1mdG(',num2str(d),')')};
aa(lstindx,2)={strcat(':',num2str(RFmdDGloc(d,1)),':',num2str(RFmdDGloc(d,2)),':',num2str(RFmdDGloc(d,3)))}; %,'std_',num2str(std2))};
bb(lstindxOrf,1)={strcat('RF1mdG(',num2str(d),')')};
bb(lstindxOrf,2)={strcat(':',num2str(RFmdDGloc(d,1)),':',num2str(RFmdDGloc(d,2)),':',num2str(RFmdDGloc(d,3)))}; %,'std_',num2str(std2))};
%Composite Reference Amalgum Plot ******************
% Composite Reference Amalgum Plot
lstindx=lstindx+1;
lstindxOrf=lstindxOrf+1;
aa(lstindx,1)={strcat('RFcmpG(',num2str(d),')')};
aa(lstindx,2)={''};
bb(lstindxOrf,1)={strcat('RFcmpG(',num2str(d),')')};
bb(lstindxOrf,2)={''};
%*****************************************************
% Exp(expN).Dexp(1).RFmdGLvals=vv(medianIndxD,d); %17_1201 TrendOL
Exp(expN).Dexp(1).RFmdGLB(d)=strcat(aa(lstindx,1),aa(lstindx,2));
Exp(expN).Dexp(1).RFmdGindx(d)=nzPosIndxDG;
@@ -897,7 +836,6 @@ Exp(expN).Dexp(1).RFminG(d)= minG;
Exp(expN).Dexp(1).RFmaxG(d)=maxG;
Exp(expN).Dexp(1).RFstdG(d)=RFstdG;
Exp(expN).Dexp(1).RFmeanG(d)=RFmeanG;
Exp(expN).Dexp(1).RFcmpGL.dm(d).Lvals=vv(medianIndxD,d); %17_1201 TrendOL
Exp(expN).Dexp(1).RFcmpGL.dm(d).med=median(vv(medianIndxD,d)); %For Ref Composite 17_1009
Exp(expN).Dexp(1).RFcmpGL.dm(d).mean=mean(vv(medianIndxD,d)); %For Ref Composite 17_1009
@@ -916,49 +854,22 @@ Exp(expN).Dexp(1).RFcmpGr.dm(d).mean= mean(vvr(medianIndxD,d)); %For Ref Composi
Exp(expN).Dexp(1).RFcmpGr.dm(d).std=std(vvr(medianIndxD,d)); %For Ref Composite 17_1009
Exp(expN).Dexp(1).RFcmpGr.dm(d).min=min(vvr(medianIndxD,d)); %For Ref Composite 17_1009
Exp(expN).Dexp(1).RFcmpGr.dm(d).max=max(vvr(medianIndxD,d)); %For Ref Composite 17_1009
end %if ~isempty(NZrfIndxG) && length(medianIndxD) > (.15*size(drf,1)) %To calc. a median, more than 15%
end
end
end
end % if exist('drf','var')
%END OF DISPERSE REFERENCE PLATAES CALCULATIONS AND LIST ADDITIONS
%*********************************************************************
%Added 17-1023 For User Addition of Gene Composites to ListBox
%Expaa{ic,1}= aa; Expbb{ic,1}= bb;
%**********************************************************************
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
%try
for mp=1:MPnum % length(Exp(expN).Dexp(1).MP)
for ind384=1:384
spN=spN+1;
end
end
%catch
%end %try for user selected Reference routine
end
%****************************************************************************************************
gnLstRaw=strcat(aa(:,1),aa(:,2));
Exp(expN).Dexp(1).srtGnLst=sort(gnLstRaw);
orfLstRaw=strcat(bb(:,1),bb(:,2));
Exp(expN).Dexp(1).srtOrfLst=sort(orfLstRaw);
%********Auto select Zone and load listboxGnOrf data**********
% Auto select Zone and load listboxGnOrf data
zeroCLn=zeros(1,DMnum);
Exp(expN).expLoadCnt=Exp(expN).expLoadCnt+1; expLdCnt=Exp(expN).expLoadCnt;
zonePB=expN;
@@ -994,7 +905,6 @@ if expN==2
end
DNLaxes2=handles.DNLaxes2; % ZoneRelated
Exp(2).hzeroCLn(expLdCnt)=plot(DNLaxes2,zeroCLn,1:DMnum,'y');
end
if expN==3
@@ -1015,104 +925,86 @@ if expN==3
end
if Exp(4).interacPBsel==0 % if interaction "raw" don't show a center line
for i=1:Exp(expN).expLoadCnt,
try set(Exp(expN).hzeroCLn(i),'visible','off');
for i=1:Exp(expN).expLoadCnt
try
set(Exp(expN).hzeroCLn(i),'visible','off');
catch
catchissue= strcat('Ln521',i)
end,
end %ZoneRelated
end
%*********************************************************
EZdiagRFsSheet %**
%*****************
end
end
EZdiagRFsSheet
%*********************************************************
RFconfig=0;
if sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmean'))&&...
~isempty(Exp(expN).Dexp(1).RFmean)&&...
sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmeanG'))&&...
isempty(Exp(expN).Dexp(1).RFmeanG)
if sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmean')) ...
&& ~isempty(Exp(expN).Dexp(1).RFmean) ...
&& sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmeanG')) ...
&& isempty(Exp(expN).Dexp(1).RFmeanG)
RFconfig=1;
end
if sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmean'))==0 ||...
isempty(Exp(expN).Dexp(1).RFmean)&&...
sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmeanG'))&&...
~isempty(Exp(expN).Dexp(1).RFmeanG)
if sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmean'))==0 ...
|| isempty(Exp(expN).Dexp(1).RFmean) ...
&& sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmeanG')) ...
&& ~isempty(Exp(expN).Dexp(1).RFmeanG)
RFconfig=2;
end
if sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmean'))&&...
~isempty(Exp(expN).Dexp(1).RFmean)&&...
sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmeanG'))&&...
~isempty(Exp(expN).Dexp(1).RFmeanG)
if sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmean')) ...
&& ~isempty(Exp(expN).Dexp(1).RFmean) ...
&& sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmeanG')) ...
&& ~isempty(Exp(expN).Dexp(1).RFmeanG)
RFconfig=3;
end
Exp(expN).RFconfig=RFconfig; % ZoneRelated
%******************************************
if RFconfig~=0
Exp(expN).Dexp(1).RFrnames=rnames;
Exp(expN).Dexp(1).RFdata=data;
Exp(expN).Dexp(1).resetHtmpTg=5; % ZoneRelated
% HtMapTog 'string', 'Current user L/N' selection'
Exp(expN).Dexp(1).spotIndx=[];
if expN==1,
if expN==1
Exp(1).htmapPBsel=0;
set(handles.HtMapTog1,'string','L')
%*********
EZhtMap %*
%*********
EZhtMap
end
if expN==2,
if expN==2
Exp(2).htmapPBsel=0;
set(handles.HtMapTog2,'string','L')
%*********
EZhtMap %*
%*********
EZhtMap
end
if expN==3,
Exp(3).htmapPBsel=0;
set(handles.HtMapTog3,'string','L')
%*********
EZhtMap %*
%*********
EZhtMap
end
htMapTogPBfg=0;
elseif RFconfig==0,
elseif RFconfig==0
RFconfigMsg='No RF1 references in this Experiment Job'
try
%*********************
EZsingleExUserRF
%EZmultiDayGui %*
%cd(w) %*
%EZmultiDay %*
%EZmultiExLoad %*
%*********************
% EZmultiDayGui
% cd(w)
% EZmultiDay
% EZmultiExLoad
catch
RFconfigMsg='No RF1 or User selected references in this Experiment Job'
Exp(expN).Dexp(1).resetHtmpTg=3; % ZoneRelated
end
% Exp(expN).Dexp(1).resetHtmpTg=3; %ZoneRelated
end
%*****************************************
%**********************************************
%{
try msgBadGeneName, catch, end
try
if RFconfig==0,
RFconfigMsg='No RF1 references in this Experiment Job'
Exp(expN).Dexp(1).resetHtmpTg=3; %ZoneRelated
end
catch
end
%***************************
%}
%*******************************************************************
elseif expType==2 %Multiple Experiment from in one Folder extraction
Exp(expN).DexpType='chrono';
%*********************
% Test for Bad MP cell array (usually 384 [NaN}'s)
% replaced length(Exp(expN).Dexp(1).MP) with MPnum
for mx=1:length(Exp(expN).Dexp(1).MP)
@@ -1123,18 +1015,16 @@ elseif expType==2 %Multiple Experiment from in one Folder extraction
break
end
end
%*************************************************
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';
%*********************
% Test for Bad MP cell array (usually 384 [NaN}'s)
% replaced length(Exp(expN).Dexp(1).MP) with MPnum
for mx=1:length(Exp(expN).Dexp(1).MP)
@@ -1145,23 +1035,20 @@ elseif expType==3
break
end
end
%*************************************************
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')
end
%__________________________________________________________________________
%Bone Yard***********************************
% Deprecated Functions
%{
%Exp(expN).Dexp(1).RF1cmpK.[]; %For Ref Composite 17_1009
%Exp(expN).Dexp(1).std1K=[]; %For Ref Composite 17_1009
%Exp(expN).Dexp(1).min1K=[]; %For Ref Composite 17_1009
@@ -1200,9 +1087,6 @@ end
%rstd2=std(rValLst2); %For Ref Composite 17_1009
%rmean2=mean(rValLst2); %For Ref Composite 17_1009
%{
%User Reference Input Dialog Box used in the multiExperiment Chrono setup
prompt={'Enter GeneName to use as Reference:',...
@@ -1216,8 +1100,6 @@ end
rfSpec=answer(2); %if strcmpi(answer(2),'None'), rfSpec=''; end
rfGnSp=strcat(rfGene,rfSpec);
%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%First user input prototype code
if ~exist('RF1scanN','var') && ~exist('RF2scanN','var') %change || &&
prompt={'Enter Masterplate Number(s) of Your Reference GeneName spots:',...

View File

@@ -2,7 +2,6 @@
%Uses data stored from OLay ; Clearing OLay clears data used by this
%Trending Utility
global Exp
global userPars
@@ -18,7 +17,6 @@ else
cmpTogFlg=0;
end
DexpN=Exp(expN).DexpN;
if strcmp(Exp(expN).DexpType, 'chrono')
maxRows=1; Lmax=1; bpInd=0;
@@ -26,7 +24,6 @@ for n=1:length(Exp(expN).Dexp) %LOOP Thru DayExps
for trc=1:Exp(expN).traceN %length(Exp(expN).Trace)
try
if isequal(get(Exp(expN).hOL(trc),'Visible'),'on')
dmSel=Exp(expN).Trace(trc).dmSel;
if iscell(Exp(expN).Trace(trc).Dexp(n).DM(dmSel).UsrLvals)
rows=length(cell2mat(Exp(expN).Trace(trc).Dexp(n).DM(dmSel).UsrLvals));
@@ -44,11 +41,10 @@ for n=1:length(Exp(expN).Dexp) %LOOP Thru DayExps
end % if isequal(get(Exp(1).hOL(trc),'Visible'),'on')
catch
end
end % for trc= 1:
end %for n=1:length(Exp(expN).Dexp)
end
end
maxCols=bpInd; % length(Exp(expN).Dexp) * length(Exp(expN).Trace)
BPvals(1:maxRows,1:maxCols)=nan; % BoxPlot requires a matrix with uniform length even if data is not of the same length
bpInd=0;
for n=1:length(Exp(expN).Dexp) %LOOP Thru DayExps
for trc=1:Exp(expN).traceN %length(Exp(expN).Trace)
@@ -94,22 +90,20 @@ for n=1:length(Exp(expN).Dexp) %LOOP Thru DayExps
label=strcat(dayLbl,'-', Exp(expN).Trace(trc).UsrGLB, dmStr,scnt); %scnt(bpInd));
tickLabelStr{bpInd}=label;
end %if isequal(get(Exp(1).hOL(trc),'Visible'),'on')
end
catch
end
end %for trc=
end %for n=1:length(Exp(expN).Dexp)
end
end
else % if 'single' or 'multi' experiment setup for DM trends
maxRows=1; Lmax=1; bpInd=0;
%for n=1:length(Exp(expN).Dexp) %LOOP Thru Multi Experiments
% for n=1:length(Exp(expN).Dexp) % Loop Thru Multi Experiments
DexpN=Exp(expN).DexpN;
for dm=1:length(Exp(expN).Dexp(DexpN).DM.drug) % LOOP Thru DM perturbations
for trc=1:Exp(expN).traceN %length(Exp(expN).Trace)
% tempLB=Exp(expN).Trace(trc).UsrGLB;
try
if isequal(get(Exp(expN).hOL(trc),'Visible'),'on')
DexpN=Exp(expN).Trace(trc).DexpN;
if iscell(Exp(expN).Trace(trc).Dexp(DexpN).DM(dm).UsrLvals)
rows=length(cell2mat(Exp(expN).Trace(trc).Dexp(DexpN).DM(dm).UsrLvals));
@@ -124,18 +118,14 @@ for dm=1:length(Exp(expN).Dexp(DexpN).DM.drug) %LOOP Thru DM perturbations
end
if LsmpMax> Lmax, Lmax=LsmpMax; end
bpInd=bpInd+1;
end %if isequal(get(Exp(1).hOL(trc),'Visible'),'on')
end
catch
end
end % for trc= 1:
end %for
%end %for n=1:length(Exp(expN).Dexp)
%end
end
end
% end <- to stop here
maxCols=bpInd; % length(Exp(expN).Dexp) * length(Exp(expN).Trace)
BPvals(1:maxRows,1:maxCols)=nan; % BoxPlot requires a matrix with uniform length even if data is not of the same length
bpInd=0;
for dm=1:length(Exp(expN).Dexp(DexpN).DM.drug) %LOOP Thru DM perturbations
for trc=1:Exp(expN).traceN % length(Exp(expN).Trace)
@@ -150,7 +140,6 @@ for dm=1:length(Exp(expN).Dexp(DexpN).DM.drug) %LOOP Thru DM perturbations
cnt=length(kFiltrIndx);
%BPvals(1:length(cell2mat(Exp(expN).Trace(trc).Dexp(DexpN).DM(dm).UsrLvals)),bpInd)=cell2mat(Exp(expN).Trace(trc).Dexp(DexpN).DM(dm).UsrLvals);
%cnt=length(cell2mat(Exp(expN).Trace(trc).Dexp(DexpN).DM(dm).UsrLvals));
else
if length(Exp(expN).Trace(trc).Dexp(DexpN).DM(dm).UsrLvals)> 1
kFiltrIndx=find(((Exp(expN).Trace(trc).Dexp(DexpN).DM(dm).UsrKvals))<=kfiltLim);
@@ -179,15 +168,13 @@ for dm=1:length(Exp(expN).Dexp(DexpN).DM.drug) %LOOP Thru DM perturbations
dayNpos=max(strfind(Exp(expN).Dexp(DexpN).ExpFoldr, '_D'));
dayLbl=Exp(expN).Dexp(DexpN).ExpFoldr(dayNpos+1:end);
if ~isempty(dayLbl), dayLbl=strcat(dayLbl,'_'); end
label=strcat(dayLbl,Exp(expN).Trace(trc).UsrGLB, dmStr,scnt);
tickLabelStr{bpInd}=label;
end %if isequal(get(Exp(1).hOL(trc),'Visible'),'on')
catch
end
end %for trc=
end %for dm=1:length(Exp(expN).Dexp(DexpN).DM.drug)
end
end
%{
if isequal(tempLB(4:6),'cmp')||isequal(tempLB(3:6),'cmpG'),
RFcmpFlg=1;
@@ -195,9 +182,8 @@ end %for dm=1:length(Exp(expN).Dexp(DexpN).DM.drug)
RFcmpFlg=0;
end
%}
end
end %if strcmp(Exp(expN).DexpType, 'chrono') else if Single or Multi experiment
%***********************************************************************************************
% Box Plot Plotting section
if userPars.boxplotFlg==1
BPoutliers=userPars.BPoutliers;
@@ -217,7 +203,6 @@ rotation= userPars.BProt;
% 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];
bpn=1;
if strcmp(Exp(expN).DexpType, 'chrono')
@@ -240,12 +225,14 @@ rotation= userPars.BProt;
% boxplot
figure
set(gcf,'OuterPosition',(get(0,'screensize')))
if strcmpi(BPnotch,'on'),
boxplot(final_res, 'notch', 'on', ...
if strcmpi(BPnotch,'on')
boxplot(final_res, ...
'notch', 'on', ...
'positions', pos,...
'widths', wid)
elseif strcmpi(BPnotch,'off'),
boxplot(final_res, 'notch', 'off', ...
boxplot(final_res, ...
'notch', 'off', ...
'positions', pos,...
'widths', wid)
end
@@ -261,15 +248,15 @@ rotation= userPars.BProt;
% rotation=45;
for cnt=1:length(text_h)
set(text_h(cnt), 'FontSize', fontSize,...
set(text_h(cnt), ...
'FontSize', fontSize,...
'Rotation', rotation, ...
'String', tickLabelStr{length(tickLabelStr)-cnt+1}, ...
'HorizontalAlignment', 'right')
end
% 'VerticalAlignment', 'cap', ...
% smaller box for axes, in order to un-hide the labels
% Smaller box for axes, in order to un-hide the labels
squeeze=0.2;
left=0.02;
right=1;
@@ -277,7 +264,7 @@ rotation= userPars.BProt;
top=1-squeeze;
set(gca, 'OuterPosition', [left bottom right top])
% remove outliers
% Remove outliers
hout=findobj(gca,'tag','Outliers');
for out_cnt=1 : length(hout)
if strcmpi(BPoutliers,'on'),
@@ -286,16 +273,10 @@ rotation= userPars.BProt;
set(hout(out_cnt), 'Visible', 'off')
end
end
end
end %if userlPars.boxplotFlg==1
% END OF BOX PLOT CODE****************************************************
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%*****************PLOT OVERLAY CODE**************************************
%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%++++++++PLOT OVERLAY OF TRENDS FOR CHRONO OR DRUG-MEDIA PERMUTATIONS++++++++
% Plot Overlay Code
% Plot Overlay Of Trends For Chrono Or Drug-Media Permutations
try
lnwidth=str2num(Exp(4).plotPars{1});
axisFontSz=str2num(Exp(4).plotPars{2});
@@ -308,12 +289,10 @@ catch
markerSz=5;
end
if userPars.boxplotFlg~=1 % PLOT OVERLAY OF TRENDS
figure
set(gcf,'OuterPosition',(get(0,'screensize')))
if strcmp(Exp(expN).DexpType, 'chrono') % Chrono
% Plot median values for each DAY of the selected Trace
% (Gene-Specifics)using single DM of trace
range=0;
@@ -325,7 +304,6 @@ if userPars.boxplotFlg~=1 %PLOT OVERLAY OF TRENDS
tmp=[];
try
%if isequal(get(Exp(expN).hOL(trc),'Visible'),'on')
dmSel=Exp(expN).Trace(trc).dmSel;
if iscell(Exp(expN).Trace(trc).Dexp(n).DM(dmSel).UsrLvals)
kFiltrIndx=find((cell2mat(Exp(expN).Trace(trc).Dexp(n).DM(dmSel).UsrKvals))<=kfiltLim);
@@ -340,7 +318,7 @@ if userPars.boxplotFlg~=1 %PLOT OVERLAY OF TRENDS
dayStd(trc,n)=std(tmp(kFiltrIndx)); %std(Exp(expN).Trace(trc).Dexp(n).DM(dmSel).UsrLvals);
cnt=length(kFiltrIndx); %length(Exp(expN).Trace(trc).Dexp(n).DM(dmSel).UsrLvals);
end
%*************Make LEGEND list ********************************
% Make LEGEND list
% Make Sample Count Label item;
if n~=length(Exp(expN).Dexp)
scnt=strcat(scnt,num2str(cnt),',');
@@ -362,7 +340,6 @@ if userPars.boxplotFlg~=1 %PLOT OVERLAY OF TRENDS
loc=strfind(Exp(expN).Dexp(n).ExpFoldr,'_D');
daystr=Exp(expN).Dexp(n).ExpFoldr((loc+2):end);
dayNums(n)=str2num(daystr);
%trcInd=trcInd+1;
catch
end
@@ -371,10 +348,8 @@ try
lowerStd(trc,n)=dayMed(trc,n) - dayStd(trc,n);
catch
end
end %for n=1:length(Exp(expN).Dexp)
% end %if isequal(get(Exp(1).hOL(trc),'Visible'),'on')
end
% end
% Plot Trend Data
% if isequal(get(Exp(expN).hOL(trc),'Visible'),'on')
try
@@ -384,9 +359,9 @@ end
else
clear NmLstStr
if iscell(NmLst(trc)),NmLstStr=cell2mat(NmLst(trc)); else NmLstStr=NmLstStr(trc); end
if isequal(NmLstStr(4:6),'cmp') ||...
isequal(NmLstStr(3:6),'cmpG') || ...
isequal(NmLstStr(3:6),'cmpP'),
if isequal(NmLstStr(4:6),'cmp') ||
|| isequal(NmLstStr(3:6),'cmpG') ...
|| isequal(NmLstStr(3:6),'cmpP')
hTrendFig=plot(dayNums,dayMed(trc,1:n),'lineWidth',2); hold on
linecolor(trc)={get(hTrendFig,'color')};
else
@@ -400,22 +375,19 @@ end
hTrendFig=plot(1:n,dayMed(trc,1:n),'lineWidth',2); hold on
linecolor(trc)={get(hTrendFig,'color')};
ylabel('Experiment Day Index')
end %try
end % if isequal(get(Exp(expN).hOL(trc),'Visible'),'on') approx ln322
end
end
grid on
% set(gca,'linewidth',4) %0.5 then 1.5 now 6
% set(gca,'fontsize',axisFontSz) % 8 to 15 to 21
hold all
try % if isequal(get(Exp(expN).hOL(trc),'Visible'),'on')
tmpRange=ceil(max(upperStd(trc,1:end))) - floor(min(lowerStd(trc,1:end)));
range=max(range,tmpRange);
catch, end
end %for trc= 1:Exp(expN).traceN approx. ln319
%************** Standard Deviation range bars *****************************
end
% Standard Deviation range bars
% range=ceil(max(upperStd(trc,1:end))) - floor(min(lowerStd(trc,1:end)));
spacing=range*0.0034; %marker splacing for building range bars
for trc=1:Exp(expN).traceN %length(Exp(expN).Trace)
@@ -430,10 +402,9 @@ for trc= 1:Exp(expN).traceN %length(Exp(expN).Trace)
% line(n,(dayMed(trc,n)+0.1):0.05:upperStd(trc,n),'marker','v','LineWidth',1,'markerEdgeColor',cell2mat(linecolor(trc))); hold on
end
end
end %for n=1:length(Exp(expN).Dexp)
end % if isequal(get(Exp(expN).hOL(trc),'Visible'),'on')
end %for trc= 1:Exp(expN).traceN
end
end
end
% legName=strrep(NmLst,'_','-');
mm=1;
for nn=1:length(NmLst)
@@ -445,24 +416,18 @@ end
legName=strrep(legName,'/','-');
hleg=legend((legName),'location','NEO');
set(hleg,'fontsize',legFontSz)
end
xlabel('Days')
ylabel('L in Hours')
title('Chronological Trend Plot with Standard Deviations')
hold off
%***************************************************************
%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%***************************************************************
%SINGLE or MULTI-Experiment
% Single or Multi Experiment
if ~strcmp(Exp(expN).DexpType, 'chrono') %Single or Multi-Experiment
% Plot median values for each DM of the selected Trace (Gene-DM)
% (Gene-Specifics)using single DAY of trace
for trc=1:Exp(expN).traceN %length(Exp(expN).Trace)
trcInd=0;
DexpN=Exp(expN).Trace(trc).DexpN;
@@ -496,7 +461,8 @@ for trc= 1:Exp(expN).traceN %length(Exp(expN).Trace)
dmStd(trc,n)=std(tmp(kFiltrIndx)); %std(Exp(expN).Trace(trc).Dexp(DexpN).DM(n).UsrLvals);
cnt=length(kFiltrIndx); %length(Exp(expN).Trace(trc).Dexp(DexpN).DM(n).UsrLvals);
end
%*************Make LEGEND list ********************************
% Make Legend list
% Make Sample Count Label item
if n~=length(Exp(expN).Dexp(DexpN).DM.drug)
scnt=strcat(scnt,num2str(cnt),',');
@@ -517,10 +483,8 @@ for trc= 1:Exp(expN).traceN %length(Exp(expN).Trace)
trcInd=trcInd+1;
upperStd(trc,n)=dmMed(trc,n) + dmStd(trc,n);
lowerStd(trc,n)=dmMed(trc,n) - dmStd(trc,n);
end %if isequal(get(Exp(1).hOL(trc),'Visible'),'on')
end %for n=1:length(Exp(expN).Dexp(DexpN).DM.drug) %LOOP Thru Drug-Media perturbations
end
end
% Plot Trend Data
if isequal(get(Exp(expN).hOL(trc),'Visible'),'on')
@@ -530,29 +494,26 @@ for trc= 1:Exp(expN).traceN %length(Exp(expN).Trace)
else
clear NmLstStr
if iscell(NmLst(trc)),NmLstStr=cell2mat(NmLst(trc)); else NmLstStr=NmLst(trc); end
if isequal(NmLstStr(4:6),'cmp') ||...
isequal(NmLstStr(3:6),'cmpG') || ...
isequal(NmLstStr(3:6),'cmpP'),
if isequal(NmLstStr(4:6),'cmp'), ...
|| isequal(NmLstStr(3:6),'cmpG'), ...
|| isequal(NmLstStr(3:6),'cmpP')
hTrendFig=plot(1:n,dmMed(trc,1:n),'lineWidth',2); hold on
linecolor(trc)={get(hTrendFig,'color')};
else
hTrendFig=plot(1:n,dmMed(trc,1:n),'marker','^','lineWidth',2); hold on
linecolor(trc)={get(hTrendFig,'color')};
end
end
% yTicks=get(gca,'yTickLabel'); Ydelta=max(max(yTicks))-min(min(yTicks));
% spacing=Ydelta* 0.0034; %line spacing for STD marker
end
grid on
% set(gca,'linewidth',4) %0.5 then 1.5 now 6
% set(gca,'fontsize',axisFontSz) % 8 to 15 to 21
hold all
end %for trc= 1:Exp(expN).traceN
end
%************** Standard Deviation range bars *****************************
% Standard Deviation range bars
% range=ceil(max(max(upperStd))) - floor(min(min(lowerStd)));
range=ceil(max(upperStd(trc,1:end))) - floor(min(lowerStd(trc,1:end)));
spacing=range*0.0034;
@@ -563,11 +524,10 @@ for trc= 1:Exp(expN).traceN %length(Exp(expN).Trace)
line(n,lowerStd(trc,n):spacing:(dmMed(trc,n)-.05),'marker','^','LineWidth',1,'markerEdgeColor',cell2mat(linecolor(trc))); hold on
line(n,(dmMed(trc,n)+0.05):spacing:upperStd(trc,n),'marker','v','LineWidth',1,'markerEdgeColor',cell2mat(linecolor(trc))); hold on
catch
end
end
end %for n=1:length(Exp(expN).Dexp)
end %for trc= 1:Exp(expN).traceN
end
end
mm=1;
for nn=1:length(NmLst)
@@ -579,16 +539,11 @@ end
legName=strrep(legName,'/','-');
hleg=legend((legName),'location','NEO');
set(hleg,'fontsize',legFontSz)
xlabel('Drug-Media Index')
ylabel('L in Hours')
title('Drug-Media Trend Plot with Standard Deviations')
hold off
end %if ~strcmp(Exp(expN).DexpType, 'chrono') %Single or Multi-Experiment 395
%***************************************************************
%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%end
end
hold off
end %if userPars.boxplotFlg~=1 %PLOT OVERLAY OF TRENDS 266

View File

@@ -39,14 +39,13 @@ if expN==1,htTog= Exp(1).htmapPBsel;end
if expN==2,htTog=Exp(2).htmapPBsel;end
if expN==3,htTog=Exp(3).htmapPBsel;end
%00000000 LLLLLLLLLLLLLL 00000000000000000000000000000000000000000000000
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)
@@ -56,14 +55,13 @@ for i=1:size(L,1)
L4hMap(i,j)=LnStd;
elseif L(i,j)==0
L4hMap(i,j)=LpStd+0.2*std(L(:));
else
L4hMap(i,j)=L(i,j);
end
end
end
% L4hMap=1-(L4hMap/(max(L4hMap(:))));
%---------------------------------------------------
if prntHt==0
hTogHt=figure;
h=image(cleanPallet); % hTogHt=image(cleanPallet);
@@ -106,14 +104,13 @@ else %if clicking to produce a 'printable' save display
%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}));
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('L HeatMap for - ',expLblHtmap),strcat('MP=',num2str(mpSel),' ,DM=',num2str(dmSel),mediaLBhtmap)})
end
colormap(modJet1) %Fix added 230814
%3333333333 KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
colormap(modJet1)
elseif htTog==1
colormap(modJet1);
K=Exp(expN).Dexp(DexpN).scan(scnN).plate.CFout(:,3);
@@ -134,7 +131,7 @@ for i=1:size(K,1)
end
end
end
%---------------------------------------------------
if prntHt==0
hTogHt=figure;
h=image(cleanPallet);
@@ -160,12 +157,12 @@ else
%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}));
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('K HeatMap for - ',expLblHtmap),strcat('MP=',num2str(mpSel),' ,DM=',num2str(dmSel),mediaLBhtmap)})
end
%444444444 rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
elseif htTog==2
colormap(modJet1);
r=Exp(expN).Dexp(DexpN).scan(scnN).plate.CFout(:,4);
@@ -186,7 +183,6 @@ for i=1:size(r,1)
end
end
end
%---------------------------------------------------
if prntHt==0
hTogHt=figure;
h=image(cleanPallet);
@@ -201,7 +197,6 @@ 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
@@ -212,13 +207,12 @@ else
%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}));
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('r HeatMap for - ',expLblHtmap),strcat('MP=',num2str(mpSel),' ,DM=',num2str(dmSel),mediaLBhtmap)})
end
%33333333333333333333333333333333333333333333333333333(1111111111111111111)
elseif htTog==3
RFconfig=Exp(expN).RFconfig; %ZoneRelated
if htMapTogPBfg==1
@@ -234,12 +228,8 @@ elseif htTog==3
defaultanswer={'F','L'}; %{'80','60','100','3,4,5','N','39','Y','F','L'};
try defaultanswer=Exp(expN).htmapRFanswer; catch, defaultanswer={'F','L'}; end %ZoneRelated
end
if RFconfig~=1,
prompt={
QctrlRF,...
QpertRF,...
};
prompt={QctrlRF,QpertRF};
name='Interaction User Input';
numlines=1;
answer=inputdlg(prompt,name,numlines,defaultanswer);
@@ -255,7 +245,7 @@ elseif htTog==3
answer(2)=strrep(answer(2),'f','F'); answer(2)=strrep(answer(2),'g','G'); answer(2)=strrep(answer(2),'l','L');
Exp(expN).htmapRFanswer=answer; %ZoneRelated %store user last selections
end
end %if htMapTogPBfg==1
end
htMapTogPBfg=0;
answer=Exp(expN).htmapRFanswer; %ZoneRelated
@@ -264,10 +254,9 @@ elseif htTog==3
j=dmSel;
DM0=dmSel; DMj=dmSel;
m=mpSel;
%****************
anN= [1 2]; %*
EZintRFs %* Call subroutine to interpret user RF inputs & det. Rn and Rs values
%****************
anN=[1 2];
% Call subroutine to interpret user RF inputs & det. Rn and Rs values
EZintRFs
scnNdm1=1 + (dmN*(m-1))
scnN=j + (dmN*(m-1)) % 1,6,11..; 2,7,12 ..; 3,8,13..;
Xn{m,j,1}=[];
@@ -278,12 +267,9 @@ elseif htTog==3
Xhn{m,1,:}=Exp(expN).Dexp(DexpN).scan(scnNdm1).plate(1).CFout(:,12); %Exp(expN).Dexp(DexpN).scan(DM{j}(m)).plate(1).CFout(:,12);
Xn{m,j,:}=Exp(expN).Dexp(DexpN).scan(scnN).plate(1).CFout(:,5); %Exp(expN).Dexp(DexpN).scan(DM{j}(m)).plate(1).CFout(:,5);
htmpCpyXn=Xn{m,j,:}'; % Use to find and delineate no growth spots with 999 in text field (infinite interaction) value;
Xn{m,j,:}(Xn{m,j,:}==0)=1.2*(max(Xn{m,j,:})); %to keep the colormap scale tighter %=140;
Xln{m,j,:}=Exp(expN).Dexp(DexpN).scan(scnN).plate(1).CFout(:,11); %Exp(expN).Dexp(DexpN).scan(DM{j}(m)).plate(1).CFout(:,11);
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=((Xn{m,j,:} - Xn{m,1,:}) - (Rn(j)-Rn(1)));
Exp(expN).HtMpIntN2=intL; %ZoneRelated
@@ -293,12 +279,10 @@ elseif htTog==3
%}
percentRs=100;
RsReduced(j)=percentRs/100* Rs(j);
deltaRp(j)=(Rn(j)+RsReduced(j))-(Rn(1)+RsReduced(1));
deltaRn(j)=(Rn(j)-RsReduced(j))-(Rn(1)-RsReduced(1));
if deltaRp(j)==0, deltaRp(j)=0.0002; end
if deltaRn(j)==0, deltaRn(j)=0.0002; end
deltaYp=zeros(1,384); deltaYn=zeros(1,384);
deltaXRp=zeros(1,384); deltaXRn=zeros(1,384);
deltaXR{m,j}=zeros(1,384);
@@ -320,16 +304,15 @@ elseif htTog==3
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 %for i=1:384
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);
@@ -356,27 +339,21 @@ else
% 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}));
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
% end %for m=1:1
%end %for j=1:1
%4444444444444444444444444444444444444444444444444444444444(22222222222222222)
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
%****************
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}=[];
@@ -385,14 +362,13 @@ elseif htTog==4
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);
elsef
elseif
figure
h=image(cleanPallet);
end
@@ -414,14 +390,16 @@ end
% 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}));
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
end %if htTog==
prntHt=0;
%************* *****
EZhtMapText %* Update htMapText for location on the first 'roll thru of htMapPB
%************* *****
% Update htMapText for location on the first 'roll thru of htMapPB
EZhtMapText

View File

@@ -1,5 +1,5 @@
%EZhtMapText.m
%*********************HeatMap Text Field*********************************
% HeatMap Text Field
try
indx=Exp(expN).Dexp(DexpN).spotIndx;
l=Exp(expN).Dexp(DexpN).scan(scnN).plate.CFout(indx,5);
@@ -29,8 +29,6 @@ catch
htr=' ';
end
try
n1=num2str(Exp(expN).HtMpIntN1(indx)); %num2str(Exp(expN).Dexp(DexpN).HtMpIntN1(indx));
if length(n1)>5,N1=n1(1:5);else N1=n1; end
@@ -76,7 +74,6 @@ if expN==3,set(ghandles.HtMapVals3,'string',htmapStr);end
end
catch
end
catch
msg='No spot selected (indx=Exp(expN).Dexp(DexpN).spotIndx)'
end

View File

@@ -1,6 +1,4 @@
%print Interaction Data Output file
%**************************************************************************************
%resDir=Exp(expN).Dexp(DexpN).resDir;
%expN=1; %temp entry
if strcmp(Exp(expN).DexpType, 'single') || strcmp(Exp(expN).DexpType,'multi')
@@ -14,7 +12,6 @@ elseif strcmp(Exp(expN).DexpType, 'chrono')
pertTypeLB= '; Dayselections:';
Rsmax=max(Rs(1),Rs(1:dmN));
%MKDIR for ChonologicalStudy results in Exp Group folder
%For chrono studies, put the interaction results in the first Exp of selected group. i.e., DexpN=1;
intLfilename1= fullfile(Exp(expN).Dexp(1).resDir,'PrintResults','!AggrevatingL-Chrono.txt');
intLfilename2= fullfile(Exp(expN).Dexp(1).resDir,'PrintResults','!AlleviatingL-Chrono.txt');
@@ -22,10 +19,10 @@ elseif strcmp(Exp(expN).DexpType, 'chrono')
intLfilename4= fullfile(Exp(expN).Dexp(1).resDir,'PrintResults','!AlleviatingLadjusted-Chrono.txt');
end
userInputs=cell2mat(strcat( 'ExpZone:',num2str(expN), '; LeftPercent',answer(1),'; RightPercent:',answer(2),'; RFstdPercent:',answer(3),pertTypeLB,answer(4),'; RemoveNoGrowthInfLs:',answer(5),...
userInputs=cell2mat(strcat( 'ExpZone:',num2str(expN), '; LeftPercent',answer(1),'; RightPercent:',answer(2),...
'; RFstdPercent:',answer(3),pertTypeLB,answer(4),'; RemoveNoGrowthInfLs:',answer(5),...
'; NumberOfHistogramBins:',answer(6),'; Subplots:',answer(7))); %answer(7)
%********************11111111111111111111111111111111111111111****************************************************************************************************************
% Interaction Printout for Positive (longer L interaction values) Non-Adjusted for Ref std and curve fit boundaries
fid=fopen(intLfilename1,'w');
ln=1;
@@ -52,7 +49,6 @@ for i=1:size(selIntP,1)
fprintf(fid,'%s\t%s\t%s\t',cell2mat(IPspecifics(i)),cell2mat(IPorfRep(i)),cell2mat(IPstrain(i)));
fprintf(fid,'%.5f\t%.5f\t%.5f\t',selIntPx{1}(i,2),selIntPx{1}(i,4),selIntPx{1}(i,5),InterslstPos{1}(i))
fprintf(fid, '\n');
end
else
ln=ln+1;
@@ -61,7 +57,7 @@ else
end
% fprintf(fid, 'Num.\tDiagnostics\tDrug\tConc\tMedia\tModifier1\tConc1\tModifier2\tConc2\tORF\tGene\tAUC\triseTm\tK\tr\tl\tR-squared\tK-lower\tK-upper\tr-lower\tr-upper\tl-lower\tl-upper\tArea\tLastInten\tSplineMaxRateTm\tLastFitTm\t1stFitTm\tMedianBase\tFitBase\tMinTm\tThreshTm\tTotFitPts\tPostThreshFitPts\t1stBackgrd\tLstBackgrd\t1stMeanTotBackgrd\tLstMeanTotBackgrd');
fclose(fid)
%********************222222222222222222222222222222222222222222222****************************************************************************************************************
% Interaction Printout for Negative (shorter L interaction values) Non-Adjusted for Ref std and curve fit boundaries
fid=fopen(intLfilename2,'w');
ln=1;
@@ -87,14 +83,12 @@ for i=1:size(selIntN,1)
% fprintf(fid,'%.5f\t%.5f\t%.5f\t',ipL(i),ipLlower(i),ipLupper(i))
fprintf(fid,'%s\t%s\t%s\t',cell2mat(INspecifics(i)),cell2mat(INorfRep(i)),cell2mat(INstrain(i)));
fprintf(fid,'%.5f\t%.5f\t%.5f\t%.5f\t',selIntNx{1}(i,2),selIntNx{1}(i,4),selIntNx{1}(i,5),InterslstNeg{1}(i))
fprintf(fid, '\n');
end
end
fclose(fid)
%********************3333333333333333333333333333333333333333333333****************************************************************************************************************
% Interaction Printout for Positive (longer L interaction values) "ADJUSTED" for Ref std and curve fit boundaries
fid=fopen(intLfilename3,'w');
ln=1;
@@ -120,14 +114,10 @@ for i=1:size(selIntPAdj,1)
fprintf(fid,'%s\t%s\t%s\t',cell2mat(IPspecificsAdj(i)),cell2mat(IPorfRepAdj(i)),cell2mat(IPstrainAdj(i)));
fprintf(fid,'%.5f\t%.5f\t%.5f\t',selIntPxAdj{1}(i,2),selIntPxAdj{1}(i,4),selIntPxAdj{1}(i,5),InterslstPosAdj{1}(i))
fprintf(fid, '\n');
end
% fprintf(fid, 'Num.\tDiagnostics\tDrug\tConc\tMedia\tModifier1\tConc1\tModifier2\tConc2\tORF\tGene\tAUC\triseTm\tK\tr\tl\tR-squared\tK-lower\tK-upper\tr-lower\tr-upper\tl-lower\tl-upper\tArea\tLastInten\tSplineMaxRateTm\tLastFitTm\t1stFitTm\tMedianBase\tFitBase\tMinTm\tThreshTm\tTotFitPts\tPostThreshFitPts\t1stBackgrd\tLstBackgrd\t1stMeanTotBackgrd\tLstMeanTotBackgrd');
fclose(fid)
%********************44444444444444444444444444444444444444444444****************************************************************************************************************%Interaction Printout for Negative (shorter L interaction values) Non-Adjusted for Ref std and curve fit boundaries
fid=fopen(intLfilename4,'w');
ln=1;
fprintf(fid,'%d\t',ln);
@@ -153,9 +143,7 @@ for i=1:size(selIntNAdj,1)
% fprintf(fid,'%.5f\t%.5f\t%.5f\t',ipL(i),ipLlower(i),ipLupper(i))
fprintf(fid,'%s\t%s\t%s\t',cell2mat(INspecificsAdj(i)),cell2mat(INorfRepAdj(i)),cell2mat(INstrainAdj(i)));
fprintf(fid,'%.5f\t%.5f\t%.5f\t',selIntNxAdj{1}(i,2),selIntNxAdj{1}(i,4),selIntNxAdj{1}(i,5),InterslstNegAdj{1}(i))
fprintf(fid, '\n');
end
end

View File

@@ -3,9 +3,12 @@
%Provides Trace data storage for use by EZfigTrendOL.m
RFcmpGFlg=0;
if isequal(tempLB(4:6),'cmp'), RFnum= str2double(tempLB(3));
elseif isequal(tempLB(3:6),'cmpG'), RFcmpGFlg=1;
elseif isequal(tempLB(3:6),'cmpP'), RFcmpGFlg=1; %I beleive handling will be the same as RFcmpG
if isequal(tempLB(4:6),'cmp')
RFnum=str2double(tempLB(3));
elseif isequal(tempLB(3:6),'cmpG')
RFcmpGFlg=1;
elseif isequal(tempLB(3:6),'cmpP')
RFcmpGFlg=1; %I beleive handling will be the same as RFcmpG
end
Exp(expN).cLmdEven=0; %Added for Cummulative Median and Mean 'C' plot
RFDMflg=0;
@@ -22,16 +25,14 @@ if (~isempty(dmNum)&& isnumeric(dmNum)),RFDMflg=1; end
catch
end
if RFDMflg, Exp(zoneSel).Dexp(DexpN).pertSel=dmNum; end %pertSel=pert;
sgdInfoOnly=get(handles.InfoToggle,'value');
if sgdInfoOnly==1
EZviewInfoBox
else % Runs to end of EZlstBoxExt.m within this else condition
%***********PLOT Selected Gene/Orf Spot ******************************************
% Plot Selected Gene/Orf Spot
%try
if RFcmpGFlg==0
K=Exp(expN).Dexp(DexpN).RFcmpK(RFnum).dm(inDM).med; Ks=num2str(K);
@@ -58,7 +59,6 @@ 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;
@@ -69,48 +69,45 @@ 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
%tser=(scan(1,plateNum).plate(1).t0Series(:));
%rawData=scan(1,plateNum).plate(1).intens(indx,:)/scan(1,plateNum).plate(1).Ag(indx);
if zoneSel==1, plotAxes=ghandles.Paxes1; OLaxes=ghandles.OLaxes1;
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;
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;
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,tser,rawData,'g*');
plot(plotAxes,t,gSlow,'y'); plot(plotAxes,t,gFast,'r');hold (plotAxes,'off');
%************CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC**************************************
% Store L R and K valves for Composite [C] plots
Exp(expN).ll(traceN)=l; Exp(expN).rr(traceN)=r; Exp(expN).kk(traceN)=K;
if RFcmpGFlg==0
Exp(expN).lstd(traceN)=Exp(expN).Dexp(DexpN).RFcmpL(RFnum).dm(inDM).std;
Exp(expN).kstd(traceN)=Exp(expN).Dexp(DexpN).RFcmpK(RFnum).dm(inDM).std;
Exp(expN).rstd(traceN)=Exp(expN).Dexp(DexpN).RFcmpr(RFnum).dm(inDM).std;
for dm=1:length(Exp(expN).Dexp(DexpN).DM.drug)
Exp(expN).Trace(traceN).Dexp(DexpN).DM(dm).UsrLvals={Exp(expN).Dexp(DexpN).RFcmpL(RFnum).dm(dm).Lvals};
Exp(expN).Trace(traceN).Dexp(DexpN).DM(dm).UsrKvals={Exp(expN).Dexp(DexpN).RFcmpK(RFnum).dm(dm).Kvals};
Exp(expN).Trace(traceN).Dexp(DexpN).DM(dm).Usrrvals={Exp(expN).Dexp(DexpN).RFcmpr(RFnum).dm(dm).rvals};
end
Exp(expN).Trace(traceN).dmSel=inDM;
Exp(expN).Trace(traceN).DexpN=DexpN;
Exp(expN).Trace(traceN).UsrGLB=selGnOrf;
elseif RFcmpGFlg==1
Exp(expN).lstd(traceN)=Exp(expN).Dexp(DexpN).RFcmpGL.dm(inDM).std;
Exp(expN).kstd(traceN)=Exp(expN).Dexp(DexpN).RFcmpGK.dm(inDM).std;
Exp(expN).rstd(traceN)=Exp(expN).Dexp(DexpN).RFcmpGr.dm(inDM).std;
if strcmp(Exp(expN).DexpType,'chrono')
for nn=1:length(Exp(expN).Dexp) %replaced dmSel with inDM for 'chrono' and RFcmpGFlg
Exp(expN).Trace(traceN).Dexp(nn).DM(inDM).UsrLvals=Exp(expN).Dexp(nn).RFcmpGL.dm(inDM).Lvals;
@@ -124,18 +121,21 @@ Exp(expN).Trace(traceN).Dexp(DexpN).DM(dm).UsrKvals= Exp(expN).Dexp(DexpN).RFcmp
Exp(expN).Trace(traceN).Dexp(DexpN).DM(dm).Usrrvals=Exp(expN).Dexp(DexpN).RFcmpGr.dm(dm).rvals;
end
end
Exp(expN).Trace(traceN).dmSel=inDM;
Exp(expN).Trace(traceN).DexpN=DexpN;
Exp(expN).Trace(traceN).UsrGLB=selGnOrf;
end
Exp(expN).lslow(traceN)=lslow; Exp(expN).lfast(traceN)=lfast;
Exp(expN).lKl(traceN)=Kl; Exp(expN).Ku(traceN)=Ku;
Exp(expN).lrl(traceN)=rl; Exp(expN).ru(traceN)=ru;
%************************************************************************
try for i=1:length(Exp(zoneSel).hOL(:)),set(Exp(zoneSel).hOL(i),'color',[0 0 1]); end, catch; end
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])
% Exp(zoneSel).hOLb(traceN)=plot(OLaxes,tser,rawData,'g*'); %No Raw Data, Ref Composite 17_1009
@@ -177,20 +177,15 @@ Exp(zoneSel).hOLname(traceN)= spotDescrip; %graphStr; %ghandles.Exp(zoneSel).h
Exp(zoneSel).hOLexpNm(traceN)=expStr; %ghandles.Exp(expN).hOLexpNm(traceN)=expStr;
Exp(zoneSel).hOLresDir(traceN)={Exp(zoneSel).Dexp(DexpN).resDir};
%Exp(zoneSel).hOLplateNum(traceN)=plateNum;
%traceData=vertcat(get(Exp(OLay).hOL(traceN),'XData'),get(ghandles.Exp(OLay).hOL(traceN),'YData'));
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='Ln33 EZlstBoxCmpExt'
% msg='Error'
%end % trycatch zoneSel<4 datatip selection from Image (not from an OverLay Plot)
%**************Write Spot and Exp Info to OLay title areas****************************************************************************
% Write Spot and Exp Info to OLay title areas
if zoneSel==1, %&& get(ghandles.rotPB1,'value')~=1
if length(char(Exp(zoneSel).hOLname(traceN)))>40,set(ghandles.OLay1,'FontSize',8);end
@@ -210,29 +205,13 @@ if zoneSel==3,set(ghandles.graphStrLoc3,'string',spotDescrip);end %graphStr);en
if length(char(Exp(zoneSel).hOLexpNm(traceN)))>40,set(ghandles.OLexp3,'FontSize',8);end
set(ghandles.OLexp3,'string',Exp(OLay).hOLexpNm(traceN));
end
end %if sgdInfoOnly==1
%***********************GraphicDestinationPerturbationComparison**15_0821************************************************
lstBoxCmpFlg=1;
EZdatatip=0; %**
if strcmp((Exp(expN).DexpType),'single')||...
strcmp((Exp(expN).DexpType),'multi')
%****************
EZdestComp %**
%****************
elseif strcmp((Exp(expN).DexpType),'chrono')
%EZdatatip=2; %**
%************
EZmDayTrend %**
%************
end
%***********************************************************************************************************************
% GraphicDestinationPerturbationComparison**15_0821
lstBoxCmpFlg=1;
EZdatatip=0;
if strcmp((Exp(expN).DexpType),'single') || strcmp((Exp(expN).DexpType),'multi')
EZdestComp
elseif strcmp((Exp(expN).DexpType),'chrono')
EZmDayTrend
end

View File

@@ -4,13 +4,12 @@
% or by EZviewGui.m (listboxGnOrf_Callback)
% Replace get(ghandles.CompositeTog1,'value')==1 ... with get(handles....
if expN==1 && get(handles.CompositeTog1,'value')==1 ||...
expN==2 && get(handles.CompositeTog2,'value')==1 ||...
expN==3 && get(handles.CompositeTog3,'value')==1
if expN==1 && get(handles.CompositeTog1,'value')==1 ...
|| expN==2 && get(handles.CompositeTog2,'value')==1 ...
|| expN==3 && get(handles.CompositeTog3,'value')==1
CompositeTrendFlg=1; else CompositeTrendFlg=0;
end
Exp(expN).cLmdEven=0; % Added for Cummulative Median and Mean 'C' plot
RFDMflg=0;
if zoneSel==1,DexpN=(get(handles.DN1,'value')); end
@@ -25,14 +24,11 @@ if (~isempty(dmNum)&& isnumeric(dmNum)),RFDMflg=1; end
catch
end
if RFDMflg, Exp(zoneSel).Dexp(DexpN).pertSel=dmNum; end % pertSel=pert;
inMP=selGnOrf{1}((LBdlims{:,:}(1))+1:(LBdlims{:,:}(2))-1)
% LBmp=str2double(inMP);
sgdInfoOnly=get(handles.InfoToggle,'value');
if sgdInfoOnly==1
%***************
EZviewInfoBox %*
%***************
EZviewInfoBox
else % Runs to end of EZlstBoxExt.m within this else condition
if zoneSel==1
Max=floor(get(handles.MPsldr1,'max'));
@@ -67,8 +63,7 @@ else
if str2num(inMP) <=Min, set(handles.MPsldr3,'value',Min),set(handles.MPed3,'string',num2str(Min));end
end
end
if RFDMflg,
if RFDMflg
if zoneSel==1
Max=floor(get(handles.DMsldr1,'max'));
Min=floor(get(handles.DMsldr1,'min'));
@@ -103,23 +98,17 @@ else
end
end
end
%**************************************************************************
EZVimDisplay %**
%**************************************************************************
EZVimDisplay
% 17_111 If CompositeTog_ set, Routine called to find all gene replicates and produce composite values
if CompositeTrendFlg==1
if strcmp(Exp(expN).DexpType, 'chrono')
%***********************
EZmDayPlotUcmp %*
%***********************
EZmDayPlotUcmp
else
%***********************
EZplotUcmp %*
%***********************
EZplotUcmp
end
%*******************************************************************
%***********PLOT Selected Gene/Orf Spot ******************************************
% Plot Selected Gene/Orf Spot
% if non-Composite ("normal") then - ...
elseif CompositeTrendFlg~=1
destPerMP=Exp(zoneSel).Dexp(DexpN).destPerMP; %length(gS.DM1.drug);
@@ -127,7 +116,6 @@ elseif CompositeTrendFlg~=1
plateNum=(LBmp-1)*destPerMP + pertSel;
indx=((LBr-1)*24) +LBc
MP=Exp(zoneSel).Dexp(DexpN).MP;
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);
@@ -135,26 +123,21 @@ 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
Kl=scan(1,plateNum).plate(1).CFout(indx,7);
Ku=scan(1,plateNum).plate(1).CFout(indx,8);
rl=scan(1,plateNum).plate(1).CFout(indx,9);
ru=scan(1,plateNum).plate(1).CFout(indx,10);
lfast=scan(1,plateNum).plate(1).CFout(indx,11);
lslow=scan(1,plateNum).plate(1).CFout(indx,12);
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
tser=(scan(1,plateNum).plate(1).t0Series(:));
rawData=scan(1,plateNum).plate(1).intens(indx,:)/scan(1,plateNum).plate(1).Ag(indx);
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;
@@ -172,18 +155,16 @@ rawData= scan(1,plateNum).plate(1).intens(indx,:)/scan(1,plateNum).plate(1).Ag(i
end
plot(plotAxes,t,g);hold (plotAxes,'on');plot(plotAxes,tser,rawData,'g*');
plot(plotAxes,t,gSlow,'y');plot(plotAxes,t,gFast,'r');hold (plotAxes,'off');
%************CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC**************************************
% Store L R and K valves for 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])
Exp(zoneSel).hOLb(traceN)=plot(OLaxes,tser,rawData,'g*');
catch
catchissue='Ln100 EZlstBoxExt'
end %trycatch
end
% Get the DM agar description
if expN==1,DMstr=char(get(handles.DM1,'string'));end
@@ -221,7 +202,6 @@ Exp(zoneSel).hOLresDir(traceN)= {Exp(zoneSel).Dexp(DexpN).resDir};
Exp(zoneSel).hOLplateNum(traceN)=plateNum;
% traceData=vertcat(get(Exp(OLay).hOL(traceN),'XData'),get(ghandles.Exp(OLay).hOL(traceN),'YData'));
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
@@ -231,14 +211,11 @@ if zoneSel==3,set(ghandles.graphStrLoc3,'string',spotDescrip);end %graphStr);en
catch
catchissue='Ln141 EZlstBoxExt'
msg='Error'
end % trycatch zoneSel<4 datatip selection from Image (not from an OverLay Plot)
end
end
end %if get(ghandles.CompositeTog1,'value')==1
%**************Write Spot and Exp Info to OLay title areas****************************************************************************
if zoneSel==1, %&& get(ghandles.rotPB1,'value')~=1
% Write Spot and Exp Info to OLay title areas
if zoneSel==1 %&& get(ghandles.rotPB1,'value')~=1
if length(char(Exp(zoneSel).hOLname(traceN)))>40,set(ghandles.OLay1,'FontSize',8);end
set(ghandles.OLay1,'string', Exp(zoneSel).hOLname(traceN));
if length(char(Exp(zoneSel).hOLexpNm(traceN)))>40,set(ghandles.OLexp1,'FontSize',8);end
@@ -257,7 +234,7 @@ end %if get(ghandles.CompositeTog1,'value')==1
set(ghandles.OLexp3,'string',Exp(OLay).hOLexpNm(traceN));
end
%*****************Highlight gene/orf select Spot on Image*********
% Highlight gene/orf select Spot on Image
tPtSel=Exp(zoneSel).Dexp(DexpN).tPtSel;
Rim=16-(LBr-1); Cim =LBc;
spotCoor=Exp(zoneSel).Dexp(DexpN).FexpScanSpots{1,plateNum}{Cim,Rim,tPtSel};
@@ -267,21 +244,16 @@ spotCoor=Exp(zoneSel).Dexp(DexpN).FexpScanSpots{1,plateNum}{Cim,Rim,tPtSel};
%axes(ghandles.Iaxes1)
plot(expAxes,(spotCoor(2)+24),(spotCoor(1)+24),'.y')
%***********************GraphicDestinationPerturbationComparison**15_0821************************************************
% GraphicDestinationPerturbationComparison**15_0821
EZdatatip=0; %**
if strcmp((Exp(expN).DexpType),'single')||...
strcmp((Exp(expN).DexpType),'multi')
%****************
EZdestComp %**
%****************
if strcmp((Exp(expN).DexpType),'single') ...
|| strcmp((Exp(expN).DexpType),'multi')
EZdestComp
elseif strcmp((Exp(expN).DexpType),'chrono')
%************
EZmDayTrend %**
%************
EZmDayTrend
end
%***********************************************************************************************************************
%*********************HeatMap Text Field*********************************
% HeatMap Text Field
try
ll=num2str(l);
if length(ll)>5,htl=ll(1:5);else htl=ll;end
@@ -302,6 +274,4 @@ if expN==2,set(ghandles.HtMapVals2,'string',htmapStr);end
if expN==3,set(ghandles.HtMapVals3,'string',htmapStr);end
catch
end
end %if sgdInfoOnly==1
end

View File

@@ -1,18 +1,16 @@
%***********User find and build composite of Selected Gene Composite and
%*************Plot it on OLay Plot and Trend plot DNLaxles
%***************For Chonological Studies (multi Day Studies)
% User find and build composite of Selected Gene Composite and
% Plot it on OLay Plot and Trend plot DNLaxles
% For Chonological Studies (multi Day 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; % Temp input for development
patrnN=strfind(selGnOrf{1},':'); %Extract Gene-Orf Name
patrndash=strfind(selGnOrf{1},'-');
selStrNm=char(selGnOrf)
@@ -22,14 +20,14 @@ else
usrGene=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));
if strcmpi(usrSpec,'None'), usrGnSp= {strcat(usrGene,'-')};
if strcmpi(usrSpec,'None')
usrGnSp={strcat(usrGene,'-')};
elseif length(usrSpec)> 8,
trimUspec=usrSpec(1:8);
usrGnSp=strcat(usrGene,',',{trimUspec});
@@ -38,29 +36,19 @@ end
usrGnSp=strcat(usrGene,',',{trimUspec});
end
for n=1:Exp(expN).DexpLength % LOOP Thru DayExps
MPnum=length(Exp(expN).Dexp(n).MP);
DMnum=length(Exp(expN).Dexp(n).DM.drug);
%Extract expDay from ExpName string
dayNpos=max(strfind(Exp(expN).Dexp(n).ExpFoldr, '_D'))
dayLbl=Exp(expN).Dexp(n).ExpFoldr(dayNpos+1:end);
%*********************************
dRF1indx=0;
usrSp=usrSpec; %user entry of Specifics for Ref selection
%*******************************************************
for mp=1:length(Exp(expN).Dexp(n).MP)
for ind384=1:384
try %
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(n).MP(mp).genename{1}(ind384))==38991,
@@ -68,32 +56,25 @@ for mp=1:length(Exp(expN).Dexp(n).MP)
elseif isnumeric(cell2mat(Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)))
Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)={' '};
end
%*****************************************************************
% DISPersed REFerence capture and find Medians
if ( ((strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),usrGene) && ...
strcmpi((Exp(expN).Dexp(n).MP(mp).specifics{1}(ind384)),usrSp)))...
|| ((strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),usrGene) && ...
strcmpi(usrSp,'None'))) ),
if ( ((strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),usrGene) ...
&& strcmpi((Exp(expN).Dexp(n).MP(mp).specifics{1}(ind384)),usrSp))) ...
|| ((strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),usrGene) ...
&& strcmpi(usrSp,'None'))) )
dRF1indx=dRF1indx+1;
Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)=strrep((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),':',' ');
drf(dRF1indx,1)=(Exp(expN).Dexp(n).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(n).MP(mp).specifics{1}(ind384));
end %if isempty(regexpi(char((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384))),'blank'))...
%*******************************************************************************
end
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(n).MP)
%*****************************************************
%************************************************************************************************
end
vvL=[]; %Initialize to cover case where all spot are Zero NoGrowth See NIGrowthflg==0
if exist('drf','var')
@@ -107,47 +88,40 @@ for j=1:length(drf(:,3))
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 mm=1:length(dMPs) % length(chgIndx)
usrScNdisp=((dMPs(mm)-1)*DMnum)+(dmSel);
NZusrIndx=drfPindx((find(drfPindx(:,dMPs(mm)))),dMPs(mm)); medianIndxDisp=NZusrIndx;
vvL(chgIndx(mm):(chgIndx(mm+1)-1))=Exp(expN).Dexp(n).scan(usrScNdisp).plate(1).CFout(NZusrIndx,5);
%For Global Ref Composite 17_1009 %**************************************************************************
% For Global Ref Composite 17_1009
vvK(chgIndx(mm):(chgIndx(mm+1)-1))=Exp(expN).Dexp(n).scan(usrScNdisp).plate(1).CFout(NZusrIndx,3);
vvr(chgIndx(mm):(chgIndx(mm+1)-1))=Exp(expN).Dexp(n).scan(usrScNdisp).plate(1).CFout(NZusrIndx,4);
%*****************************************************************************************************
end %for mm=1:length(dMPs)
%****************CALC. GLOBAL MEAN, STD, AND MEDIAN FOR DISTRIBUTED REFERENCES******************************************************************
end
% Calc. Global Mean, Std, And Median For Distributed References
for d=dmSel:dmSel
NZusrIndxG=[];
NZusrIndxG=find(vvL);
if isempty(nonzeros(vvL)), nonZeroCntD=0;
else nonZeroCntD= length(nonzeros(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{n}=vvL(NZusrIndxG);
UsrKvals{n}=vvK(NZusrIndxG);
Usrrvals{n}=vvr(NZusrIndxG);
end
end
end
end
end % if exist('drf','var')
%END OF DISPERSE Gene data collection
%*********************************************************************
%####################################################################
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;
@@ -159,13 +133,9 @@ if isempty(vvL),
NoGrowthflg=1;
end
%Exp(expN).UgeneCnt=Exp(expN).UgeneCnt +1;
%Exp(expN).UgeneSpLst(Exp(expN).UgeneCnt)=usrGnSp;
%#######################################################################
%***********PLOT Values Selected Gene-Specifics Composite ******************************************try
% Plot Values Selected Gene-Specifics Composite
if NoGrowthflg==0
smpSz=size(NZusrIndxG,1);
K=median(cell2mat((UsrKvals(DexpN)))); Ks=num2str(K); Kstd=std(cell2mat((UsrKvals(DexpN)))); KstdStr=num2str(Kstd);
@@ -194,71 +164,63 @@ 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'));
plateNum=(LBmp-1)*destPerMP + pertSel;
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
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;
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;
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;
for n=1:Exp(expN).DexpLength %LOOP Thru DayExps
for n=1:Exp(expN).DexpLength % Loop Thru DayExps
Exp(expN).Trace(traceN).Dexp(n).DM(dmSel).UsrLvals=UsrLvals(n);
Exp(expN).Trace(traceN).Dexp(n).DM(dmSel).UsrKvals=UsrKvals(n);
Exp(expN).Trace(traceN).Dexp(n).DM(dmSel).Usrrvals=Usrrvals(n);
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])
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
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);
@@ -278,8 +240,6 @@ 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
@@ -287,6 +247,5 @@ if zoneSel==1,set(ghandles.graphStrLoc1,'string',spotDescrip);end %graphStr);en
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)
end

View File

@@ -1,23 +1,20 @@
%***********User find and build composite of Selected Gene Composite and
%*************Plot it on OLay Plot and Trend plot DNLaxles
%***************For Chonological Studies (multi Day Studies)
% User find and build composite of Selected Gene Composite and
% Plot it on OLay Plot and Trend plot DNLaxles
% For Chonological Studies (multi Day 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
tracN=Exp(expN).traceN;
n=Exp(expN).DexpN; % Temp input for development
% UmDayaa=cell(3,n); UmDaybb=cell(3,n);
patrnN=strfind(selGnOrf{1},':'); % Extract Gene-Orf Name
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;
@@ -29,9 +26,7 @@ usrGene= selStrNm(1:(patrnN(1)-1))
if strcmpi(usrSpec,'None'), usrGnSp={strcat(usrGene,'-')}; end
% if strfind(Exp(expN).UgeneSpLst,usrGnSp), break; end
Exp(expN).Dexp(n).UsrmdPLB={[]};
Exp(expN).Dexp(n).UsrMedianG=[];
Exp(expN).Dexp(n).UsrminG=[];
Exp(expN).Dexp(n).UsrmaxG=[];
@@ -40,51 +35,40 @@ Exp(expN).Dexp(n).UsrmeanG= [];
Exp(expN).Dexp(n).UsrCmpGL=[]; % For Ref Composite 17_1026
Exp(expN).Dexp(n).UsrCmpGK=[]; % For Ref Composite 17_1026
Exp(expN).Dexp(n).UsrCmpGr=[]; % For Ref Composite 17_1026
Exp(expN).Dexp(n).UsrGLB={};
for n=1:Exp(expN).DexpLength %LOOP Thru DayExps
for n=1:Exp(expN).DexpLength % Loop Thru Dayexps
MPnum=length(Exp(expN).Dexp(n).MP);
DMnum=length(Exp(expN).Dexp(n).DM.drug);
tPtsSize=size(Exp(expN).Dexp(n).FexpScanBMtp{1,1},(3));
%*********************************
% lstindx=size(aa,1);
% lstindxOrf=size(bb,1);
spN=0;
rfcnt=0;
dRF1indx=0;
% usrGene=cell2mat(usrGene); %user entry of Specifics for Ref selection
usrSp=cell2mat(usrSpec); %user entry of Specifics for Ref selection
%*******************************************************
for mp=1:length(Exp(expN).Dexp(n).MP)
% RF1fullPlate=0;
for ind384=1:384
spN=spN+1;
try %
try
r=ceil(ind384/24);
if rem(ind384,24)==0, c=24; else c=rem(ind384,24); end
% 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(n).MP(mp).genename{1}(ind384))==38991,
if cell2mat(Exp(expN).Dexp(n).MP(mp).genename{1}(ind384))==38991
Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)={'OCT1_'};
elseif isnumeric(cell2mat(Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)))
Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)={' '};
end
%*****************************************************************
% DISPersed REFerence capture and find Medians
if ( ((strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),usrGene) && ...
strcmpi((Exp(expN).Dexp(n).MP(mp).specifics{1}(ind384)),usrSp)))...
|| ((strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),usrGene) && ...
strcmpi(usrSp,'None'))) ),
if ( ((strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),usrGene) ...
&& strcmpi((Exp(expN).Dexp(n).MP(mp).specifics{1}(ind384)),usrSp))) ...
|| ((strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),usrGene) ...
&& strcmpi(usrSp,'None'))) )
dRF1indx=dRF1indx+1;
Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)=strrep((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),':',' ');
drf(dRF1indx,1)=(Exp(expN).Dexp(n).MP(mp).genename{1}(ind384));
@@ -94,36 +78,25 @@ for mp=1:length(Exp(expN).Dexp(n).MP)
drf(dRF1indx,5)={c}; drfc(dRF1indx,mp)=c;
drf(dRF1indx,6)={ind384}; drfPindx(dRF1indx,mp)=ind384;
%drf(dRF1indx,7)=(Exp(expN).Dexp(n).MP(mp).specifics{1}(ind384));
end %if isempty(regexpi(char((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384))),'blank'))...
%*******************************************************************************
end
catch
error='EZexpSel lineAfter 24 EZmultiGeneLst.m'
mp %Disable in future to prevent a bomb out OR put into a nested TryCatch
ind384 %Disable in future to prevent a bomb out OR put into a nested TryCatch
msgBadGeneName=strcat('check genename at mp=',num2str(mp),' indx=',num2str(ind384))
end
end %end associated with for ind384=1:384
end
mp
end %end associated with for mp=1:length(Exp(expN).Dexp(n).MP)
%*****************************************************
%************************************************************************************************
end
% Exp(expN).Dexp(n).UsrmdPindx=[];
% Exp(expN).Dexp(n).UsrmdPpltN=[];
if exist('drf','var')
% 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,3))~=cell2mat(drf((j-1),3)), chgIndx(i)=j; i=i+1; end
end
@@ -132,20 +105,17 @@ chgIndx(length(chgIndx)+1)= length(drf)+1;
uu=zeros(size(drf,1),4);
uu(:,1:4)=cell2mat(drf(:,3:6));
vv=zeros(length(drf),1 ); % DMnum);
%************************************
dMPs=unique(cell2mat(drf(:,3)));
%*****************************************
for mm=1:length(dMPs) % length(chgIndx)
usrScNdisp=((dMPs(mm)-1)*DMnum)+(dmSel);
NZrefIndxP=drfPindx((find(drfPindx(:,dMPs(mm)))),dMPs(mm)); medianIndxDisp=NZrefIndxP;
vv(chgIndx(mm):(chgIndx(mm+1)-1),dmSel)=Exp(expN).Dexp(n).scan(usrScNdisp).plate(1).CFout(NZrefIndxP,5);
%For Global Ref Composite 17_1009 %**************************************************************************
% For Global Ref Composite 17_1009
vvK(chgIndx(mm):(chgIndx(mm+1)-1),dmSel)=Exp(expN).Dexp(n).scan(usrScNdisp).plate(1).CFout(NZrefIndxP,3);
vvr(chgIndx(mm):(chgIndx(mm+1)-1),dmSel)=Exp(expN).Dexp(n).scan(usrScNdisp).plate(1).CFout(NZrefIndxP,4);
%*****************************************************************************************************
end % for mm=1:length(dMPs)
%****************CALC. GLOBAL MEAN, STD, AND MEDIAN FOR DISTRIBUTED REFERENCES******************************************************************
% Calc. Global Mean, Std, And Median For Distributed References
uu=horzcat(uu,vv);
for d=dmSel:dmSel
medianIndxG=[];
@@ -155,32 +125,27 @@ for d=dmSel:dmSel
usrmeanG=mean(nonzeros(vv(:,d)));
usrStdG=std(nonzeros(vv(:,d)));
NZusrIndxG=find(vv(:,d));
if isempty(usrmeanG), nonZeroCntD=0, %medianIndxDisp= RFmeanG(d);
else nonZeroCntD= length(nonzeros(vv(:,d)));
if isempty(usrmeanG)
nonZeroCntD=0 % medianIndxDisp=RFmeanG(d);
else
nonZeroCntD=length(nonzeros(vv(:,d)));
end
% Calc. of median value for composite doesn't require and odd number of Indx items
medianIndxG=NZusrIndxG(:);
if ~isempty(NZusrIndxG) && length(medianIndxG) > 0 %(.15*size(drf,1)) %To calc. a median, more than 15% of spots must be nonZero
Exp(expN).Dexp(n).UsrGLB(d)=usrGnSp; % strcat(aa(lstindx,1),aa(lstindx,2));
Exp(expN).Dexp(n).UsrLvals=vv(medianIndxG);
Exp(expN).Dexp(n).UsrKvals=vvK(medianIndxG);
Exp(expN).Dexp(n).Usrrvals=vvr(medianIndxG);
end
end
end
end
end % if exist('drf','var')
%END OF DISPERSE REFERENCE PLATAES CALCULATIONS AND LIST ADDITIONS
%*********************************************************************
%####################################################################
end %for n=1:Exp(expN).DexpLength %Loop thru Dayexps
Exp(expN).UgeneCnt=Exp(expN).UgeneCnt +1;
Exp(expN).UgeneSpLst(Exp(expN).UgeneCnt)=usrGnSp;
%#######################################################################
%***********PLOT Values Selected Gene-Specifics Composite ******************************************try
% PLOT Values Selected Gene-Specifics Composite
smpSz=size(medianIndxG,1);
K=median(vvK(medianIndxG,dmSel)); Ks=num2str(K); Kstd=std(vvK(medianIndxG,dmSel)); KstdStr=num2str(Kstd);
r=median(vvr(medianIndxG,dmSel)); rs=num2str(r); rstd=std(vvr(medianIndxG,dmSel)); rstdStr=num2str(rstd);
@@ -196,23 +161,19 @@ 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'));
plateNum=(LBmp-1)*destPerMP + pertSel;
indx=((LBr-1)*24) +LBc
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
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;
@@ -230,26 +191,25 @@ if K==0||r==0||l==0, g(1:200)=1;gSlow(1:200)=1;gFast(1:200)=1;end
end
plot(plotAxes,t,g);hold (plotAxes,'on');
plot(plotAxes,t,gSlow,'y');plot(plotAxes,t,gFast,'r');hold (plotAxes,'off');
%************CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC**************************************
% Store L R and K valves for 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
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])
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
gene=usrGnSp; orf='' % MP(1,LBmp).orf{1,1}(indx);
geneOrfstr=strcat(gene,'_',orf,'_');
grfgenestr=strcat(gene,'_',orf,'_');
@@ -259,7 +219,6 @@ if expN==3,DMstr=char(get(handles.DM3,'string'));end
% graphStr=strcat(grfgenestr,'_','L=',Lstr,'_','r=',rstr,'_','K=',Kstr);
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,
slashPos=strfind(char(Exp(zoneSel).Dexp(DexpN).resDir),'\');
@@ -284,58 +243,12 @@ 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'
catch ME
msg='ME.message';
end % trycatch zoneSel<4 datatip selection from Image (not from an OverLay Plot)
% Deprecated functions
%{
% If a specific spot median is ever needed
%Calc. of EXACT median specific culture requires an odd number of indx items

View File

@@ -1,13 +1,12 @@
% GraphicDestinationPertibationComparison**15_821
% Called by EZlstBoxExt or EZvDatatip.m, Then calls EZRFs4DayComp
CompositeTrendFlg=0;
if expN==1 && get(ghandles.CompositeTog1,'value')==1 ||...
expN==2 && get(ghandles.CompositeTog2,'value')==1 ||...
expN==3 && get(ghandles.CompositeTog3,'value')==1.
if expN==1 && get(ghandles.CompositeTog1,'value')==1 ...
|| expN==2 && get(ghandles.CompositeTog2,'value')==1 ...
|| expN==3 && get(ghandles.CompositeTog3,'value')==1
CompositeTrendFlg=1;
end
% if (isequal(destcompMsg,'GoodDataTip')&&~isequal(destcompMsg, 'BadDataTip'))|| isequal(destcompMsg,'Olay')
% hold off
if expN==1,DexpN=(get(ghandles.DN1,'value')); end
@@ -21,9 +20,6 @@
if expN==3,pertSel=floor(get(ghandles.DMsldr3,'value')); end
dmSel=pertSel;
if EZdatatip==1 %adaptation for image spot selection
%plNums=plateNum;
destPerMP=Exp(expN).Dexp(DexpN).destPerMP;
@@ -33,11 +29,9 @@ if EZdatatip==1 %adaptation for image spot selection
if zoneSel==1,Dlaxes=ghandles.Dlaxes1;Dkaxes=ghandles.Dkaxes1;Draxes=ghandles.Draxes1; end
if zoneSel==2,Dlaxes=ghandles.Dlaxes2;Dkaxes=ghandles.Dkaxes2;Draxes=ghandles.Draxes2; end
if zoneSel==3,Dlaxes=ghandles.Dlaxes3;Dkaxes=ghandles.Dkaxes3;Draxes=ghandles.Draxes3; end
if zoneSel==1,DNLaxes=ghandles.DNLaxes1;end
if zoneSel==2,DNLaxes=ghandles.DNLaxes2;end
if zoneSel==3,DNLaxes=ghandles.DNLaxes3;end
elseif EZdatatip==2 % adaption for Overlay plot selection
destPerMP=Exp(expN).Dexp(DexpN).destPerMP;
MPlateN=ceil(OLplateNum/destPerMP);
@@ -50,7 +44,6 @@ elseif EZdatatip==2 %adaption for Overlay plot selection
if zoneSel==1,DNLaxes=ghandles.DNLaxes1;end %2016_0222
if zoneSel==2,DNLaxes=ghandles.DNLaxes2;end %2016_0222
if zoneSel==3,DNLaxes=ghandles.DNLaxes3;end %2016_0222
elseif EZdatatip==0
if lstBoxCmpFlg~=1
% destPerMP=Exp(expN).Dexp(DexpN).destPerMP;
@@ -70,19 +63,16 @@ elseif EZdatatip==0
end
if EZdatatip==2 % Response to Overlay click
%++++++++++++++++++++LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL+++++++++++++++++++++++
% seltraceN comes from EZvDatatip;
% Exp(OLay).seltraceN iscaptured from EZvDatatip
% if an OLay trace is selected
% else it is captured below if EZdatatip is not equal to 2
try
set(Exp(zoneSel).hLRF1(seltraceN),'visible','on'); set(Exp(zoneSel).hLRF2(seltraceN),'visible','on');
catch, end
try
set(Exp(zoneSel).hL(seltraceN),'visible','on'); set(Exp(zoneSel).hLb(seltraceN),'visible','on');
catch, end
% Plot new intL
try
set(Exp(zoneSel).hintL(seltraceN),'visible','on'); set(Exp(zoneSel).hintLb(seltraceN),'visible','on');
@@ -92,7 +82,7 @@ if EZdatatip==2 %Response to Overlay click
catch, end
if zoneSel==1,set(ghandles.DNLaxes1,'xlim',[-75,75]); end
%++++++++++++++++++++++KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK++++++++++++++++++++++
% K values
for J=1:(tracN),
try
set(Exp(zoneSel).hKRF1(J),'visible','off'); set(Exp(zoneSel).hKRF2(J),'visible','off');
@@ -107,8 +97,7 @@ if EZdatatip==2 %Response to Overlay click
try
set(Exp(zoneSel).hK(seltraceN),'visible','on'); set(Exp(zoneSel).hKb(seltraceN),'visible','on');
catch, end
%+++++++++++++++++++++rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr+++++++++++++++++++++++++++++
for J=1:(tracN),
for J=1:(tracN)
try
set(Exp(zoneSel).hrRF1(J),'visible','off'); set(Exp(zoneSel).hrRF2(J),'visible','off');
catch, end
@@ -122,8 +111,7 @@ if EZdatatip==2 %Response to Overlay click
try
set(Exp(zoneSel).hr(seltraceN),'visible','on'); set(Exp(zoneSel).hrb(seltraceN),'visible','on');
catch, end
else %if EZdatatip==1 or if EZdatatip==0 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
else % if EZdatatip==1 or if EZdatatip==0
% Attempt fix for overlaying L and intL from image datatip==1 18_0103
try
set(Exp(zoneSel).hLRF1(seltraceN),'visible','off'); set(Exp(zoneSel).hLRF2(seltraceN),'visible','off');
@@ -140,40 +128,29 @@ else %if EZdatatip==1 or if EZdatatip==0 ++++++++++++++++++++++++++++++++++++++
set(Exp(zoneSel).hintLadj(seltraceN),'visible','off'); set(Exp(zoneSel).hintLadjb(seltraceN),'visible','off');
catch, end
%*************Plot RFmd1 and RFmd2 indexes*********************
% Plot RFmd1 and RFmd2 indexes
if lstBoxCmpFlg~=1 % If selection is a "normal" item with a location in the label
days=Exp(expN).DexpLength;
for nn=1:Exp(expN).DexpLength % length(Exp(zoneSel).Dexp)
RFconfig=Exp(zoneSel).Dexp(DexpN).RFconfig;
%*****************************
EZRFs4DayComp %***************
%*****************************
EZRFs4DayComp
if lstBoxCmpFlg~=1
Exp(zoneSel).seltraceN=tracN;
seltraceN=tracN;
end
%**************Plot L K r for all Day pertibation(XdestinationX) Plates***************
try RF1mdNums= (RF1mdPltN-1)*destPerMP + (pertSel); catch, end %RF1mdPltN %
try RF2mdNums= (RF2mdPltN-1)*destPerMP + (pertSel); catch, end %RF2mdPltN %
% Plot L K r for all Day pertibation(XdestinationX) Plates
try RF1mdNums=(RF1mdPltN-1)*destPerMP + (pertSel); catch, end % RF1mdPltN
try RF2mdNums=(RF2mdPltN-1)*destPerMP + (pertSel); catch, end % RF2mdPltN
if CompositeTrendFlg==0 || EZdatatip==1
lvals(nn)=Exp(zoneSel).Dexp(nn).scan(1,plNums(pertSel)).plate(1).CFout(indx,5);
if lvals(nn)==0, lvals(nn)=140; end
kvals(nn)=Exp(zoneSel).Dexp(nn).scan(1,plNums(pertSel)).plate(1).CFout(indx,3);
rvals(nn)=Exp(zoneSel).Dexp(nn).scan(1,plNums(pertSel)).plate(1).CFout(indx,4);
Exp(expN).Trace(traceN).dmSel=pertSel;
Exp(expN).Trace(traceN).UsrGLB=selGnOrf; %usrGnSp;
Exp(expN).Trace(tracN).Dexp(nn).DM(pertSel).UsrLvals=lvals(nn);
Exp(expN).Trace(tracN).Dexp(nn).DM(pertSel).UsrKvals=kvals(nn);
Exp(expN).Trace(tracN).Dexp(nn).DM(pertSel).Usrrvals=rvals(nn);
elseif CompositeTrendFlg==1 && EZdatatip==0 % Gene-Specifics Composite from listBox
days=Exp(expN).DexpLength;
if iscell(Exp(expN).Trace(tracN).Dexp(nn).DM(dmSel).UsrLvals)
@@ -187,8 +164,7 @@ Exp(expN).Trace(tracN).Dexp(nn).DM(pertSel).Usrrvals= rvals(nn);
kvals(nn)=median(Exp(expN).Trace(tracN).Dexp(nn).DM(dmSel).UsrKvals);
rvals(nn)=median(Exp(expN).Trace(tracN).Dexp(nn).DM(dmSel).Usrrvals);
end
end %if CompositeTrendFlg==0 || EZdatatip==1
end
try
% lvalsRF1md(nn)=Exp(zoneSel).Dexp(nn).scan(1,RF1mdNums).plate(1).CFout(RF1mdIndx(nn),5);
lvalsRF1md(nn)=RFmdVal(nn); %RFmdVal(nn) gets the above if 'F', or the global median if 'G' or the local median if 'L' selected
@@ -215,7 +191,6 @@ Exp(expN).Trace(tracN).Dexp(nn).DM(pertSel).Usrrvals= rvals(nn);
rvalsRF1md(nn)=Exp(zoneSel).Dexp(nn).scan(1,RF1mdNums).plate(1).CFout(RF1mdIndx,4);
catch
end
% Added for INTERACTION Calculating Utility 2016_0219
try
if CompositeTrendFlg==0 || EZdatatip==1 % 18_0103 Add || EZdatatip==1
@@ -235,23 +210,18 @@ Exp(expN).Trace(tracN).Dexp(nn).DM(pertSel).Usrrvals= rvals(nn);
else
deltaXR(nn)=Xhn(nn)-(Rn(nn)-Rs(nn));
end
catch
msg='No Refs! ->No Interaction Calculations!'
end
end %for nn=1:Exp(expN).DexpLength
%**************************ELSEIF
elseif lstBoxCmpFlg==1 %Determine values of RF1cmp or RFcmpG
end
elseif lstBoxCmpFlg==1 % determine values of RF1cmp or RFcmpG
days=Exp(expN).DexpLength;
if strcmp(Exp(expN).DexpType,'chrono'), DM=inDM; else DM=pertSel; end % else DM=dmSel;
Exp(zoneSel).seltraceN=tracN; % added fix 2020_1103
seltraceN=tracN; % added fix 2020_1103
for nn=1:Exp(expN).DexpLength % length(Exp(zoneSel).Dexp)
RFconfig=Exp(zoneSel).Dexp(DexpN).RFconfig;
%*****************************
EZRFs4DayComp %***************
%*****************************
EZRFs4DayComp
if RFcmpGFlg==0 % RF1cmp or RF2cmp clicked
lvals(nn)=Exp(expN).Dexp(nn).RFcmpL(RFnum).dm(DM).med;
if lvals(nn)==0, lvals(dm)=140; end
@@ -263,7 +233,6 @@ Exp(expN).Trace(tracN).Dexp(nn).DM(pertSel).Usrrvals= rvals(nn);
kvals(nn)=Exp(expN).Dexp(nn).RFcmpGK.dm(DM).med; % Ks=num2str(K);
rvals(nn)=Exp(expN).Dexp(nn).RFcmpGr.dm(DM).med; % rs=num2str(r);
end
% Added for INTERACTION Calculating Utility 2016_0219
try
Xn(nn)=lvals(nn);
@@ -282,30 +251,16 @@ Exp(expN).Trace(tracN).Dexp(nn).DM(pertSel).Usrrvals= rvals(nn);
else
deltaXR(nn)=Xhn(nn)-(Rn(nn)-Rs(nn));
end
catch
msg='No Refs! ->No Interaction Calculations!'
end
end % Second for nn loop lstBoxCmpFlg==1 %for nn=1:Exp(expN).DexpLength
end %if lstBoxCmpFlg~= 1
end
end
%end
%///////////////////////////////////////////////////////////////////
%XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
%***********INTERACTION Plotting Utility 2016_0219*********************************************
% Interaction Plotting Utility 2016_0219
try
if Rn(1)==0, % If Ref mean is zero
if Rn(1)==0 % If Ref mean is zero
intL=0; proGrIntL=0; intLadj=0; proGrIntLadj=0;
intNormL=6.66;intNormLadj=6.66; proGrIntNormL=6.66;proGrIntNormLadj=6.66;
else
@@ -313,14 +268,12 @@ else
intL=(Xn-Rn);
intL(Xn==0)=140;
intLadj=(deltaXR);
Exp(expN).Trace(tracN).Dexp(DexpN).UsrIntL=intL;
end
catch
FailMessage='Problem with Reference Rn value; Unable to produce Interaction values! Ln119 EZdestComp'
end
hidem(ghandles.Daxes1)
if zoneSel==1,showm(ghandles.Dlaxes1);showm(ghandles.Dkaxes1);showm(ghandles.Draxes1);end
if zoneSel==2,showm(ghandles.Dlaxes2);showm(ghandles.Dkaxes2);showm(ghandles.Draxes2);end
@@ -333,7 +286,6 @@ end
if zoneSel==3,showm(ghandles.DNLaxes3); end
set(DNLaxes,'NextPlot','add');
%+++++++++++++++++LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL+++++++++++++++++++++++++++++++++
% Make visible the current L plot and store it for retrieval by OLay code
% Plot RF1 and/or RF2 OR if No RF1-RF2 Plot RFcmpGL
try %Some experiments do not have ref. plates
@@ -358,17 +310,16 @@ end
Exp(zoneSel).hLRF1(tracN)=plot(Dlaxes,lvalsRF1md,1:days,'y');
catch
end
%************************************************************
%Plot USER SELECTION DATA**************************************
% Plot User Selection Data
try
Exp(zoneSel).hL(tracN)=plot(Dlaxes,lvals,1:days); Exp(zoneSel).hLb(tracN)=plot(Dlaxes,lvals,1:days,'rs');
catch
end
%*************************************************************
if zoneSel==1,set(ghandles.Dlaxes1,'xlim',[0,140]); end
if zoneSel==2,set(ghandles.Dlaxes2,'xlim',[0,140]); end
if zoneSel==3,set(ghandles.Dlaxes3,'xlim',[0,140]); end
%*************************************************
% Make visible Plot for Interaction Data, Store and Hide unless a N (InteractionPBsel) set that plot on Top of the RawData Plots.
% Plot new intL
try
@@ -376,17 +327,14 @@ end
% 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,
catch
end
if zoneSel==1,set(ghandles.DNLaxes1,'xlim',[-75,75]); end
if zoneSel==2,set(ghandles.DNLaxes2,'xlim',[-75,75]); end
if zoneSel==3,set(ghandles.DNLaxes3,'xlim',[-75,75]); end
%+++++++++++++++++KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK+++++++++++++++++++++++++++++++++++++++++++++++++++++++
% Hide all K plots
for J=1:(tracN-1),
for J=1:(tracN-1)
try
set(Exp(zoneSel).hKRF1(J),'visible','off'); set(Exp(zoneSel).hKRF2(J),'visible','off');
catch, end
@@ -394,6 +342,7 @@ end
set(Exp(zoneSel).hK(J),'visible','off'); set(Exp(zoneSel).hKb(J),'visible','off');
catch, end
end
% Make visible the current L plot and store it for retrieval by OLay code
try % Some experiments do not have ref. plates
Exp(zoneSel).hKRF1(tracN)=plot(Dkaxes,kvalsRF1md,1:days,'y');
@@ -404,10 +353,9 @@ end
catch, end
set(Dkaxes,'xlim',[0,200]) % max(kvals+20)
set(Dkaxes,'ycolor',[.9,.9,1])
%++++++++++++++++++rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr+++++++++++++++++++++++++++++++++++++++++++++++
%Hide all r plots
for J=1:(tracN-1),
% Hide all r plots
for J=1:(tracN-1)
try
set(Exp(zoneSel).hrRF1(J),'visible','off'); set(Exp(zoneSel).hrRF2(J),'visible','off');
catch, end
@@ -415,6 +363,7 @@ end
set(Exp(zoneSel).hr(J),'visible','off'); set(Exp(zoneSel).hrb(J),'visible','off');
catch, end
end
% Make visible the current r plot and store it for retrieval by OLay code
try % Some experiments do not have ref. plates
Exp(zoneSel).hrRF1(tracN)=plot(Draxes,rvalsRF1md,1:days,'y');
@@ -425,10 +374,7 @@ end
catch, end
set(Draxes,'xlim',[0,1])
set(Draxes,'ycolor',[.9,.9,1])
end %if EZdatatip==2 Response to Overlay click
end
if CompositeTrendFlg==1 && EZdatatip~=0
% lbLKr=strcat(gene,'_',spec,'_');
@@ -448,16 +394,13 @@ end
if zoneSel==3, set(ghandles.geneOrfLKr3,'string', grfgenestr);end
%*********************************************************************************************************************
%*********************************************************************************************************************
%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%___________________________________Display Selection PlotFilter ____________________
% Display Selection PlotFilter
if lstBoxCmpFlg~=1,
seltraceN=Exp(zoneSel).seltraceN
end
if EZdatatip==0, seltraceN=tracN; end
if Exp(4).interacPBsel==0 %00000000000000000000000000000
if Exp(4).interacPBsel==0
% replace ghandles.DNLaxes1 (Dlaxes2)etc. with a single
% Exp(zoneSel).DNLaxes,....
set(ghandles.Dlaxes1,'Visible','on')
@@ -474,7 +417,6 @@ end
try
set(Exp(zoneSel).hL(n),'visible','off'); set(Exp(zoneSel).hLb(n),'visible','off');
catch, end
try
set(Exp(zoneSel).hintL(n),'visible','off'); set(Exp(zoneSel).hintLb(n),'visible','off');
catch, end
@@ -492,10 +434,7 @@ end
for i=1:Exp(zoneSel).expLoadCnt,
try set(Exp(zoneSel).hzeroCLn(i),'visible','off'); catch ME, end
end
elseif Exp(4).interacPBsel==1 %111111111111111111111111111
elseif Exp(4).interacPBsel==1
set(ghandles.DNLaxes1,'Visible','on')
set(ghandles.DNLaxes2,'Visible','on')
set(ghandles.DNLaxes3,'Visible','on')
@@ -503,7 +442,6 @@ end
set(ghandles.Dlaxes2,'Visible','off')
set(ghandles.Dlaxes3,'Visible','off')
for n=1:Exp(zoneSel).traceN
try set(Exp(zoneSel).hLRF1(n),'visible','off'); catch, end
try set(Exp(zoneSel).hLRF2(n),'visible','off'); catch, end
@@ -513,24 +451,11 @@ end
end
try set(Exp(zoneSel).hintL(seltraceN),'visible','on'); set(Exp(zoneSel).hintLb(seltraceN),'visible','on'); catch, end
try set(Exp(zoneSel).hintLadj(seltraceN),'visible','on'); set(Exp(zoneSel).hintLadjb(seltraceN),'visible','on'); catch, end
for i=1:Exp(zoneSel).expLoadCnt,
for i=1:Exp(zoneSel).expLoadCnt
try set(Exp(zoneSel).hzeroCLn(i),'visible','on'); catch ME, end
end
elseif Exp(4).interacPBsel==2 %2222222222222222222222222222 TEMPorily Same as interacPBsel==1
% set(ghandles.DNLaxes1,'Visible','on')
%set(ghandles.Dlaxes1,'Visible','off')
end %if Exp(4).interacPBsel==0
%pause(2)
%------------------------------------------------------------------------------------------------------------
%=====================================================================================================================
%end %if isempty(msg)
elseif Exp(4).interacPBsel==2
end
%{
% Attempt fix for overlaying L and intL from image datatip==1 18_0103
@@ -552,7 +477,6 @@ end
set(Exp(zoneSel).hintLadj(seltraceN),'visible','off'); set(Exp(zoneSel).hintLadjb(seltraceN),'visible','off');
catch, end
end
%}

View File

@@ -8,8 +8,8 @@ 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]))))
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

View File

@@ -1,3 +1,4 @@
% Is the callback supposed to be nested?
function EZmultiDayGui
%global Exp
global exDlst
@@ -6,21 +7,17 @@ global exDlst
btnWid=0.10;
btnHt=0.05;
spacing=0.02;% Spacing between the button and the next command's label
%====================================
% The ADD Groups button
btnNumber=1;
yPos=0.85-(btnNumber-1)*(btnHt+spacing);
btnPos=[xPos yPos-spacing btnWid btnHt];
%fhImParm=gcf;
%====================================
exFolder=uigetdir
exDirs=dir(exFolder)
exFs={exDirs.name}
f=figure('Menubar','none','Position',[1000 100 640 750],'Name','Select Exp Folders' );
hListbox=uicontrol(...
'Style', 'listbox',...
@@ -33,7 +30,6 @@ hListbox=uicontrol(...
'callback',{@load_listbox}); % 'uiresume(gcbf)'); 'Position', [5 100 60 20])
function load_listbox(source,eventdata)
% global CSrchRng
% global CSrearchRange
userIndx=(get(source,'value'))
@@ -42,9 +38,8 @@ userStr=(get(source,'string'))
user_entry=userStr(userIndx)
exDlst=user_entry
end
exFs
btnNumber=10;
@@ -62,6 +57,5 @@ uiwait(gcf);
close(f)
end
%*******************
% EZmultiDay
%*****************************************************************

View File

@@ -1,4 +1,4 @@
% EZmultiDayGui.m called by EZexpSel.m ln957 && ln963
% EZmultiDayGui.m called by EZexpSel.m
% EZmultiday is called after this EZmultiDayGui.m also by EZexpSel.m
function EZmultiDayGui

View File

@@ -1,5 +1,6 @@
% EZmultiExLoad
% Calls to EZVimDisplay (ln 185) EZmultiGeneRFsLst (ln213) EZdiagRFsSheet(ln218)
% TODO this file could use some elseif's
global Exp
global zonePB
@@ -13,15 +14,12 @@ expN=zonePB; % added to accomodate AppDesigner limitations 230821
Exp(expN).UgeneCnt=0;
Exp(expN).DexpLength=size(matFile,2); DexpLength=size(matFile,2);
for n=1:Exp(expN).DexpLength % size(matFile,2)
if expN==1
orfLstSel=get(handles.GeneOrfTog,'value');
end
if expN==2
orfLstSel=get(handles.GeneOrfTog,'value');
end
if expN==3
orfLstSel=get(handles.GeneOrfTog,'value');
end
@@ -63,13 +61,12 @@ Exp(expN).Dexp(n).FexpScanSpots= Exp(expN).Dexp(n).temp.FexpScanSpots;
Exp(expN).Dexp(n).FexpScanBMtp=Exp(expN).Dexp(n).temp.FexpScanBMtp;
Exp(expN).Dexp(n).anlZoneRefs=Exp(expN).Dexp(n).temp.anlZoneRefs;
Exp(expN).Dexp(n).ImParMat=Exp(expN).Dexp(n).temp.ImParMat;
Exp(expN).Dexp((Exp(expN).DexpLength+1):end)=[];
Exp(expN).Dexp(n).temp=[];
end
end %for n=1:size(matFile,2)
%Load First new ExpJOb*****************
if expN==1,
% Load First new ExpJOb
if expN==1
tPtsSize=size(Exp(expN).Dexp(1).FexpScanBMtp{1,1},(3)); %size(FexpScanBMtp{1,1},3);
set(handles.MPsldr1,'max',MPnum); %length(MP)
set(handles.DMsldr1,'max',length(DM.drug));
@@ -121,7 +118,7 @@ set(handles.DN2,'value',1)
set(handles.DN2,'string',1)
end
if expN==3,
if expN==3
% Exp(3).traceN=0;
tPtsSize=size(Exp(expN).Dexp(1).FexpScanBMtp{1,1},(3)); % size(FexpScanBMtp{1,1},3);
set(handles.MPsldr3,'max',MPnum);
@@ -133,7 +130,6 @@ DMnum= length(Exp(expN).Dexp(1).DM.drug);
set(handles.DMsldr3,'min',1,'max',DMnum)
tPtsSize=size(Exp(expN).Dexp(1).FexpScanBMtp{1,1},(3));
set(handles.Tptsldr3,'min',1,'max',tPtsSize)
set(handles.MPsldr3,'value',1)
set(handles.DMsldr3,'value',1)
set(handles.Tptsldr3,'value',1)
@@ -143,34 +139,33 @@ set(handles.Tpted3,'string','1')
set(handles.MPsldr3,'SliderStep',[1/MPnum 1/MPnum]); % 1/length(MP) 1/length(MP)])
set(handles.DMsldr3,'SliderStep',[1/length(DM.drug) 1/length(DM.drug)]);
set(handles.Tptsldr3,'SliderStep',[1/tPtsSize 1/tPtsSize]);
set(handles.DN3,'value',1)
set(handles.DN3,'string',1)
end
if expN==1,set(handles.GeneOrfLoc1,'string',{''});
if expN==1
set(handles.GeneOrfLoc1,'string',{''});
set(handles.graphStrLoc1,'string',{''});
cla(handles.Paxes1)
end
if expN==2,set(handles.GeneOrfLoc2,'string',{''});
if expN==2
set(handles.GeneOrfLoc2,'string',{''});
set(handles.graphStrLoc2,'string',{''});
cla(handles.Paxes2)
end
if expN==3,set(handles.GeneOrfLoc3,'string',{''});
if expN==3
set(handles.GeneOrfLoc3,'string',{''});
set(handles.graphStrLoc3,'string',{''})
cla(handles.Paxes3)
end
Exp(expN).Dexp(1).srtGnLst={('CheckMP/MPDMfile')};
Exp(expN).Dexp(1).srtOrfLst={('CheckMP/MPDMfile')};
set(handles.listboxGnOrf,'value',1) %Fix accomodation for bug in App Designer .. .wlapp converter 230918
set(handles.listboxGnOrf,'string',Exp(expN).Dexp(1).srtGnLst)
set(handles.listboxGnOrf,'string',Exp(expN).Dexp(1).srtOrfLst)
%--------------------------------------------------------------------------
%*********************
EZVimDisplay %*
%*********************
EZVimDisplay
usrRefFg=0;
prompt={'Enter GeneName to use as Reference:',...
@@ -191,63 +186,52 @@ EZVimDisplay %*
if strcmpi(rfSpec,'None'), rfGnSp={strcat(rfGene,'-')}; end
% Added 17-1023 For User Addition of Gene Composites to ListBox
Expaa{expN,1}= []; Expbb{expN,1}= [];
Expaa{expN,1}=[]
Expbb{expN,1}=[];
for n=1:size(matFile,2)
%*********************************************************************
try
EZmultiGeneRFsLst %**
EZmultiGeneRFsLst
catch
msg='EZmultiGeneRFLst failed possibly Too Few non-zero Median spots'
end
%*********************************************************
EZdiagRFsSheet %**
%********************
EZdiagRFsSheet
Exp(expN).Dexp(n).RFrnames=rnames;
Exp(expN).Dexp(n).RFdata=data;
%*********************************************************
RFconfig=0;
if sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmean'))&&...
~isempty(Exp(expN).Dexp(n).RFmean)&&...
sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmeanG'))&&...
isempty(Exp(expN).Dexp(n).RFmeanG)
if sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmean')) ...
&& ~isempty(Exp(expN).Dexp(n).RFmean) ...
&& sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmeanG')) ...
&& isempty(Exp(expN).Dexp(n).RFmeanG)
RFconfig=1;
end
if sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmean'))==0 ||...
isempty(Exp(expN).Dexp(n).RFmean)&&...
sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmeanG'))&&...
~isempty(Exp(expN).Dexp(n).RFmeanG)
if sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmean'))==0 ...
|| isempty(Exp(expN).Dexp(n).RFmean) ...
&& sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmeanG')) ...
&& ~isempty(Exp(expN).Dexp(n).RFmeanG)
RFconfig=2;
end
if sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmean'))&&...
~isempty(Exp(expN).Dexp(n).RFmean)&&...
sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmeanG'))&&...
~isempty(Exp(expN).Dexp(n).RFmeanG)
if sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmean')) ...
&& ~isempty(Exp(expN).Dexp(n).RFmean) ...
&& sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmeanG')) ...
&& ~isempty(Exp(expN).Dexp(n).RFmeanG)
RFconfig=3;
end
Exp(expN).RFconfig=RFconfig;
Exp(expN).Dexp(n).RFconfig=RFconfig;
%**********************************************
try msgBadGeneName, catch, end
try msgBadGeneName
catch, end
try
Exp(expN).Dexp(n).resetHtmpTg =5; %Exp(expN).resetHtmpTg =5;
if RFconfig==0,
if RFconfig==0
RFconfigMsg='No RF1 references in this Experiment Job'
Exp(expN).Dexp(n).resetHtmpTg =3; %Exp(expN).resetHtmpTg =3;
end
catch
end
%***************************
%*********************************************************************
end
%###############################################################################
%********Auto select Zone and load listboxGnOrf data**********
% Auto Select Zone And Load Listboxgnorf Data
DexpN=1;
zeroCLn=zeros(1,DMnum);
Exp(expN).expLoadCnt=Exp(expN).expLoadCnt+1; expLdCnt=Exp(expN).expLoadCnt;
@@ -258,7 +242,6 @@ if expN==1 %Adapted to accomodate AppDesigner 230821
set(handles.zonePB1,'BackgroundColor',[1.0 0.6 0.6])
set(handles.zonePB2,'BackgroundColor',[1.0 1.0 1.0])
set(handles.zonePB3,'BackgroundColor',[1.0 1.0 1.0])
orfLstSel=get(handles.GeneOrfTog,'value')
if orfLstSel==1
set(handles.listboxGnOrf,'string',Exp(1).Dexp(1).srtOrfLst)
@@ -284,7 +267,6 @@ if expN==2 %Adapted to accomodate AppDesigner 230821
end
DNLaxes2=handles.DNLaxes2;
Exp(2).hzeroCLn(expLdCnt)=plot(DNLaxes2,zeroCLn,1:DMnum,'y');
end
if expN==3 % Adapted to accomodate AppDesigner 230821
@@ -314,7 +296,6 @@ if Exp(4).interacPBsel==0 %if interaction "raw" don't show a center line
end
end
%***************************
% HtMapTog 'string', 'Current user L/N' selection'
Exp(expN).Dexp(DexpN).spotIndx=[];
if expN==1,
@@ -334,5 +315,3 @@ if expN==3,
end
htMapTogPBfg=0;
%*******************************************************************

View File

@@ -2,8 +2,8 @@
% Called by EZmultiExLoad about line173 Which is called by EZexpSel
% User Select Reference Gene and Specifics Added
%****Compile GeneList and OrfList,****************************************
%****Sort and add the medians of Ref Plates if RF1,RF2 exist**************
% Compile GeneList and OrfList
% Sort and add the medians of Ref Plates if RF1,RF2 exist
clear aa bb c uu vv drf drfPindx drfr drfc
clear RF1scanN RF2scanN
@@ -18,26 +18,22 @@ end
DMnum=length(Exp(expN).Dexp(n).DM.drug);
tPtsSize=size(Exp(expN).Dexp(n).FexpScanBMtp{1,1},(3)); %size(FexpScanBMtp{1,1},3);
%*********************************
lstindx=0;
lstindxOrf=0;
spN=0; Exp(expN).Dexp(n).RFrnames %<--???
spN=0;
Exp(expN).Dexp(n).RFrnames %<--???
rfcnt=0;
dRF1indx=0;
RF1mp=[]; RF2mp=[];
rfSp=cell2mat(rfSpec); % user entry of Specifics for Ref selection
%*******************************************************
for mp=1:MPnum
% RF1fullPlate=0;
for ind384=1:384
spN=spN+1;
try %
try
r=ceil(ind384/24);
if rem(ind384,24)==0, c=24; else c=rem(ind384,24); end
% 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(n).MP(mp).genename{1}(ind384))==38991,
@@ -50,7 +46,6 @@ for mp=1:MPnum
try RF1fullPlate=sum(ismember((Exp(expN).Dexp(n).MP(mp).genename{1}),rfGene))==384; catch, mp, msg=strcat(num2str(mp),' genename ERROR'), end
RF2fullPlate=0;
try RF2fullPlate=sum(ismember((Exp(expN).Dexp(n).MP(mp).genename{1}),'RF2'))==384; catch, mp, msg=strcat(num2str(mp),' genename ERROR'), end
%*************************************************************************
% Capture non-reference spot location and ORF data
if isempty(regexpi(char((Exp(expN).Dexp(n).MP(mp).orf{1}(ind384))),'blank'))... %'\<blank\>'
&& ~isnumeric(Exp(expN).Dexp(n).MP(mp).orf{1}(ind384))...
@@ -58,13 +53,12 @@ for mp=1:MPnum
&& ~strcmpi((Exp(expN).Dexp(n).MP(mp).orf{1}(ind384)),' ')...
&& ~strcmpi((Exp(expN).Dexp(n).MP(mp).orf{1}(ind384)),'')...
&& ~isempty((Exp(expN).Dexp(n).MP(mp).orf{1}(ind384)))...
&& ((~strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),rfGene)|| ~strcmpi((Exp(expN).Dexp(n).MP(mp).specifics{1}(ind384)),rfSp))&&...
(~strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),rfGene)|| ~strcmpi(rfSp,'None')))...
&& ((~strcmpi((Exp(expN).Dexp(n).MP(mp).orf{1}(ind384)),rfGene)|| ~strcmpi((Exp(expN).Dexp(n).MP(mp).specifics{1}(ind384)),rfSp))&&...
(~strcmpi((Exp(expN).Dexp(n).MP(mp).orf{1}(ind384)),rfGene)|| ~strcmpi(rfSp,'None')))...
&& ((~strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),rfGene)|| ~strcmpi((Exp(expN).Dexp(n).MP(mp).specifics{1}(ind384)),rfSp))...
&& (~strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),rfGene)|| ~strcmpi(rfSp,'None')))...
&& ((~strcmpi((Exp(expN).Dexp(n).MP(mp).orf{1}(ind384)),rfGene)|| ~strcmpi((Exp(expN).Dexp(n).MP(mp).specifics{1}(ind384)),rfSp))...
&& (~strcmpi((Exp(expN).Dexp(n).MP(mp).orf{1}(ind384)),rfGene)|| ~strcmpi(rfSp,'None')))...
&& (~strcmpi((Exp(expN).Dexp(n).MP(mp).orf{1}(ind384)),'RF2')||~strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),'RF2'))...
&& iscellstr((Exp(expN).Dexp(n).MP(mp).orf{1}(ind384)))
lstindxOrf=lstindxOrf+1;
Exp(expN).Dexp(n).MP(mp).orf{1}(ind384)=strrep((Exp(expN).Dexp(n).MP(mp).orf{1}(ind384)),':',' ');
bb(lstindxOrf,1)=(Exp(expN).Dexp(n).MP(mp).orf{1}(ind384));
@@ -72,10 +66,10 @@ for mp=1:MPnum
bb(lstindxOrf,3)={mp};
bb(lstindxOrf,4)={r};
bb(lstindxOrf,5)={c};
mutorfs(lstindxOrf)=spN; %16_0318 added for Interaction EZinteract
% Exp(expN).Dexp(n).mutSpotIndx(lstindxOrf)=spN; %16_0318 added for Interaction EZinteract
end
% Capture non-reference spot location and GENENAME data
if isempty(regexpi(char((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384))),'blank'))... %'\<blank\>'
&& ~isnumeric(Exp(expN).Dexp(n).MP(mp).genename{1}(ind384))...
@@ -83,11 +77,11 @@ for mp=1:MPnum
&& ~strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),' ')...
&& ~strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),'')...
&& ~isempty((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)))...
&& (~strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),rfGene) || ~strcmpi((Exp(expN).Dexp(n).MP(mp).specifics{1}(ind384)),rfSp))&&... % AddSpecifics rfSp && ~RF1fullPlate)...
(~strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),rfGene) || ~strcmpi(rfSp,'None'))...
&& (~strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),rfGene)...
|| ~strcmpi((Exp(expN).Dexp(n).MP(mp).specifics{1}(ind384)),rfSp))... % AddSpecifics rfSp && ~RF1fullPlate)...
&& (~strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),rfGene) || ~strcmpi(rfSp,'None'))...
&& (~strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),'RF2'))... % && ~RF2fullPlate)...
&& iscellstr((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)))
lstindx=lstindx+1;
Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)=strrep((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),':',' ');
aa(lstindx,1)=(Exp(expN).Dexp(n).MP(mp).genename{1}(ind384));
@@ -95,33 +89,27 @@ for mp=1:MPnum
aa(lstindx,3)={mp};
aa(lstindx,4)={r};
aa(lstindx,5)={c};
mutgenes(lstindx)=spN;
elseif (RF1fullPlate==1 ||... %sum(ismember((Exp(expN).Dexp(n).MP(mp).genename{1}),rfGene))==384 || ...
(((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 )) && ...
~exist('RF1scanN','var')))
elseif (RF1fullPlate==1 ... % sum(ismember((Exp(expN).Dexp(n).MP(mp).genename{1}),rfGene))==384 || ...
|| (((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 )) && ...
&& ~exist('RF1scanN','var')))
RF1mp=mp
RF1scanN=(mp*DMnum)-(DMnum-1) %mp;
RF1scanN=(mp*DMnum)-(DMnum-1)
rfcnt=rfcnt+1;
RFs(spN:spN+383)=spN:spN+383;
elseif (RF2fullPlate==1|| ... % sum(ismember((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),'RF2'))==384 ||...
(((length(unique(Exp(expN).Dexp(n).MP(mp).genename{1}(1:384))))==1 && mp==MPnum ) && ...
~exist('RF2scanN','var')))
RF2mp=mp
rfcnt=rfcnt+1;
RFs(spN:spN+383)=spN:spN+383;
RF2scanN= (mp*DMnum)-(DMnum-1) %mp;
RF2scanN=(mp*DMnum)-(DMnum-1)
% DISPersed REFerence capture and find Medians
elseif ( ((strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),rfGene) && ...
strcmpi((Exp(expN).Dexp(n).MP(mp).specifics{1}(ind384)),rfSp)))...
|| ((strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),rfGene) && ...
strcmpi(rfSp,'None'))) )...
&& (RF1fullPlate~=1),
elseif ( ((strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),rfGene) ...
&& strcmpi((Exp(expN).Dexp(n).MP(mp).specifics{1}(ind384)),rfSp))) ...
|| ((strcmpi((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),rfGene) ...
&& strcmpi(rfSp,'None'))) ) &&(RF1fullPlate~=1)
dRF1indx=dRF1indx+1;
Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)=strrep((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384)),':',' ');
drf(dRF1indx,1)=(Exp(expN).Dexp(n).MP(mp).genename{1}(ind384));
@@ -131,20 +119,16 @@ for mp=1:MPnum
drf(dRF1indx,5)={c}; drfc(dRF1indx,mp)=c;
drf(dRF1indx,6)={ind384}; drfPindx(dRF1indx,mp)=ind384;
% drf(dRF1indx,7)=(Exp(expN).Dexp(n).MP(mp).specifics{1}(ind384));
end % if isempty(regexpi(char((Exp(expN).Dexp(n).MP(mp).genename{1}(ind384))),'blank'))...
%*******************************************************************************
catch
error='EZexpSel lineAfter 24 EZmultiGeneLst.m'
mp % Disable in future to prevent a bomb out OR put into a nested TryCatch
ind384 % Disable in future to prevent a bomb out OR put into a nested TryCatch
msgBadGeneName=strcat('check genename at mp=',num2str(mp),' indx=',num2str(ind384))
end
end %end associated with for ind384=1:384
end
mp
end %end associated with for mp=1:length(Exp(expN).Dexp(n).MP)
%*****************************************************
end
% Cover case if mutorfs RFs are labeled RF1 or RF2
try
Exp(expN).Dexp(n).mutSpotIndx.wRFs=union(RFs, mutorfs);
@@ -159,11 +143,6 @@ end %end associated with for mp=1:length(Exp(expN).Dexp(n).MP)
Exp(expN).Dexp(n).mutSpotIndx.woRFs=mutorfs;
end
%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Exp(expN).Dexp(n).RFmd1indx=[];
Exp(expN).Dexp(n).RFmd1pltN=[];
Exp(expN).Dexp(n).RFmd1LB={[]};
@@ -226,10 +205,12 @@ if exist('RF1scanN','var')
try %if RF1scanN doesn't exist this addition to list will be skipped
nonZeroIndx=find(Exp(expN).Dexp(n).scan(rf1scN).plate(1).CFout(1:384,5));
if isempty(nonZeroIndx), nonZeroCnt=0, medianIndx= nonZeroIndx;
else nonZeroCnt=length(nonZeroIndx);
if isempty(nonZeroIndx)
nonZeroCnt=0
medianIndx=nonZeroIndx;
else
nonZeroCnt=length(nonZeroIndx);
end
%
if ~isempty(nonZeroIndx) && mod(nonZeroCnt,2)==0, medianIndx=nonZeroIndx(1:nonZeroCnt-1); end
if ~isempty(nonZeroIndx) && mod(nonZeroCnt,2)~=0, medianIndx=nonZeroIndx; end
clear medValLst
@@ -242,10 +223,8 @@ if ~isempty(nonZeroIndx) && length(medianIndx) > (.15*384) %To calc. a median, m
max1=max(medValLst);
std1=std(medValLst);
mean1=mean(medValLst);
kValLst=Exp(expN).Dexp(n).scan(rf1scN).plate(1).CFout(medianIndx,3); % For Ref Composite 17_1009
rValLst=Exp(expN).Dexp(n).scan(rf1scN).plate(1).CFout(medianIndx,4); % For Ref Composite 17_1009
mval1=median(medValLst); %mval1=median(Exp(expN).Dexp(n).scan(RF1mps).plate(1).CFout(1:384,5)); %CFout(1:383,5));
RFmd1pos=find(mval1==(Exp(expN).Dexp(n).scan(rf1scN).plate(1).CFout(1:384,5)));
RFmd1loc(1)=ceil(RFmd1pos/24); %calc r value
@@ -256,14 +235,13 @@ aa(lstindx,1)= {strcat('RF1md(',num2str(d+1),')')}; %{'RF1md'};
aa(lstindx,2)={strcat(':',num2str(RF1mp),':',num2str(RFmd1loc(1)),':',num2str(RFmd1loc(2)))}; %,'std_',num2str(std1))};
bb(lstindxOrf,1)={strcat('RF1md(',num2str(d+1),')')}; %remove string2cell brackets {...} %{'RF1md'};
bb(lstindxOrf,2)={strcat(':',num2str(RF1mp),':',num2str(RFmd1loc(1)),':',num2str(RFmd1loc(2)))}; %,'std_',num2str(std1))};
%Composite Reference Amalgum Plot **********************
% Composite Reference Amalgum Plot
lstindx=lstindx+1;
lstindxOrf=lstindxOrf+1;
aa(lstindx,1)={strcat('RF1cmp(',num2str(d+1),')')};
aa(lstindx,2)={''};
bb(lstindxOrf,1)={strcat('RF1cmp(',num2str(d+1),')')};
bb(lstindxOrf,2)={''};
%********************************************************
Exp(expN).Dexp(n).RFmd1LB(d+1)=strcat(aa(lstindx,1),aa(lstindx,2));
Exp(expN).Dexp(n).RFmd1indx(d+1)=RFmd1pos;
@@ -291,7 +269,6 @@ Exp(expN).Dexp(n).RFcmpr(1).dm(d+1).mean= mean(rValLst); %For Ref Composite 17_1
Exp(expN).Dexp(n).RFcmpr(1).dm(d+1).std=std(rValLst); %For Ref Composite 17_1009
Exp(expN).Dexp(n).RFcmpr(1).dm(d+1).min=min(rValLst); %For Ref Composite 17_1009
Exp(expN).Dexp(n).RFcmpr(1).dm(d+1).max=max(rValLst); %For Ref Composite 17_1009
else
% Need to set L r K values to zeros or pick the first spot with zeros
% Spot 1 could be other than zero as the median isn't calculated if
@@ -300,36 +277,26 @@ else
firstZero=find(((Exp(expN).Dexp(n).scan(rf1scN).plate(1).CFout(1:384,5))==0),1,'first')
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
end %~isempty(nonZeroIndx) && length(medianIndx) > (.15*384)
catch %try ~ln375
end
catch
medianCalcTryFailed1='Failed! Failed! Ln362 But process continued with placeholder P1ind384 spot value!'
try
firstZero=find(((Exp(expN).Dexp(n).scan(rf1scN).plate(1).CFout(1:384,5))==0),1,'first')
Exp(expN).Dexp(n).RFmd1indx(d+1)=firstZero;
catch
catchissue='Ln209'
Exp(expN).Dexp(n).RFmd1indx(d+1)=384; %if crapout,Then use spot384 as default to keep going
end
try
Exp(expN).Dexp(n).RFmd1pltN=RF1mp;
catch
catchissue='Ln209'
Exp(expN).Dexp(n).RFmd1pltN=1;
end
end
end
end
error='EZexpSel lineAfter 209'
end %try ~ln209
end %for d=0:DMnum
end % if exist('RF1scanN','var')
%**********************************************************************************
%Calc RF2 median if a full plate of RF2s exist**************************
% Calc RF2 median if a full plate of RF2s exist
Exp(expN).Dexp(n).RFmd2indx=[];
Exp(expN).Dexp(n).RFmd2pltN=[];
@@ -342,23 +309,24 @@ if exist('RF2scanN','var')
try %if RF2scanN doesn't exist this addition to list will be skipped
nonZeroIndx2=find(Exp(expN).Dexp(n).scan(rf2scN).plate(1).CFout(1:384,5));
if isempty(nonZeroIndx2), nonZeroCnt2=0; medianIndx2= nonZeroIndx2;
else nonZeroCnt2=length(nonZeroIndx2);
if isempty(nonZeroIndx2)
nonZeroCnt2=0;
medianIndx2=nonZeroIndx2;
else
nonZeroCnt2=length(nonZeroIndx2);
end
%
if ~isempty(nonZeroIndx2) && mod(nonZeroCnt2,2)==0, medianIndx2=nonZeroIndx2(1:nonZeroCnt2-1); end
if ~isempty(nonZeroIndx2) && mod(nonZeroCnt2,2)~=0, medianIndx2=nonZeroIndx2; end
clear medValLst2
clear kValLst2
clear rValLst2
if ~isempty(nonZeroIndx2) && length(medianIndx2) > (.15*384) %To calc. a median, more than 15% of spots must be nonZero
if ~isempty(nonZeroIndx2) && length(medianIndx2) > (.15*384) % to calc. a median, more than 15% of spots must be nonZero
medValLst2=Exp(expN).Dexp(n).scan(rf2scN).plate(1).CFout(medianIndx2,5);
medValList2{d+1}=medValLst2;
min2=min(medValLst2);
max2=max(medValLst2);
std2=std(medValLst2);
mean2=mean(medValLst2);
kValLst2=Exp(expN).Dexp(n).scan(rf2scN).plate(1).CFout(medianIndx2,3); %For Ref Composite 17_1009
rValLst2=Exp(expN).Dexp(n).scan(rf2scN).plate(1).CFout(medianIndx2,4); %For Ref Composite 17_1009
mval2=median(medValLst2); %mval2=median(Exp(expN).Dexp(n).scan(RF2mps).plate(1).CFout(1:383,5));
@@ -405,7 +373,6 @@ Exp(expN).Dexp(n).RFcmpr(2).dm(d+1).mean= mean(rValLst2); %For Ref Composite 17_
Exp(expN).Dexp(n).RFcmpr(2).dm(d+1).std=std(rValLst2); %For Ref Composite 17_1009
Exp(expN).Dexp(n).RFcmpr(2).dm(d+1).min=min(rValLst2); %For Ref Composite 17_1009
Exp(expN).Dexp(n).RFcmpr(2).dm(d+1).max=max(rValLst); %For Ref Composite 17_1009
else
% Pick the first spot with zeros
% Use that position to satisfy and keep process OK
@@ -413,14 +380,10 @@ else
firstZero2=find(((Exp(expN).Dexp(n).scan(rf2scN).plate(1).CFout(1:384,5))==0),1,'first')
Exp(expN).Dexp(n).RFmd2indx(d+1)=firstZero2;
Exp(expN).Dexp(n).RFmd2pltN=RF2mp;
try medValList2{d+1}=Exp(expN).Dexp(n).scan(rf2scN).plate(1).CFout(medianIndx2,5); nonZeroCnt2; catch, catchissue='Ln431', end
end
catch
medianCalcTryFailed2='Failed! Failed! Ln436 No RF1median But process continued with placeholder P1ind384 spot value!'
try
firstZero2=find(((Exp(expN).Dexp(n).scan(rf2scN).plate(1).CFout(1:384,5))==0),1,'first');
Exp(expN).Dexp(n).RFmd2indx(d+1)=firstZero2;
@@ -434,10 +397,7 @@ catch
catchissue='Ln448'
Exp(expN).Dexp(n).RFmd2pltN=1;
end
error='EZexpSel lineAfter 279'
end %if RF2scanN doesn't exist this addition to list will be skipped
end
clear RFcombValList
RFcombValList=cat(1,medValList1{d+1},medValList2{d+1});
Exp(expN).Dexp(n).RFmean(d+1)=mean(RFcombValList);
@@ -446,28 +406,23 @@ end %if RF2scanN doesn't exist this addition to list will be skipped
catch, Exp(expN).Dexp(n).RFmin(d+1)=0; end
try, Exp(expN).Dexp(n).RFmax(d+1)=max(RFcombValList);
catch, Exp(expN).Dexp(n).RFmax(d+1)=0; end
end %for d=0:DMnum ln446
end
elseif exist('RF1scanN','var')
Exp(expN).Dexp(n).RFmean=Exp(expN).Dexp(n).mean1;
Exp(expN).Dexp(n).RFstd=Exp(expN).Dexp(n).std1;
Exp(expN).Dexp(n).RFmin=Exp(expN).Dexp(n).min1;
Exp(expN).Dexp(n).RFmax=Exp(expN).Dexp(n).max1;
end %if exist('RF2scanN','var') ln445
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%*************************************************************************************************
%***********DISPERSE REFERENCE PLATES
% Disperse reference plates
Exp(expN).Dexp(n).RFmdPindx=[];
Exp(expN).Dexp(n).RFmdPpltN=[];
if exist('drf','var') % ('RF1scanN','var')
% 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,3))~=cell2mat(drf((j-1),3)), chgIndx(i)=j; i=i+1; end
end
@@ -476,20 +431,15 @@ chgIndx(length(chgIndx)+1)= length(drf)+1;
uu=zeros(size(drf,1),4);
uu(:,1:4)=cell2mat(drf(:,3:6));
vv=zeros(size(drf,1),DMnum); %(length(drf),DMnum);
%************************************
dMPs=unique(cell2mat(drf(:,3)));
%*****************************************
%{
for mm=1:MPnum
nonZrfIndx.mp{mm,:}=drfPindx((find(drfPindx(:,mm))),mm);
end
%}
% nzValsG=zeros(DMnum,size(drf,1));
% nzValsAcc=zeros(DMnum,384);
for mm=1:length(dMPs) % length(chgIndx)
for d=1:(DMnum)
medianIndxDisp=[];
NZrefIndxP=[];
@@ -497,27 +447,28 @@ vv= zeros(size(drf,1),DMnum); %(length(drf),DMnum);
medValLstDisp=[];
rf1scNdisp=((dMPs(mm)-1)*DMnum)+(d);
try % Determine the dispersed RFs median mean and std if such exist
% Determine the dispersed RFs median mean and std if such exist
try
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));
% vv=Exp(expN).Dexp(n).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5);
vv(chgIndx(mm):(chgIndx(mm+1)-1),d)=Exp(expN).Dexp(n).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5);
%For Global Ref Composite 17_1009 %**************************************************************************
% For Global Ref Composite 17_1009
vvK(chgIndx(mm):(chgIndx(mm+1)-1),d)=Exp(expN).Dexp(n).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,3);
vvr(chgIndx(mm):(chgIndx(mm+1)-1),d)=Exp(expN).Dexp(n).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,4);
%*****************************************************************************************************
nonZeroValsP=nonzeros(Exp(expN).Dexp(n).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5));
std1Disp=std(nonZeroValsP);
mean1Disp=mean(nonZeroValsP);
minDisp=min(nonZeroValsP);
maxDisp=max(nonZeroValsP);
drfVals=Exp(expN).Dexp(n).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5);
% nzValsAcc(mm).DM(d,:)=nonZeroValsP;
% MEDIAN Determination for PLATES with Dispersed RFs
% NZrefIndxP=NZrefIndxP %find(Exp(expN).Dexp(n).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5));
if isempty(NZrefIndxP), nonZeroCntDisp=0, medianIndxDisp= NZrefIndxP;
else nonZeroCntDisp=length(NZrefIndxP);
if isempty(NZrefIndxP)
nonZeroCntDisp=0;
medianIndxDisp=NZrefIndxP;
else
nonZeroCntDisp=length(NZrefIndxP);
end
if ~isempty(NZrefIndxP) && mod(nonZeroCntDisp,2)==0, medianIndxDisp=NZrefIndxP(1:nonZeroCntDisp-1); end
@@ -530,7 +481,6 @@ if ~isempty(NZrefIndxP) && length(medianIndxDisp) > 0 %(.15*384) %To calc. a med
RFmd1posD=NZrefIndxP(nonZeroMedPosIndx); % drfPindx((RFmd1posIndx),dMPs(mm));
RFmd1locD(1)=ceil(RFmd1posD/24); % calc r value
RFmd1locD(2)=RFmd1posD - ((RFmd1locD(1)-1)*24); % calc c value
lstindx=lstindx+1;
lstindxOrf=lstindxOrf+1;
if usrRefFg==0, rfPLbl='RF1mdP('; else rfPLbl=strcat('RF-',rfGnSp,'mdP('); end % accomodate User Ref Selection
@@ -543,7 +493,6 @@ else
end
aa(lstindx,2)={strcat(':',num2str(dMPs(mm)),':',num2str(RFmd1locD(1)),':',num2str(RFmd1locD(2)))};
bb(lstindxOrf,2)={strcat(':',num2str(dMPs(mm)),':',num2str(RFmd1locD(1)),':',num2str(RFmd1locD(2)))};
Exp(expN).Dexp(n).RFmdPLB(d,dMPs(mm))=strcat(aa(lstindx,1),aa(lstindx,2));
Exp(expN).Dexp(n).RFmdPindx(d,dMPs(mm))=RFmd1posD;
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???
@@ -561,18 +510,14 @@ else
firstZeroD=drfPindx((firstZeroDindx),dMPs(mm));
Exp(expN).Dexp(n).RFmdPindx(d,dMPs(mm))=firstZeroD;
Exp(expN).Dexp(n).RFmdPpltN(d,dMPs(mm))=dMPs(mm); % RF1mp; % Is this supposed to be the MP number or the ScanPlate number???
end %~isempty(NZrefIndxP) && length(medianIndxDisp) > 3 ln584
catch %try ln565
end
catch
medianCalcTryFailed1D='Failed! Failed! Ln565 {Dispersed RF1s} "try" But process continued with placeholder Plate spot value!'
try
firstZeroindxD=find(vv((chgIndx(d):chgIndx(d+1)-1),5)==0,1,'first');
firstZeroPindx=uu(firstZeroindxD,4);
Exp(expN).Dexp(n).RFmdPpltN(d,dMPs(mm))=dMPs(mm);
Exp(expN).Dexp(n).RFmdPindx(d,dMPs(mm))=firstZeroPindx;
catch
catchissue='try at Ln565'
Exp(expN).Dexp(n).RFmdPpltN(d,dMPs(mm))=dMPs(mm);
@@ -582,15 +527,13 @@ catch %try ln565
Exp(expN).Dexp(n).RFmdPpltN=dMPs(mm);
catch
catchissue='Ln619'
Exp(expN).Dexp(n).RFmdPpltN= 1; %This might keep from breaking BUT ???
Exp(expN).Dexp(n).RFmdPpltN=1; % this might keep from breaking BUT ???
end
end
end
end
error='EZexpSel lineAfter 565'
end %try ~ln565
end %for d=0:DMnum
end %for mm=1:length(dMPs)
%****************CALC. GLOBAL MEAN, STD, AND MEDIAN FOR DISTRIBUTED REFERENCES******************************************************************
% Calc. Global Mean, Std, And Median For Distributed References
uu=horzcat(uu,vv);
for d=1:DMnum
medianIndxG=[];
@@ -601,15 +544,16 @@ for d=1:DMnum
RFstdG=std(nonzeros(vv(:,d)));
NZrfIndxG=find(vv(:,d)); % find(nonzeros(vv(:,d)));
if isempty(RFmeanG), nonZeroCntD=0, %medianIndxDisp= RFmeanG(d);
else nonZeroCntD= length(nonzeros(vv(:,d)));
if isempty(RFmeanG)
nonZeroCntD=0 % medianIndxDisp=RFmeanG(d);
else
nonZeroCntD=length(nonzeros(vv(:,d)));
end
% Calc. of median requires an odd number of indx items
if ~isempty(NZrfIndxG) && mod(nonZeroCntD,2)==0, medianIndxD=NZrfIndxG(1:(size(NZrfIndxG,1)-1)); end
if ~isempty(NZrfIndxG) && mod(nonZeroCntD,2)~=0, medianIndxD=NZrfIndxG(:); end
if ~isempty(NZrfIndxG) && length(medianIndxD) > 0 %(.15*size(drf,1)) %To calc. a median, more than 15% of spots must be nonZero
if ~isempty(NZrfIndxG) && length(medianIndxD) > 0 %(.15*size(drf,1)) % to calc. a median, more than 15% of spots must be nonZero
mvalsDG=median(vv(medianIndxD,d)); % (nonzeros(vv(:,d)));
nzPosIndxDG=find(mvalsDG==vv(:,d));
RFmdDGloc(d,1)=uu(nzPosIndxDG,1); % MP of distributedGlobal Median value
@@ -617,7 +561,6 @@ RFmdDGloc(d,2)= uu(nzPosIndxDG,2); %calc r value
RFmdDGloc(d,3)=uu(nzPosIndxDG,3); % calc c value
lstindx=lstindx+1;
lstindxOrf=lstindxOrf+1;
if usrRefFg==0, rfGLbl='RF1mdG('; else rfGLbl=strcat('RF-',rfGnSp,'mdG('); end %accomodate User Ref Selection
if iscell(strcat(rfPLbl,num2str(d),')')),
aa(lstindx,1)=strcat(rfGLbl,num2str(d),')'); % remove string2cell brackets {...}
@@ -628,9 +571,7 @@ bb(lstindxOrf,1)= {strcat(rfGLbl,num2str(d),')')};
end
aa(lstindx,2)={strcat(':',num2str(RFmdDGloc(d,1)),':',num2str(RFmdDGloc(d,2)),':',num2str(RFmdDGloc(d,3)))}; %,'std_',num2str(std2))};
bb(lstindxOrf,2)={strcat(':',num2str(RFmdDGloc(d,1)),':',num2str(RFmdDGloc(d,2)),':',num2str(RFmdDGloc(d,3)))}; %,'std_',num2str(std2))};
%Composite Reference Amalgum Plot ******************
% Composite Reference Amalgum Plot
lstindx=lstindx+1;
lstindxOrf=lstindxOrf+1;
if usrRefFg==0, rfcmpGLbl='RFcmpG('; else rfcmpGLbl=strcat('RFcmpG-',rfGnSp,'('); end %accomodate User Ref Selection
@@ -644,7 +585,6 @@ end
aa(lstindx,2)={''};
bb(lstindxOrf,2)={''};
%*****************************************************
Exp(expN).Dexp(n).RFmdGLB(d)=strcat(aa(lstindx,1),aa(lstindx,2));
Exp(expN).Dexp(n).RFmdGindx(d)=nzPosIndxDG;
Exp(expN).Dexp(n).RFmdGpltN(d)=RFmdDGloc(d,1);
@@ -654,7 +594,6 @@ Exp(expN).Dexp(n).RFminG(d)= minG;
Exp(expN).Dexp(n).RFmaxG(d)=maxG;
Exp(expN).Dexp(n).RFstdG(d)=RFstdG;
Exp(expN).Dexp(n).RFmeanG(d)=RFmeanG;
Exp(expN).Dexp(n).RFcmpGL.dm(d).Lvals=vv(medianIndxD,d); %17_1201 TrendOL
Exp(expN).Dexp(n).RFcmpGL.dm(d).med=median(vv(medianIndxD,d)); %For Ref Composite 17_1009
Exp(expN).Dexp(n).RFcmpGL.dm(d).mean=mean(vv(medianIndxD,d)); %For Ref Composite 17_1009
@@ -673,37 +612,17 @@ Exp(expN).Dexp(n).RFcmpGr.dm(d).mean= mean(vvr(medianIndxD,d)); %For Ref Composi
Exp(expN).Dexp(n).RFcmpGr.dm(d).std=std(vvr(medianIndxD,d)); %For Ref Composite 17_1009
Exp(expN).Dexp(n).RFcmpGr.dm(d).min=min(vvr(medianIndxD,d)); %For Ref Composite 17_1009
Exp(expN).Dexp(n).RFcmpGr.dm(d).max=max(vvr(medianIndxD,d)); %For Ref Composite 17_1009
end
end
end
end % if exist('drf','var')
%END OF DISPERSE REFERENCE PLATAES CALCULATIONS AND LIST ADDITIONS
%*********************************************************************
%Added 17-1023 For User Addition of Gene Composites to ListBox
%Expaa{expN,n}= aa; Expbb{expN,n}= bb;
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
%********************************************************************
%EZusrSelRef %*
%********************************************************************
%****************************************************************************************************
% EZusrSelRef
gnLstRaw=strcat(aa(:,1),aa(:,2));
Exp(expN).Dexp(n).srtGnLst=sort(gnLstRaw);
orfLstRaw=strcat(bb(:,1),bb(:,2));
Exp(expN).Dexp(n).srtOrfLst=sort(orfLstRaw);
%####################################################################
%
%{
%set(handles.MPsldr2,'max',length(MP));
%set(handles.DMsldr2,'max',length(DM.drug));
@@ -725,6 +644,3 @@ Exp(expN).Dexp(n).srtOrfLst= sort(orfLstRaw);
%set(handles.DMsldr2,'SliderStep',[1/length(DM.drug) 1/length(DM.drug)]);
%set(handles.Tptsldr2,'SliderStep',[1/tPtsSize 1/tPtsSize]);
%}

View File

@@ -1,7 +1,6 @@
% EZsingleExUserRF
global exp
usrRefFg=0;
prompt={'Enter GeneName to use as Reference:',...
'Enter Specifics Term if used to futher specify Reference '}
@@ -15,28 +14,23 @@ global exp
rfGnSp=strcat(rfGene,rfSpec);
if strcmpi(rfSpec,'None'), rfGnSp=strcat(rfGene,'-'); end
% for n=1:size(matFile,2)
n=1;
%*********************************************************************
EZmultiGeneRFsLst %**
%*********************************************************
EZdiagRFsSheet %**
%********************
EZmultiGeneRFsLst
EZdiagRFsSheet
Exp(expN).Dexp(n).RFrnames=rnames;
Exp(expN).Dexp(n).RFdata=data;
%*********************************************************
RFconfig=0;
if sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmean'))&&...
~isempty(Exp(expN).Dexp(n).RFmean)&&...
sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmeanG'))&&...
isempty(Exp(expN).Dexp(n).RFmeanG)
if sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmean')) ...
&& ~isempty(Exp(expN).Dexp(n).RFmean) ...
&& sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmeanG')) ...
&& isempty(Exp(expN).Dexp(n).RFmeanG)
RFconfig=1;
end
if sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmean'))==0 ||...
isempty(Exp(expN).Dexp(n).RFmean)&&...
sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmeanG'))&&...
~isempty(Exp(expN).Dexp(n).RFmeanG)
if sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmean'))==0 ...
|| isempty(Exp(expN).Dexp(n).RFmean) ...
&& sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmeanG')) ...
&& ~isempty(Exp(expN).Dexp(n).RFmeanG)
RFconfig=2;
end
if sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmean'))&&...
@@ -47,7 +41,6 @@ if sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmean'))&&...
end
Exp(expN).RFconfig=RFconfig;
Exp(expN).Dexp(n).RFconfig=RFconfig;
%**********************************************
try msgBadGeneName, catch, end
try
Exp(expN).Dexp(n).resetHtmpTg =5; %Exp(expN).resetHtmpTg =5;
@@ -57,16 +50,8 @@ try
end
catch
end
%***************************
%*********************************************************************
%end
%###############################################################################
%}
%********Auto select Zone and load listboxGnOrf data**********
% Auto select Zone and load listboxGnOrf data
DexpN=1;
zeroCLn=zeros(1,DMnum);
Exp(expN).expLoadCnt=Exp(expN).expLoadCnt+1; expLdCnt=Exp(expN).expLoadCnt;
@@ -96,7 +81,6 @@ if expN==2
end
DNLaxes2=handles.DNLaxes2;
Exp(2).hzeroCLn(expLdCnt)=plot(DNLaxes2,zeroCLn,1:DMnum,'y');
end
if expN==3
@@ -118,13 +102,11 @@ if Exp(4).interacPBsel==0 %if interaction "raw" don't show a center line
try
set(Exp(expN).hzeroCLn(i),'visible','off');
catch
catchissue='Ln521'
i
end
end
end
%***************************
% HtMapTog 'string', 'Current user L/N' selection'
Exp(expN).Dexp(DexpN).spotIndx=[];
if expN==1,
@@ -143,5 +125,3 @@ if expN==3,
EZhtMap
end
htMapTogPBfg=0;
%*******************************************************************

View File

@@ -1,14 +1,12 @@
function EZspotview(expN,DexpN, imLoc,OLresDir,OLplateNum,NoOLay)
datacursormode(gcf)
global Exp
global ghandles
datacursormode(gcf)
w=pwd;
aCnt=0;
prevExp=0;
if NoOLay==0
cd(fullfile(char(OLresDir)))
cd ..
expDir=pwd;
@@ -21,12 +19,10 @@ if NoOLay==0
if prevExp==0
expDir=Exp(expN).Dexp(DexpN).ExpFoldr;
else
cd(fullfile(char(OLresDir)))
cd ..
expDir=pwd;
cd(w)
%expDir=fullfile(char(OLresDir),'..');
end
else
@@ -34,25 +30,21 @@ else
end
%ExpHmDir=char(Exp(expN).Dexp(DexpN).resDir);
try close(ghandles.hfstrip), catch, end % hfIm
%*************CIRCLE related*************************
% CIRCLE related
doCircle=1;
radius=14;
diaExt=2*(radius+1);
%>>>>>>>>>>>>>>>>>>>>>>
EZvNIcircle
%<<<<<<<<<<<<<<<<<<<<<<<
rIm=imLoc(1); % use the "picture/Image' r and c not the plate annotation r c)
cIm=imLoc(2);
plateNum=Exp(expN).Dexp(DexpN).plateNum;
%*****************************************
if prevExp==0
FexpScanSpots=Exp(expN).Dexp(DexpN).FexpScanSpots;
FexpScanBMtp=Exp(expN).Dexp(DexpN).FexpScanBMtp;
anlZoneRefs=Exp(expN).Dexp(DexpN).anlZoneRefs;
ImParMat=Exp(expN).Dexp(DexpN).ImParMat;
else
% check if the request expJob is already loaded in one of the other zones
matchfound=0;
@@ -72,17 +64,14 @@ else
load(fullfile(char(OLresDir),'Fotos','anlZones'))
load(fullfile(char(OLresDir),'Fotos','BGatTpts'))
load(fullfile(char(OLresDir),'PTmats','NImParameters'))
end %if matchfound==1
end %if prevExp==0
end
end
%**************Parameter Entry******************
% Parameter Entry
width=ImParMat(5);
widthEx=width-1; %width extention from reference point
%=================================================================
%=================================================================
%++++Start Spot selection and Manipulation section+++++++++++
% Start Spot selection and Manipulation section
Fcutsc=[];
Fstrip=[];
%{
@@ -105,11 +94,10 @@ coord=[];
try
% FtifFile=fullfile(Exp(expN).Dexp(DexpN).ExpFoldr,num2str(plateNum),strcat(num2str(tPt),'.bmp')); %char(tifFileLst(tPt));
FtifFile=fullfile(char(expDir),num2str(plateNum),strcat(num2str(tPt),'.bmp'));
Fimg=imread(FtifFile);
% For Visualization Purposes ***********************
% For Visualization Purposes
Fram=ones(2075,1400); %(size(Empsc,1),size(Empsc,2));
%FRAME ANALYSIS AREA*******************************************************
% FRAME ANALYSIS AREA
if size(FexpScanSpots,2)>1
coord=FexpScanSpots{plateNum}{rIm,cIm,tPt};
else
@@ -123,12 +111,10 @@ end
xLoc=xyLoc(2);
yLoc=xyLoc(1);
%*************CIRCLE related*************************
doCircle=1; %Temp test value insertion to get square images
if doCircle==1,
% CIRCLE related
doCircle=1; % temp test value insertion to get square images
if doCircle==1
Fram=FoptCirMask;
else
% 1->2 across rt 1, 2-4
Fram(yLoc,xLoc:(xLoc+widthEx))=0.8;
@@ -140,8 +126,7 @@ Fram(yLoc:(yLoc+widthEx),(xLoc+1+widthEx))=0.8;
Fram((yLoc+1+widthEx),(xLoc+1):(xLoc+1+widthEx))=0.8;
Fram=Fram(coord(1):coord(3),coord(2):coord(4));
end
%CUT SPOT OUT OF IMAGE*****************************************************
% Cut Spot Out Of Image
% Fbg=FexpScanBMtp{selScan,1}(rIm,cIm,tPt);
Fbg=FexpScanBMtp{plateNum}(rIm,cIm,tPt); %{selScan,1}
% Fimg=imread(FtifFile); %,'PixelRegion', {[coord(1),coord(3)],[coord(2),coord(4)]});
@@ -153,12 +138,10 @@ if doCircle==1
% Fram=padarray(Fram,[expansion expansion],1,'pre');
Fram=padarray(Fram,[varExtPre],1,'pre');
Fram=padarray(Fram,[varExtPost],1,'post');
% Fram=padarray(Fram,rem(varExt,2),1,'post');
%Fram=padarray(Fram,floor((varExt-2)./2),1);
end
%INVERT IMGAGE
% Invert Image
Fcutsc=double(Fcutsc) .* Fram;
%Fcutsc=Fcutsc .* uint8(Fram);
Fcutsc=uint8(Fcutsc);
@@ -184,25 +167,22 @@ if aCnt>1
%Hspace=zeros(size(Fstrip,1),4)+255;
Fstrip=horzcat(Fstrip,vcat,Hspace);
end
% For Visualization Purposes only
% For Visualization Purposes only
if makeVis==1
% if aCnt==1,figure;end
% resIm=uint8((double(BGsc) + OptmapOnesDbl) .* double(fullsc));
% clear('OptmapOnesDbl')
hfstrip=imagesc(Fcutsc); colormap(gray); %hfstrip=imshow(Fcutsc); colormap(gray); %hfscanIm=imagesc(Fcutsc); colormap(gray);
ghandles.hfstrip=gcf;
haxis=gca;
title(strcat('Scan',num2str(plateNum),'->timePt-',num2str(tPt)));
clf(hfstrip,'reset'); colormap(gray); %clf(hfscanIm,'reset'); colormap(gray);
set(ghandles.hfstrip,'NumberTitle','off')
end
expLabel=strcat('->',char(fullfile(char(OLresDir),num2str(OLplateNum))))
% catch
% expLabel=strcat('->',char(fullfile(Exp(expN).Dexp(DexpN).ExpFoldr,num2str(plateNum))))
if expN==1
set(ghandles.hfstrip,'Name', strcat(char(get(ghandles.OLay1,'string')),expLabel)) %ghandles.hfIm %{'ExpOutmat'} %strcat('EASYconsole- ',char(resDir)))
elseif expN==2
@@ -210,13 +190,13 @@ end
elseif expN==3
set(ghandles.hfstrip,'Name', strcat(char(get(ghandles.OLay3,'string')),expLabel))
end
%hgsave(fullfile(resDir,'Fotos',strcat('FScan',num2str(selScan),'_timePt-',num2str(tPt))));
catch
end
end %for tPt=1:tPtsSize end of for Fotos Spot image cutout
end
catch
end
%figure(ghandles.hFstrip)
imshow(Fstrip);
%{
@@ -236,10 +216,5 @@ imshow(Fstrip);
%datacursormode off;
%datacursormode on;
%close(figure(hsafety))
end %function end
%XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
%XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
%XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
end

View File

@@ -31,30 +31,25 @@ if n==1 && ~exist('RF1scanN','var') && ~exist('RF2scanN','var') %change || &&
answer=inputdlg(prompt,dlg_title,num_lines,def);
rfGenestr=cell2mat(answer(1));
rfSpec=cell2mat(answer(2));
end
%try
for mp=1:length(Exp(expN).Dexp(DexpN).MP)
for ind384=1:384
spN=spN+1;
end
%catch
%end %try for user selected Reference routine
end
%***********DISPERSE REFERENCE PLATES
% Disperse Reference Plates
Exp(expN).Dexp(DexpN).RFmdPindx=[];
Exp(expN).Dexp(DexpN).RFmdPpltN=[];
if exist('drf','var') % ('RF1scanN','var')
%Det. index of change from one MP to the next
i=2;
chgIndx(1)=1;
for j=1:length(drf(:,3))
if j>1
if cell2mat(drf(j,3))~=cell2mat(drf((j-1),3)), chgIndx(i)=j; i=i+1; end
end
@@ -63,9 +58,7 @@ chgIndx(length(chgIndx)+1)= length(drf)+1;
uu=zeros(size(drf,1),4);
uu(:,1:4)=cell2mat(drf(:,3:6))
vv=zeros(length(drf),DMnum);
%************************************
dMPs=unique(cell2mat(drf(:,3)));
%*****************************************
%{
for mm=1:MPnum
nonZrfIndx.mp{mm,:}=drfPindx((find(drfPindx(:,mm))),mm);
@@ -74,16 +67,13 @@ vv= zeros(length(drf),DMnum);
%}
% nzValsG=zeros(DMnum,size(drf,1));
% nzValsAcc=zeros(DMnum,384);
for mm=1:length(dMPs) % length(chgIndx)
for d=1:(DMnum)
medianIndxDisp=[];
NZrefIndxP=[];
nonZeroValsP=[];
medValLstDisp=[];
rf1scNdisp=((dMPs(mm)-1)*DMnum)+(d);
try % Determine the dispersed RFs median mean and std if such exist
NZrefIndxP=drfPindx((find(drfPindx(:,dMPs(mm)))),dMPs(mm)); %find(Exp(expN).Dexp(DexpN).scan(rf1scNdisp).plate(1).CFout(drf(chgIndx(cI):chgIndx(cI+1)),5));
% vv=Exp(expN).Dexp(DexpN).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5);
@@ -94,15 +84,15 @@ try % Determine the dispersed RFs median mean and std if such exist
minDisp=min(nonZeroValsP);
maxDisp=max(nonZeroValsP);
drfVals=Exp(expN).Dexp(DexpN).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5);
%nzValsAcc(mm).DM(d,:)=nonZeroValsP;
%MEDIAN Determination for PLATES with Dispersed RFs
%NZrefIndxP=NZrefIndxP %find(Exp(expN).Dexp(DexpN).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5));
if isempty(NZrefIndxP), nonZeroCntDisp=0, medianIndxDisp= NZrefIndxP;
else nonZeroCntDisp=length(NZrefIndxP);
if isempty(NZrefIndxP)
nonZeroCntDisp=0
medianIndxDisp=NZrefIndxP;
else
nonZeroCntDisp=length(NZrefIndxP);
end
if ~isempty(NZrefIndxP) && mod(nonZeroCntDisp,2)==0, medianIndxDisp=NZrefIndxP(1:nonZeroCntDisp-1); end
if ~isempty(NZrefIndxP) && mod(nonZeroCntDisp,2)~=0, medianIndxDisp=NZrefIndxP; end
if ~isempty(NZrefIndxP) && length(medianIndxDisp) > 3 %(.15*384) %To calc. a median, more than 15% of spots must be nonZero
@@ -113,14 +103,12 @@ if ~isempty(NZrefIndxP) && length(medianIndxDisp) > 3 %(.15*384) %To calc. a med
RFmd1posD=NZrefIndxP(nonZeroMedPosIndx); %drfPindx((RFmd1posIndx),dMPs(mm));
RFmd1locD(1)=ceil(RFmd1posD/24); %calc r value
RFmd1locD(2)=RFmd1posD - ((RFmd1locD(1)-1)*24); %calc c value
lstindx=lstindx+1;
lstindxOrf=lstindxOrf+1;
aa(lstindx,1)={strcat('RF1mdP(',num2str(d),')')};
aa(lstindx,2)={strcat(':',num2str(dMPs(mm)),':',num2str(RFmd1locD(1)),':',num2str(RFmd1locD(2)))};
bb(lstindxOrf,1)={strcat('RF1mdP(',num2str(d),')')};
bb(lstindxOrf,2)={strcat(':',num2str(dMPs(mm)),':',num2str(RFmd1locD(1)),':',num2str(RFmd1locD(2)))};
Exp(expN).Dexp(DexpN).RFmdPLB(d,dMPs(mm))=strcat(aa(lstindx,1),aa(lstindx,2));
Exp(expN).Dexp(DexpN).RFmdPindx(d,dMPs(mm))=RFmd1posD;
Exp(expN).Dexp(DexpN).RFmdPpltN(d,dMPs(mm))=dMPs(mm); %This is a storage of the MasterPlate used NOT the ScanPlate? WeMight wish to store the ScanPlateNumber also???
@@ -138,36 +126,28 @@ else
firstZeroD=drfPindx((firstZeroDindx),dMPs(mm));
Exp(expN).Dexp(DexpN).RFmdPindx(d,dMPs(mm))=firstZeroD;
Exp(expN).Dexp(DexpN).RFmdPpltN(d,dMPs(mm))=dMPs(mm); %RF1mp; %Is this supposed to be the MP number or the ScanPlate number???
end %~isempty(NZrefIndxP) && length(medianIndxDisp) > 3 ln584
catch %try ln565
end
catch
medianCalcTryFailed1D='Failed! Failed! Ln565 {Dispersed RF1s} "try" But process continued with bogus Plate spot value!'
try
firstZeroindxD=find(vv((chgIndx(d):chgIndx(d+1)-1),5)==0,1,'first');
firstZeroPindx=uu(firstZeroindxD,4);
Exp(expN).Dexp(DexpN).RFmdPpltN(d,dMPs(mm))=dMPs(mm);
Exp(expN).Dexp(DexpN).RFmdPindx(d,dMPs(mm))=firstZeroPindx;
catch
catchissue='try at Ln565'
Exp(expN).Dexp(DexpN).RFmdPpltN(d,dMPs(mm))=dMPs(mm);
Exp(expN).Dexp(DexpN).RFmdPindx(d,dMPs(mm))=384; %if crapout,Then use spot384 as default to keep going
end
try
Exp(expN).Dexp(DexpN).RFmdPpltN=dMPs(mm);
catch
catchissue='Ln619'
Exp(expN).Dexp(DexpN).RFmdPpltN=1; %This might keep from breaking BUT ???
end
error='EZexpSel lineAfter 565'
end %try ~ln565
end
end % for d=0:DMnum
end % for mm=1:length(dMPs)
%****************CALC. GLOBAL MEAN, STD, AND MEDIAN FOR DISTRIBUTED REFERENCES******************************************************************
% Calc. Global Mean, Std, And Median For Distributed References
uu=horzcat(uu,vv);
for d=1:DMnum
medianIndxG=[];
@@ -178,15 +158,17 @@ for d=1:DMnum
RFstdG=std(nonzeros(vv(:,d)));
NZrfIndxG=find(nonzeros(vv(:,d)));
if isempty(RFmeanG), nonZeroCntD=0, %medianIndxDisp= RFmeanG(d);
else nonZeroCntD= length(nonzeros(vv(:,d)));
if isempty(RFmeanG)
nonZeroCntD=0
% medianIndxDisp=RFmeanG(d);
else
nonZeroCntD=length(nonzeros(vv(:,d)));
end
% Calc. of median requires an odd number of indx items
if ~isempty(NZrfIndxG) && mod(nonZeroCntD,2)==0, medianIndxD=NZrfIndxG(1:(size(NZrfIndxG,1)-1)); end
if ~isempty(NZrfIndxG) && mod(nonZeroCntD,2)~=0, medianIndxD=NZrfIndxG(:); end
if ~isempty(NZrfIndxG) && length(medianIndxD) > (.15*size(drf,1)) % To calc. a median, more than 15% of spots must be nonZero
mvalsDG=median(vv(medianIndxD,d)); % (nonzeros(vv(:,d)));
nzPosIndxDG=find(mvalsDG==vv(:,d));
RFmdDGloc(d,1)=uu(nzPosIndxDG,1); % MP of distributedGlobal Median value
@@ -208,16 +190,10 @@ Exp(expN).Dexp(DexpN).RFminG(d)= minG;
Exp(expN).Dexp(DexpN).RFmaxG(d)=maxG;
Exp(expN).Dexp(DexpN).RFstdG(d)=RFstdG;
Exp(expN).Dexp(DexpN).RFmeanG(d)=RFmeanG;
end
end
end % if exist('drf','var')
%END OF DISPERSE REFERENCE PLATAES CALCULATIONS AND LIST ADDITIONS
%*********************************************************************
end
catch
msg='Failed attempt to apply User Selected Reference'
end %if n==1 && ~exist('RF1scanN','var') && ~exist('RF2scanN','var')
end

View File

@@ -7,7 +7,6 @@ global zonePB
RFcmpGFlg=0; %Test 180105 as it goes to EZmDayTrend.m
lstBoxCmpFlg=0;
curKey=get(gcf,'currentkey')
htMapFg=0;
@@ -31,7 +30,6 @@ lstBoxCmpFlg=0;
% Exp(expN).DexpN=DexpN;
if strcmp(Exp(expN).DexpType,'single'), DexpN=1; end
if exist('OLay','var'), clear ExpN; end
if ~exist('OLay','var')
try
ImageSel=expN<4
@@ -41,33 +39,27 @@ try
tPtSel=Exp(expN).Dexp(DexpN).tPtSel; %floor(get(handles.Tptsldr1,'value'));
plateNum=Exp(expN).Dexp(DexpN).plateNum; %(MPsel1-1)*destPerMP1 + pertSel1;
scan=Exp(expN).Dexp(DexpN).scan;
MP=Exp(expN).Dexp(DexpN).MP;
ptrPos=[cpos(1),cpos(2)]; %for VerticleImage
if htMapFg==0 %Comes from spot image Iaxes
try
for m=1:24
for n=1:16
coord=Exp(expN).Dexp(DexpN).FexpScanSpots{plateNum}{m,n,tPtSel}; %replace {1} with {plateNum}
if ptrPos(2)> coord(1) && ptrPos(2)< coord(3)
if ptrPos(1)> coord(2) && ptrPos(1)<coord(4)
picLoc1=[n,m];
spotFrm=Exp(expN).Dexp(DexpN).FexpScanSpots{plateNum}{m,n,tPtSel}; %20160108
end
end
end %for n=1:16
end %for m=1:24
end
end
destcompMsg='GoodDataTip';
catch
destcompMsg='BadDataTip';
m
n
end
plateLoc=[(17-picLoc1(1)) picLoc1(2)];
indx=(plateLoc(1)-1)*24+plateLoc(2);
elseif htMapFg==1 %Comes from HeatMap image Haxes
@@ -75,14 +67,12 @@ try
indx=(plateLoc(1)-1)*24+plateLoc(2);
end
Exp(expN).Dexp(DexpN).spotIndx=indx;
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
Kl=scan(1,plateNum).plate(1).CFout(indx,7);
Ku=scan(1,plateNum).plate(1).CFout(indx,8);
rl=scan(1,plateNum).plate(1).CFout(indx,9);
@@ -99,7 +89,6 @@ 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
tser=(scan(1,plateNum).plate(1).t0Series(:));
rawData=scan(1,plateNum).plate(1).intens(indx,:)/scan(1,plateNum).plate(1).Ag(indx);
if expN==1, plotAxes=ghandles.Paxes1; OLaxes=ghandles.OLaxes1;
Exp(1).traceN=Exp(1).traceN+1;
traceN=Exp(1).traceN;
@@ -116,28 +105,23 @@ plot(plotAxes,t,g);hold(plotAxes,'on');
plot(plotAxes,tser,rawData,'g*');
plot(plotAxes,t,gSlow,'y');plot(plotAxes,t,gFast,'r');
hold(plotAxes,'off');
try for i=1:length(Exp(expN).hOL(:)),set(Exp(expN).hOL(i),'color',[0 0 1]); end, catch, end %ZoneRelated
try
for i=1:length(Exp(expN).hOL(:)),set(Exp(expN).hOL(i),'color',[0 0 1]); end, catch, end %ZoneRelated
if verLessThan('matlab','8.4')
else % accomodate new matlab changes after 2014a fix 23_0807
tempFig=figure;
end
Exp(expN).hOL(traceN)=plot(OLaxes,t,g);hold on;
set(Exp(expN).hOL(traceN),'color',[1 0 0])
Exp(expN).hOLb(traceN)=plot(OLaxes,tser,rawData,'g*');
% Added for Composite Plot utility [C] 170419
Exp(expN).ll(traceN)=l; Exp(expN).rr(traceN)=r; Exp(expN).kk(traceN)=K;
%************************************************
if verLessThan('matlab','8.4')
else % accomodate new matlab changes after 2014a fix update 23_0807
close(tempFig)
end
catch
%{
g=K ./ (1 + exp(-r.* (t - l )));
@@ -147,7 +131,7 @@ catch
plot(plotAxes, plot(t,g),hold on,plot(tser,rawData,'g*'),hold off);
plot(OLaxes, plot(t,g),hold on,plot(tser,rawData,'g*');
%}
end %trycatch
end
% Get the DM agar description
if expN==1,DMstr=char(get(ghandles.DM1,'string'));end
if expN==2,DMstr=char(get(ghandles.DM2,'string'));end
@@ -159,10 +143,8 @@ tPtStr=strcat('T=', num2str(scan(1,plateNum).plate(1).t0Series(tPtSel)));
geneOrfstr=strcat(gene,'_',orf,'_','r',num2str(plateLoc(1)),'c',num2str(plateLoc(2)),'_',tPtStr);
grfgenestr=strcat(gene,'_',orf,'_','r',num2str(plateLoc(1)),'c',num2str(plateLoc(2)));
selGnOrf=grfgenestr; % added for EZdestComp.m and EZmDayTrend.m
graphStr=strcat(grfgenestr,'_','L=',Lstr,'_','r=',rstr,'_','K=',Kstr);
spotDescrip=strcat(graphStr,'->',DMstr);
xp=char(Exp(expN).Dexp(DexpN).resDir);
if ispc,
slashPos=strfind(char(Exp(expN).Dexp(DexpN).resDir),'\');
@@ -180,14 +162,13 @@ Exp(expN).hOLresDir(traceN)= {Exp(expN).Dexp(DexpN).resDir};
Exp(expN).hOLplateNum(traceN)=plateNum;
% traceData=vertcat(get(Exp(OLay).hOL(traceN),'XData'),get(ghandles.Exp(OLay).hOL(traceN),'YData'));
if expN==1,set(ghandles.GeneOrfLoc1,'string',geneOrfstr);end % Displays the value.
if expN==2,set(ghandles.GeneOrfLoc2,'string',geneOrfstr);end
if expN==3,set(ghandles.GeneOrfLoc3,'string',geneOrfstr);end
if expN==1,set(ghandles.graphStrLoc1,'string',spotDescrip);end % graphStr);end % Displays the value.
if expN==2,set(ghandles.graphStrLoc2,'string',spotDescrip);end % graphStr);end
if expN==3,set(ghandles.graphStrLoc3,'string',spotDescrip);end % graphStr);end
%************************* ********************* ***************************
try
if expN==1, %&& get(ghandles.rotPB1,'value')~=1
try if length(char(Exp(expN).hOLname(traceN)))>40,set(ghandles.OLay1,'FontSize',8);end, catch end
@@ -210,7 +191,6 @@ try
catch
end
%*******************************************************
%{
if expN==1
zonesel=1;
@@ -251,7 +231,7 @@ if expN==3
end
end
%}
%****************************************************************
% Zone PB set here as replacement for zonePB radio buttons 230815
if expN==1
zonesel=1;
@@ -303,8 +283,6 @@ if expN==3
set(ghandles.listboxGnOrf,'string',Exp(3).Dexp(DexpN).srtGnLst)
end
end
%***********************************************************************
Exp(expN).Trace(traceN).UsrGLB=geneOrfstr;
Exp(expN).Trace(traceN).dmSel=pertSel;
@@ -312,17 +290,11 @@ Exp(expN).Trace(traceN).DexpN= DexpN;
Exp(expN).Trace(traceN).Dexp(DexpN).DM(pertSel).UsrLvals=l;
Exp(expN).Trace(traceN).Dexp(DexpN).DM(pertSel).UsrKvals=K;
Exp(expN).Trace(traceN).Dexp(DexpN).DM(pertSel).Usrrvals=r;
%**************************************************************
catch
msg='NotImage'
end % trycatch expN<4 datatip selection from Image (not from an OverLay Plot)
end %if ~exist('OLay','var')
%******************************************************************************************
%Write Selected Trace Info to OLAY header********************+++++++++++++++++*************
end
end
% Write Selected Trace Info to OLAY header
try
OLayTest=OLay<4
msg='OLay'
@@ -348,7 +320,6 @@ if htargetAxes==Exp(OLay).hOL(i)
plateNum=Exp(expN).Dexp(DexpN).plateNum
OLplateNum=Exp(OLay).hOLplateNum(i);
seltraceN=i;
end
if OLay==2 && get(ghandles.rotPB2,'value') ~=1
set(htargetAxes,'color',[1 0 0])
@@ -380,16 +351,13 @@ if htargetAxes==Exp(OLay).hOL(i)
else
msg='Cant Find trace'
end
end % => for i=1:length(Exp(OLay).hOL(:))
end
% Extract row and col values from stored trace label for dest compare plots(EZdestComp)
% if a RFcmp_ is selected Need alternate method.
% if the Composite button is active, Need yet another method.
try
tracename=char(Exp(OLay).hOLname(seltraceN))
pos_=strfind(tracename,'_')
rxcy=tracename(pos_(2):pos_(3))
cindx=strfind(rxcy,'c')
@@ -408,25 +376,19 @@ try
catch
msg='Not from an OLay selected trace'
end
catch
msg='Not in OLay frame-axis 0'
end %=> try for Write Selected Trace Info to OLAY header******
%HIDE HIDE HIDE ---------------------------------------------------
%HIDE selected plot trace****rotPBx used for 'Hide'****************
end
% Hide selected plot trace: rotPBx used for 'Hide'
try
OLayTest=OLay<4
msg='OLay'
OLay
if get(ghandles.rotPB1,'value') ==1 && OLay==1,
% make all traces blue
for i=1:length(Exp(OLay).hOL(:))
set(Exp(OLay).hOL(i),'color',[0 0 1])
end
for i=1:length(Exp(OLay).hOL(:))
if htargetAxes==Exp(OLay).hOL(i)
hidAx1traceN=i
@@ -449,10 +411,9 @@ if get(ghandles.rotPB1,'value') ==1 && OLay==1,
OLresDir=Exp(OLay).hOLresDir(maxhN);
OLplateNum=Exp(OLay).hOLplateNum(maxhN);
end
end
%------HIDE 22222222222222222-----
% Hide
if get(ghandles.rotPB2,'value')==1 && OLay==2, %
for j=1:length(Exp(OLay).hOL(:)) %Set all traces blue
try set(Exp(OLay).hOL(i),'color',[0 0 1]), catch, end
@@ -480,15 +441,14 @@ if get(ghandles.rotPB2,'value')==1 && OLay==2, %
OLresDir=Exp(OLay).hOLresDir(maxhN);
OLplateNum=Exp(OLay).hOLplateNum(maxhN);
end
end %if rotPB2 ....==1
end
%------HIDE 33333333333333-----
% Hide 3
if get(ghandles.rotPB3,'value') ==1 && OLay==3,
% make all traces blue
for i=1:length(Exp(OLay).hOL(:))
try set(Exp(OLay).hOL(i),'color',[0 0 1]), catch, end
end
for i=1:length(Exp(OLay).hOL(:))
if htargetAxes==Exp(OLay).hOL(i)
hidAx3traceN=i
@@ -511,20 +471,12 @@ if get(ghandles.rotPB3,'value') ==1 && OLay==3,
OLresDir=Exp(OLay).hOLresDir(maxhN);
OLplateNum=Exp(OLay).hOLplateNum(maxhN);
end
end
destcompMsg='Olay';
catch
msg='Not in OLay frame-axis 1'
end
%**********************************************************************************
NoOLay=0;
try
OLay
@@ -542,20 +494,15 @@ if get(ghandles.spotTog,'value')==1 && NoOLay
EZspotview(expN,DexpN, imLoc,OLresDir,OLplateNum,NoOLay)
end
%*****GraphicPertibationComparison**15_821*OR Chrono Day Comparison******************
if strcmpi(Exp(expN).DexpType,'single')||...
strcmpi(Exp(expN).DexpType,'multi')
%************
EZdestComp %*
%************
elseif strcmpi(Exp(expN).DexpType,'chrono') && ...
length(Exp(expN).Dexp)>1
%*************
EZmDayTrend %**
%*************
% GraphicPertibationComparison**15_821*OR Chrono Day Comparison
if strcmpi(Exp(expN).DexpType,'single') ...
|| strcmpi(Exp(expN).DexpType,'multi')
EZdestComp
elseif strcmpi(Exp(expN).DexpType,'chrono') ...
&& length(Exp(expN).Dexp)>1
EZmDayTrend
end
%********************************
% spotTog && ~Hide && Olay Capture spot location for spotview May need to
% add DexpN BUT the OLresDir likely get spotview to where it needs to go.
try
@@ -570,15 +517,14 @@ cUsr=str2num(rcStr(cPos+1:end));
imLoc=[cUsr, (17-rUsr)]; %picLoc1 %transform horz user data to vert image for picLocation data
OLresDir %=Exp(expN).hOLresDir(traceN);
OLplateNum %=Exp(expN).hOLplateNum(traceN);
%********************************************************
EZspotview(expN, imLoc,OLresDir,OLplateNum,NoOLay) %*
%********************************************************
EZspotview(expN, imLoc,OLresDir,OLplateNum,NoOLay)
end
end
catch
end
[output_txt]=datatipp(obj,event_obj);
%*********************HeatMap Text Field*********************************
% HeatMap Text Field
try
ll=num2str(l);
if length(ll)>5,htl=ll(1:5);else htl=ll;end
@@ -597,7 +543,6 @@ if length(rr)>5,htr= rr(1:5);else htr=rr;end
catch
htr=' ';
end
try
n1=num2str(Exp(expN).HtMpIntN1(indx)); %num2str(Exp(expN).Dexp(DexpN).HtMpIntN1(indx));
if length(n1)>5,N1=n1(1:5);else N1=n1; end
@@ -628,7 +573,6 @@ end
try
if Exp(expN).htmapPBsel==1 || Exp(expN).htmapPBsel==2
if expN==1,set(ghandles.HtMapVals1,'string',htmapStr);end
if expN==2,set(ghandles.HtMapVals2,'string',htmapStr);end
if expN==3,set(ghandles.HtMapVals3,'string',htmapStr);end
@@ -637,7 +581,7 @@ catch
end
% datacursormode(gcf)
%**********************************************Test Area
% Test Area
% Added 18_0105 to define RFcmpGFlg for EZmDayTrend.m when an Image spot
% is clicked

View File

@@ -3,8 +3,6 @@
global ghandles
global Exp
try
lnwidth=str2num(Exp(4).plotPars{1})
axisFontSz=str2num(Exp(4).plotPars{2})
@@ -38,7 +36,6 @@ set(gcf,'OuterPosition',(get(0,'screensize')))
disphOLbX(1)={get(Exp(zone).hOLb(1),'XData')}
disphOLbY(1)={get(Exp(zone).hOLb(1),'YData')}
catch end
hn=hn+1
notDup=1;
end
@@ -65,12 +62,12 @@ for hN=2:length(Exp(zone).hOL)
try
disphOLbX(hn)={get(Exp(zone).hOLb(hN),'XData')};
disphOLbY(hn)={get(Exp(zone).hOLb(hN),'YData')};
catch end
catch
end
tmp(hn)=strrep(Exp(zone).hOLname(hN),'_','-')
catch ME
disp(ME)
display('error leading to line 59 catch')
end
end
end
@@ -82,14 +79,12 @@ for hN=2:length(Exp(zone).hOL)
set(hprint,'linewidth',lnwidth) %0.5 then 1.5 now 6
set(gca,'fontsize',axisFontSz) % 8 to 15 to 21
linecolor(i)={get(hprint,'color')};
else
hprint=semilogy(cell2mat(disphOLX(i)),cell2mat(disphOLY(i)))
set(hprint,'linewidth',lnwidth) %0.5 then 1.5 now 4.0
set(gca,'fontsize',axisFontSz) % 8 to 15 to 21
linecolor(i)={get(hprint,'color')};
end
hold all
end
@@ -97,7 +92,6 @@ hold all
legName=tmp
hleg=legend((legName),'location','NEO')
set(hleg,'fontsize',legFontSz)
try
for i=1:hn
if semiLog==0
@@ -106,11 +100,10 @@ try
hprint=semilogy(cell2mat(disphOLbX(i)),cell2mat(disphOLbY(i)),'marker','+','markerEdgeColor',cell2mat(linecolor(i)),'markerSize',markerSz, 'linestyle','none')
end
end
catch end
catch
end
hold off
%*******End of Standard Overlay Plot***********************
% End of Standard Overlay Plot
else % if Composite Plot
for hcN=1:(Exp(zone).cTraceN -1)
disphOLX(hcN)={get(Exp(zone).hCmean(hcN),'XData')};
@@ -120,28 +113,21 @@ hold off
disphOLcX(hcN)={get(Exp(zone).hBound2(hcN),'XData')};
disphOLcY(hcN)={get(Exp(zone).hBound2(hcN),'YData')};
tmp(hcN)=(Exp(zone).cName(hcN))
if semiLog==0
hprint=plot(cell2mat(disphOLX(hcN)),cell2mat(disphOLY(hcN)))
set(hprint,'linewidth',lnwidth) %0.5 then 1.5 now 6
set(gca,'fontsize',axisFontSz) % 8 to 15 to 21
linecolor(hcN)={get(hprint,'color')};
else
hprint=semilogy(cell2mat(disphOLX(hcN)),cell2mat(disphOLY(hcN)))
set(hprint,'linewidth',lnwidth) %0.5 then 1.5 now 4.0
set(gca,'fontsize',axisFontSz) % 8 to 15 to 21
linecolor(hcN)={get(hprint,'color')};
end
hold all
legName=tmp
hleg=legend((legName),'location','NEO')
set(hleg,'fontsize',legFontSz)
%{
for i=1:hn
hprint=plot(cell2mat(disphOLbX(i)),cell2mat(disphOLbY(i)),'marker','+','markerEdgeColor',cell2mat(linecolor(i)),'markerSize',markerSz, 'linestyle','none')
@@ -153,12 +139,9 @@ set(hleg,'fontsize',legFontSz)
hBprint=plot(cell2mat(disphOLbX(i)),cell2mat(disphOLbY(i)))
set(hBprint,'linewidth',.5) %lnwidth) %0.5 then 1.5 now 6
set(hBprint,'color',linecolor{i})
hCprint=plot(cell2mat(disphOLcX(i)),cell2mat(disphOLcY(i)))
set(hCprint,'linewidth',0.5) %lnwidth) %0.5 then 1.5 now 6
set(hBprint,'color',linecolor{i})
end
hold off
end

View File

@@ -4,12 +4,10 @@ dirLst=dir(ExpPath)
for i=1:size(dirLst,1)
if ~isempty(str2num(dirLst(i).name)) || ~isempty(strfind(dirLst(i).name,'Scan')) % && jpgOut==1
scLst=fullfile(ExpPath,dirLst(i).name);
for n=1:size(filelst,1)
try
if ~isempty(strfind(filelst(n).name,'bmp'))||~isempty(strfind(filelst(n).name,'tif'))
tptImLst(n)=filelst(n).name;
end
catch
end
@@ -18,6 +16,7 @@ for i=1:size(dirLst,1)
end
scLength=length(scLst);
end
I=imread(ExpOutImFile);
expAxes=handles.Iaxes1;
imshow(I)
@@ -29,4 +28,3 @@ expAxes=handles.Iaxes3;
imshow(I)
set(expAxes,'xtick',[],'ytick',[])

View File

@@ -6,14 +6,14 @@ global userPars
global usrExpJobsDir
global zonePB
global mpdmFile
global ghandles
% Initialize some variables from matlab
ezPath=which(mfilename);
[ezDir,ezFileName]=fileparts(ezPath);
ezDir=fullfile(easyDir);
[parentDir, ~]=fileparts(ezDir);
parentDir=fullfile(parentDir); % ../easy/apps
parentDir=fullfile(parentDir);
debug=1;
if debug
disp('Running in debug mode');
@@ -21,39 +21,54 @@ if debug
whos;
end
% Set scansDir (project scans directory) intelligently
if exist('PROJECT', 'var') && ~isempty(getenv('PROJECT'))
project=getenv('PROJECT');
fprintf('This script name: %s\n', ezFileName);
fprintf('Using project path: %s from environment variable PROJECT\n', scansDir);
disp('This usually indicates that we are in standalone mode');
elseif exist('PROJECT_SCANS_DIR', 'var') && ~isempty(getenv('PROJECT_SCANS_DIR'))
scansDir=getenv('PROJECT_SCANS_DIR');
% Set scansDir (project scans directory) intelligently
if exist('PROJECT_SCANS_DIR', 'var') && ~isempty(getenv('PROJECT_SCANS_DIR'))
scansDir=fullfile(getenv('PROJECT_SCANS_DIR'));
if exist(scansDir, 'dir')
fprintf('Using scans directory: %s from environment variable PROJECT_SCANS_DIR\n', scansDir);
disp('This usually indicates that we are in module mode');
if ~exist('PROJECT', 'var') || isempty(getenv('PROJECT'))
dirInfo=fileparts(scansDir);
project=dirInfo.name;
end
else
disp('WARNING: PROJECT_SCANS_DIR does not exist');
end
elseif exist('PROJECT', 'var') && ~isempty(getenv('PROJECT')) % for standalone mode
% scansDir=fullfile(parentDir, '..', '..', 'scans', getenv('PROJECT') 'out', 'easy', getenv('PROJECT'));
scansDir=fullfile(parentDir, '..', '..', 'scans', getenv('PROJECT'));
project=getenv('PROJECT');
fprintf('Using project path: %s from environment variable PROJECT\n', scansDir);
disp('This usually indicates that we are in standalone mode');
else
% TODO Lots of this is hardcoded logic, this TODO is just a reminder to change this block
% when changing EZ_DIR and other variables in the parent script
% when changing EASY/EZdir and other variables in the parent script
fprintf('WARNING: Running in standalone mode without PROJECT or PROJECT_SCANS_DIR environment variables (not recommended)\n');
fprintf('Beginning parent scans directory search\n');
fprintf('This usually indicates that we are in stand-alone mode without PROJECT or PROJECT_SCANS_DIR environment variables\n');
dirsToScan={
fullfile(parentDir,'..', '..', 'scans'),
fullfile(parentDir, '..', '..', 'ExpJobs'),
fullfile('/mnt/data/scans'),
fullfile('/mnt/data/ExpJobs'),
fullfile(parentDir, '..', '..', 'scans')
fullfile(parentDir, '..', '..', 'ExpJobs')
fullfile('mnt','data','scans')
fullfile('mnt','data', 'ExpJobs')
fullfile(parentDir, '..', '..', 'templates', 'scans-demo')
};
for d=dirsToScan
for i=1:length(dirsToScan)
d=dirsToScan(i);
if exist(d, 'dir')
subDirs=dir(d);
if ~isempty(subDirs)
fprintf('Found a non-empty parent scans directory in our list: %s\n', d);
fprintf('Scanning inside for a project scan directory\n');
[~, sortedIndices]=sort(datenum({dirs.date}), 'descend'); % sort by newest first
sortedDirs=dirs{sortedIndices};
scansDir=sortedDirs{1};
fprintf('Selected newest project scans directory: %s\n', scansDir);
pattern='^\d{6}_.*_.*';
matchedDirs={dirs(regexp(subDirs.name, pattern)).name};
if ~isempty(matchedDirs)
fprintf('Found a non-empty scans directory in our list: %s\n', char(d));
fprintf('Setting scansDir to %s\n', char(d));
scansDir=fullfile(d);
end
fprintf('Scanning inside %s for a project directory\n', char(d));
sortedMatchedDirs=sortrows(matchedDirs);
project=sortedMatchedDirs{0}; % select the latest dir (by date prefix)
fprintf('Selected latest project directory %s\n', char(project));
end
end
end
@@ -101,10 +116,7 @@ userPars.BProt=45;
userPars.Trenddefault={'1000'};
userPars.kfiltLim=str2double(userPars.BPdefault(6));
try
% Generate the Exp arrays
numExps=3;
for i=1:numExps
@@ -130,32 +142,20 @@ Exp(numExps+1).SGDtext=SGDtext;
Exp(numExps+1).SGDraw=SGDraw;
Exp(numExps+1).interacPBsel=0;
% Big outer loop try catch to ln844 end ln868
% try to use user selected 'ExpJobs' folder otherwise use a default
% 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')
load (fullfile(Exp(1).Dexp(1).ExpFoldr,'MasterPlateFiles','MPDMmat.mat'))
for i=1:numExps
Exp(i).Dexp.DM=;
Exp(i).Dexp(1).DM=DM;
Exp(i).Dexp(1).MP=MP;
Exp(i).Dexp(1).scan=scan;
Exp(i).cTraceIndx(1)=1;
end
Exp(1).Dexp(1).DM=DM;
Exp(2).Dexp(1).DM=DM;
Exp(3).Dexp(1).DM=DM;
Exp(1).Dexp(1).MP=MP;
Exp(2).Dexp(1).MP=MP;
Exp(3).Dexp(1).MP=MP;
Exp(1).Dexp(1).scan=scan;
Exp(2).Dexp(1).scan=scan;
Exp(3).Dexp(1).scan=scan;
load(fullfile(resDir,'PTmats','NImParameters'))
Exp(1).Dexp(1).ImParMat=ImParMat;
Exp(2).Dexp(1).ImParMat=ImParMat;
@@ -165,51 +165,35 @@ try
load(fullfile(resDir,'Fotos','Coordinates'))
load(fullfile(resDir,'Fotos','anlZones'))
load(fullfile(resDir,'Fotos','BGatTpts'))
Exp(1).Dexp(1).FexpScanSpots=FexpScanSpots;
Exp(2).Dexp(1).FexpScanSpots=FexpScanSpots;
Exp(3).Dexp(1).FexpScanSpots=FexpScanSpots;
Exp(1).Dexp(1).FexpScanBMtp=FexpScanBMtp;
Exp(2).Dexp(1).FexpScanBMtp=FexpScanBMtp;
Exp(3).Dexp(1).FexpScanBMtp=FexpScanBMtp;
Exp(1).Dexp(1).anlZoneRefs=anlZoneRefs;
Exp(2).Dexp(1).anlZoneRefs=anlZoneRefs;
Exp(3).Dexp(1).anlZoneRefs=anlZoneRefs;
for i=1:numExps
Exp(i).Dexp(1).FexpScanSpots=FexpScanSpots;
Exp(i).Dexp(1).FexpScanBMtp=FexpScanBMtp;
Exp(i).Dexp(1).anlZoneRefs=anlZoneRefs;
Exp(i).cTraceIndx(1)=1;
end
catch
end
Exp(1).traceN=0; Exp(2).traceN=0; Exp(3).traceN=0; %ZoneRelated
for i=1:numExps
Exp(i).traceN=0; % ZoneRelated
Exp(i).traceN=0;
Exp(i).hOL=[];
Exp(i).hOLb=[];
Exp(i).hOLname={};
Exp(i).hOLexpNm={};
Exp(i).hOLresDir={}
Exp(i).hOLplateNum=[];
Exp(i).hOLresDir={};
Exp(i).RFmd1indx=[];
Exp(i).RFmd1pltN=[];
Exp(i).RFmd2indx=[];
Exp(i).RFmd2pltN=[];
end
Exp(1).hOL =[]; Exp(1).hOLb=[];
Exp(1).hOLname={}; Exp(1).hOLexpNm={}; Exp(1).hOLresDir={}
Exp(1).hOLplateNum=[];
Exp(1).hOLresDir= {};
Exp(1).RFmd1indx=[];
Exp(1).RFmd1pltN=[];
Exp(1).RFmd2indx=[];
Exp(1).RFmd2pltN=[];
Exp(2).hOL =[]; Exp(2).hOLb=[];
Exp(2).hOLname={}; Exp(2).hOLexpNm={}; Exp(2).hOLresDir={};
Exp(2).hOLplateNum=[];
Exp(2).hOLresDir= {};
Exp(2).RFmd1indx=[];
Exp(2).RFmd1pltN=[];
Exp(2).RFmd2indx=[];
Exp(2).RFmd2pltN=[];
Exp(3).hOL =[]; Exp(3).hOLb=[];
Exp(3).hOLname={}; Exp(3).hOLexpNm={}; Exp(3).hOLresDir={};
Exp(3).hOLplateNum=[];
Exp(3).hOLresDir= {};
Exp(3).RFmd1indx=[];
Exp(3).RFmd1pltN=[];
Exp(3).RFmd2indx=[];
Exp(3).RFmd2pltN=[];
%sefaults values for EZvFigPrint that meet JLH preferences
% default values for EZvFigPrint that meet JLH preferences
Exp(4).plotPars={'4','36','10','5'};
expN=1;
% Test for Bad MP cell array (usually 384 [NaN}'s)
% replaced length(Exp(expN).Dexp(1).MP) with MPnum
for mx=1:length(Exp(expN).Dexp(1).MP)
@@ -220,8 +204,6 @@ try
break
end
end
%*************************************************
% MPnum=length(Exp(expN).Dexp(1).MP);
set(handles.MPsldr1,'min',1,'max',MPnum)
@@ -235,7 +217,6 @@ try
set(handles.Tptsldr1,'min',1,'max',tPtsSize)
set(handles.Tptsldr2,'min',1,'max',tPtsSize)
set(handles.Tptsldr3,'min',1,'max',tPtsSize)
set(handles.MPsldr1,'SliderStep',[1/MPnum 1/MPnum]); %[1/length(MP) 1/length(MP)])
set(handles.DMsldr1,'SliderStep',[1/length(DM.drug) 1/length(DM.drug)]);
set(handles.Tptsldr1,'SliderStep',[1/tPtsSize 1/tPtsSize]);
@@ -248,7 +229,7 @@ try
try
xp=char(Exp(expN).Dexp(1).resDir);
if ispc,
if ispc
slashPos=strfind(char(Exp(expN).Dexp(1).resDir),'\');
else
slashPos=strfind(char(Exp(expN).Dexp(1).resDir),'/');
@@ -262,13 +243,11 @@ try
catch
cd(w)
end %internal try xp=char(Exp(expN).Dexp(1).resDir); if ispc,...
catch
cd(w)
msg='LOADing or Setup issue'
%if no load, then Message try SelExp PB to reload or try and different
%Experiment
end %nested try-catch-end from ->ExpOutmat= fullfile(scansDir,openExpfile);
% if no load, then Message try SelExp PB to reload or try and different experiment
end
try
DNLaxes1=handles.DNLaxes1; DNLaxes2=handles.DNLaxes2; DNLaxes3=handles.DNLaxes3;
@@ -280,22 +259,21 @@ try
Exp(1).expLoadCnt=1;
Exp(2).expLoadCnt=1;
Exp(3).expLoadCnt=1;
catch ME, ME.message,
catch ME
ME.message,
end
%**********************************************************************
%****Compile GeneList and OrfList,****************************************
%****Sort and add the medians of Ref Plates if RF1,RF2 exist**************
% Compile GeneList and OrfList
% Sort and add the medians of Ref Plates if RF1,RF2 exist
set(handles.listboxGnOrf,'string',{('Loading')})
lstindx=0;
lstindxOrf=0;
spN=0;
rfcnt=0;
dRF1indx=0;
RF1mp=[]; RF2mp=[];
RF1mp=[];
RF2mp=[];
for mp=1:MPnum %length(Exp(expN).Dexp(1).MP)
RF1fullPlate=0;
try RF1fullPlate=sum(ismember((Exp(expN).Dexp(1).MP(mp).genename{1}),'RF1'))==384; catch, mp, msg=strcat(num2str(mp),' genename ERROR'), end
RF2fullPlate=0;
@@ -305,9 +283,6 @@ try
try % temp find data error
r=ceil(ind384/24);
if rem(ind384,24)==0, c=24; else c=rem(ind384,24); end
% 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(1).MP(mp).genename{1}(ind384))==38991,
@@ -316,14 +291,12 @@ try
elseif isnumeric(cell2mat(Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)))
Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)={' '};
end
%****Check for full(384spot) Reference Plates (RF1 or/and RF2)**************
% Check for full(384spot) Reference Plates (RF1 or/and RF2)
RF1fullPlate=0;
try RF1fullPlate=sum(ismember((Exp(expN).Dexp(1).MP(mp).genename{1}),'RF1'))==384; catch, mp, msg=strcat(num2str(mp),' genename ERROR'), end
RF2fullPlate=0;
try RF2fullPlate=sum(ismember((Exp(expN).Dexp(1).MP(mp).genename{1}),'RF2'))==384; catch, mp, msg=strcat(num2str(mp),' genename ERROR'), end
if isempty(regexpi(char((Exp(expN).Dexp(1).MP(mp).orf{1}(ind384))),'blank'))... %,'\<blank\>'
&& ~isnumeric(Exp(expN).Dexp(1).MP(mp).orf{1}(ind384))...
&& ~strcmpi((Exp(expN).Dexp(1).MP(mp).orf{1}(ind384)),' ')...
@@ -333,17 +306,14 @@ try
&& ~strcmpi((Exp(expN).Dexp(1).MP(mp).orf{1}(ind384)),'RF1')...
&& ~strcmpi((Exp(expN).Dexp(1).MP(mp).orf{1}(ind384)),'RF2')...
&& iscellstr((Exp(expN).Dexp(1).MP(mp).orf{1}(ind384))) % .genename{1}(ind384)))
lstindxOrf=lstindxOrf+1;
bb(lstindxOrf,1)=(Exp(expN).Dexp(1).MP(mp).orf{1}(ind384));
bb(lstindxOrf,2)={strcat(':',num2str(mp),':',num2str(r),':',num2str(c))};
bb(lstindxOrf,3)={mp};
bb(lstindxOrf,4)={r};
bb(lstindxOrf,5)={c};
mutorfs(lstindxOrf)=spN; %16_0318 added for Interaction EZinteract
end
if isempty(regexpi(char((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384))),'blank'))... %,'\<blank\>'
&& ~isnumeric(Exp(expN).Dexp(1).MP(mp).genename{1}(ind384))...
&& ~strcmpi((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),' ')...
@@ -353,40 +323,31 @@ try
&& ~strcmpi((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),'RF1')...
&& ~strcmpi((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),'RF2')...
&& iscellstr((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)))
lstindx=lstindx+1;
aa(lstindx,1)=(Exp(expN).Dexp(1).MP(mp).genename{1}(ind384));
aa(lstindx,2)={strcat(':',num2str(mp),':',num2str(r),':',num2str(c))};
aa(lstindx,3)={mp};
aa(lstindx,4)={r};
aa(lstindx,5)={c};
mutgenes(lstindx)=spN;
% Exp(expN).Dexp(1).mutSpotIndx.woRFs(lstindx)=spN;
elseif (RF1fullPlate==1 ||... %sum(ismember((Exp(expN).Dexp(1).MP(mp).genename{1}),'RF1'))==384 || ...
(length(unique(Exp(expN).Dexp(1).MP(mp).genename{1}(1:384)))) ==1 && mp==1 ) && ... %(isequal((Exp(expN).Dexp(1).MP(mp).genename{1}(1:384)), (Exp(expN).Dexp(1).MP(mp).genename{1}(384:-1:1)))&& mp==1 )) && ...
~exist('RF1scanN','var')
elseif (RF1fullPlate==1 ... % sum(ismember((Exp(expN).Dexp(1).MP(mp).genename{1}),'RF1'))==384 || ...
|| (length(unique(Exp(expN).Dexp(1).MP(mp).genename{1}(1:384))))==1 && mp==1 ) ... %(isequal((Exp(expN).Dexp(1).MP(mp).genename{1}(1:384)), (Exp(expN).Dexp(1).MP(mp).genename{1}(384:-1:1)))&& mp==1 )) && ...
&& ~exist('RF1scanN','var')
RF1mp=mp
RF1scanN=(mp*DMnum)-(DMnum-1); %mp;
rfcnt=rfcnt+1;
RFs(spN:spN+383)=spN:spN+383;
elseif (RF2fullPlate==1|| ... %sum(ismember((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),'RF2'))==384 ||...
(length(unique(Exp(expN).Dexp(1).MP(mp).genename{1}(1:384)))) ==1 && mp== MPnum ) && ...
~exist('RF2scanN','var')
elseif (RF2fullPlate==1 ... %sum(ismember((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),'RF2'))==384 ||...
|| (length(unique(Exp(expN).Dexp(1).MP(mp).genename{1}(1:384))))==1 && mp==MPnum ) && ~exist('RF2scanN','var')
rfcnt=rfcnt+1;
RFs(spN:spN+383)=spN:spN+383;
asdf=sparse(RFs);
asd=find(asdf);
RFs=asd;
RF2mp=mp
RF2scanN=(mp*DMnum)-(DMnum-1); %mp;
elseif strcmpi((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),'RF1') && ...
(RF1fullPlate~=1)
elseif strcmpi((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),'RF1') && (RF1fullPlate~=1)
dRF1indx=dRF1indx+1;
Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)=strrep((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),':',' ');
drf(dRF1indx,1)=(Exp(expN).Dexp(1).MP(mp).genename{1}(ind384));
@@ -395,18 +356,16 @@ try
drf(dRF1indx,4)={r}; drfr(dRF1indx,mp)=r;
drf(dRF1indx,5)={c}; drfc(dRF1indx,mp)=c;
drf(dRF1indx,6)={ind384}; drfPindx(dRF1indx,mp)=ind384;
end % if isempty(regexpi(char((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384))),'blank'))...
%**********************************************************************
catch
mp
ind384
msgBadGeneName=strcat('check genename at mp=',num2str(mp),' indx=',num2str(ind384))
end
end %end associated with for ind384=1:384
end
mp
end %end associated with for mp=1:length(Exp(expN).Dexp(1).MP)
%*****************************************************
end
% Cover case if mutorfs RFs are labeled RF1 or RF2
try
Exp(1).Dexp(1).mutSpotIndx.wRFs=union(RFs, mutorfs);
@@ -420,16 +379,16 @@ try
Exp(expN).Dexp(1).mutSpotIndx.woRFs=mutorfs;
msg='No RFs Found in Exp! woRFs'
end
Exp(2).Dexp(1).mutSpotIndx.wRFs=Exp(1).Dexp(1).mutSpotIndx.wRFs;
Exp(2).Dexp(1).mutSpotIndx.woRFs=Exp(1).Dexp(1).mutSpotIndx.woRFs;
Exp(3).Dexp(1).mutSpotIndx.wRFs=Exp(1).Dexp(1).mutSpotIndx.wRFs;
Exp(3).Dexp(1).mutSpotIndx.woRFs=Exp(1).Dexp(1).mutSpotIndx.woRFs;
%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Exp(1).Dexp(1).RFmd1indx=[]; Exp(2).Dexp(1).RFmd1indx=[]; Exp(3).Dexp(1).RFmd1indx=[];
Exp(1).Dexp(1).RFmd1pltN=[]; Exp(2).Dexp(1).RFmd1pltN=[]; Exp(3).Dexp(1).RFmd1pltN=[];
Exp(1).Dexp(1).RFmean=[]; Exp(2).Dexp(1).RFmean=[]; Exp(3).Dexp(1).RFmean=[];
Exp(1).Dexp(1).RFmeanG=[]; Exp(2).Dexp(1).RFmeanG=[]; Exp(3).Dexp(1).RFmeanG=[];
if exist('RF1scanN','var')
for d=0:(DMnum-1)
medianIndx=[];
@@ -439,11 +398,12 @@ try
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));
if isempty(nonZeroIndx), nonZeroCnt=0; medianIndx= nonZeroIndx;
else nonZeroCnt=length(nonZeroIndx);
if isempty(nonZeroIndx)
nonZeroCnt=0
medianIndx=nonZeroIndx;
else
nonZeroCnt=length(nonZeroIndx);
end
%
if ~isempty(nonZeroIndx) && mod(nonZeroCnt,2)==0, medianIndx=nonZeroIndx(1:nonZeroCnt-1); end
if ~isempty(nonZeroIndx) && mod(nonZeroCnt,2)~=0, medianIndx=nonZeroIndx; end
clear medValLst
@@ -456,10 +416,8 @@ try
max1=max(medValLst);
std1=std(medValLst);
mean1=mean(medValLst)
kValLst=Exp(expN).Dexp(1).scan(rf1scN).plate(1).CFout(medianIndx,3); % For Ref Composite 17_1009
rValLst=Exp(expN).Dexp(1).scan(rf1scN).plate(1).CFout(medianIndx,4); % For Ref Composite 17_1009
mval1=median(medValLst); % (Exp(expN).Dexp(1).scan(RF1scanN).plate(1).CFout(383,5));
RFmd1pos=find(mval1==(Exp(expN).Dexp(1).scan(rf1scN).plate(1).CFout(1:384,5)))
RFmd1loc(1)=ceil(RFmd1pos/24); %calc r value
@@ -470,14 +428,13 @@ try
aa(lstindx,2)={strcat(':',num2str(RF1mp),':',num2str(RFmd1loc(1)),':',num2str(RFmd1loc(2)))}; %,' std',num2str(std1))};
bb(lstindxOrf,1)={strcat('RF1md(',num2str(d+1),')')};
bb(lstindxOrf,2)={strcat(':',num2str(RF1mp),':',num2str(RFmd1loc(1)),':',num2str(RFmd1loc(2)))}; %,' std',num2str(std1))};
%Composite Reference Amalgum Plot ********
% Composite Reference Amalgum Plot
lstindx=lstindx+1;
lstindxOrf=lstindxOrf+1;
aa(lstindx,1)={strcat('RF1cmp(',num2str(d+1),')')};
aa(lstindx,2)={''};
bb(lstindxOrf,1)={strcat('RF1cmp(',num2str(d+1),')')};
bb(lstindxOrf,2)={''};
%*******************************************
Exp(1).Dexp(1).RFmd1LB(d+1)=strcat(aa(lstindx,1),aa(lstindx,2)); Exp(2).Dexp(1).RFmd1LB(d+1)=strcat(aa(lstindx,1),aa(lstindx,2)); Exp(3).Dexp(1).RFmd1LB(d+1)=strcat(aa(lstindx,1),aa(lstindx,2));
Exp(1).Dexp(1).RFmd1indx(d+1)=RFmd1pos; Exp(2).Dexp(1).RFmd1indx(d+1)=RFmd1pos; Exp(3).Dexp(1).RFmd1indx(d+1)=RFmd1pos;
@@ -510,26 +467,20 @@ try
Exp(ic).Dexp(1).RFcmpr(1).dm(d+1).min=min(rValLst); %For Ref Composite 17_1009
Exp(ic).Dexp(1).RFcmpr(1).dm(d+1).mean=max(rValLst); %For Ref Composite 17_1009
end
else
% Pick the first spot with zeros
medianCalcFailed='To Few nonZero spots for valid median RF1 selection'
firstZero=find(((Exp(expN).Dexp(1).scan(rf1scN).plate(1).CFout(1:384,5))==0),1,'first')
Exp(1).Dexp(1).RFmd1indx(d+1)=firstZero; Exp(2).Dexp(1).RFmd1indx(d+1)=firstZero; Exp(3).Dexp(1).RFmd1indx(d+1)=firstZero;
Exp(1).Dexp(1).RFmd1pltN=RF1mp; Exp(2).Dexp(1).RFmd1pltN=RF1mp; Exp(3).Dexp(1).RFmd1pltN=RF1mp; %EZdestComp uses the masterplate number to get all the destPlates scanNumbers
try, medValList1{d+1}=Exp(expN).Dexp(1).scan(rf1scN).plate(1).CFout(medianIndx,5); nonZeroCnt; catch end
end
catch %try ~ln219
catch
medianCalcTryFailed1='Failed! Failed! But process continued with bogus P1ind384 spot value!'
try
firstZero=find(((Exp(expN).Dexp(1).scan(rf1scN).plate(1).CFout(1:384,5))==0),1,'first')
Exp(1).Dexp(1).RFmd1indx(d+1)=firstZero; Exp(2).Dexp(1).RFmd1indx(d+1)=firstZero; Exp(3).Dexp(1).RFmd1indx(d+1)=firstZero;
catch
catchissue='Ln328'
Exp(1).Dexp(1).RFmd1indx(d+1)=384; Exp(2).Dexp(1).RFmd1indx(d+1)=384; Exp(3).Dexp(1).RFmd1indx(d+1)=384; %if crapout,Then use spot384 as default to keep going
end
try
@@ -538,12 +489,9 @@ try
catchissue='Ln334'
Exp(1).Dexp(1).RFmd1pltN=1; Exp(2).Dexp(1).RFmd1pltN=1; Exp(3).Dexp(1).RFmd1pltN=1;
end
error='EZvInit after Ln278'
end %try ~ln219
end %for d=0:DMnum
end % if exist('RF1scanN','var')
%*************************************************************************************
end
end
end
Exp(1).Dexp(1).RFmd2indx=[]; Exp(2).Dexp(1).RFmd2indx=[]; Exp(3).Dexp(1).RFmd2indx=[];
Exp(1).Dexp(1).RFmd2pltN=[]; Exp(2).Dexp(1).RFmd2pltN=[]; Exp(3).Dexp(1).RFmd2pltN=[];
@@ -554,29 +502,28 @@ try
nonZeroIndx2=[];
medValList2=[];
rf2scN=RF2scanN+d;
try % if RF2scanN doesn't exist this addition to list will be skipped
nonZeroIndx2=find(Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(1:384,5));
if isempty(nonZeroIndx2), nonZeroCnt2=0; medianIndx2= nonZeroIndx2;
else nonZeroCnt2=length(nonZeroIndx2);
if isempty(nonZeroIndx2)
nonZeroCnt2=0
medianIndx2=nonZeroIndx2;
else
nonZeroCnt2=length(nonZeroIndx2);
end
%
if ~isempty(nonZeroIndx2) && mod(nonZeroCnt2,2)==0, medianIndx2=nonZeroIndx2(1:nonZeroCnt2-1); end
if ~isempty(nonZeroIndx2) && mod(nonZeroCnt2,2)~=0, medianIndx2=nonZeroIndx2; end
clear medValLst2
clear kValLst2
clear rValLst2
if ~isempty(nonZeroIndx2) && length(medianIndx2) > (.15*384) %To calc. a median, more than 15% of spots must be nonZero
if ~isempty(nonZeroIndx2) && length(medianIndx2) > (.15*384) % to calc. a median, more than 15% of spots must be nonZero
medValLst2=Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(medianIndx2,5);
medValList2{d+1}=medValLst2;
min2=min(medValLst2);
max2=max(medValLst2);
std2=std(medValLst2)
mean2=mean(medValLst2);
kValLst2=Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(medianIndx2,3); %For Ref Composite 17_1009
rValLst2=Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(medianIndx2,4); %For Ref Composite 17_1009
mval2=median(medValLst2); %(Exp(expN).Dexp(1).scan(RF2scanN).plate(1).CFout(1:383,5));
RFmd2pos=find(mval2==(Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(1:384,5)));
RFmd2loc(1)=ceil(RFmd2pos/24); %calc r value
@@ -594,7 +541,6 @@ try
aa(lstindx,2)={''};
bb(lstindxOrf,1)={strcat('RF2cmp(',num2str(d+1),')')};
bb(lstindxOrf,2)={''};
Exp(1).Dexp(1).RFmd2LB(d+1)=strcat(aa(lstindx,1),aa(lstindx,2)); Exp(2).Dexp(1).RFmd2LB(d+1)=strcat(aa(lstindx,1),aa(lstindx,2)); Exp(3).Dexp(1).RFmd2LB(d+1)=strcat(aa(lstindx,1),aa(lstindx,2));
Exp(1).Dexp(1).RFmd2indx(d+1)=RFmd2pos; Exp(2).Dexp(1).RFmd2indx(d+1)=RFmd2pos; Exp(3).Dexp(1).RFmd2indx(d+1)=RFmd2pos;
Exp(1).Dexp(1).RFmd2pltN=RF2mp; Exp(2).Dexp(1).RFmd2pltN=RF2mp; Exp(3).Dexp(1).RFmd2pltN=RF2mp;
@@ -626,7 +572,6 @@ try
Exp(ic).Dexp(1).RFcmpr(2).dm(d+1).min=min(rValLst2); %For Ref Composite 17_1009
Exp(ic).Dexp(1).RFcmpr(2).dm(d+1).max=max(rValLst); %For Ref Composite 17_1009
end
else
% Pick the first spot with zeros
% Use that position to satisfy and keep process OK
@@ -634,25 +579,23 @@ try
firstZero2=find(((Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(1:384,5))==0),1,'first')
Exp(1).Dexp(1).RFmd2indx(d+1)=firstZero2; Exp(2).Dexp(1).RFmd2indx(d+1)=firstZero2; Exp(3).Dexp(1).RFmd2indx(d+1)=firstZero2;
Exp(1).Dexp(1).RFmd2pltN=RF2mp; Exp(2).Dexp(1).RFmd2pltN=RF2mp; Exp(3).Dexp(1).RFmd2pltN=RF2mp;
try, medValList2{d+1}= Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(medianIndx2,5); nonZeroCnt2; catch end
try
medValList2{d+1}=Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(medianIndx2,5);
nonZeroCnt2;
catch
end
end
catch
medianCalcTryFailed2='Failed! Failed! No RF1median But process continued with bogus P1ind384 spot value!'
try
firstZero2=find(((Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(1:384,5))==0),1,'first')
Exp(1).Dexp(1).RFmd2indx(d+1)=firstZero2; Exp(2).Dexp(1).RFmd2indx(d+1)=firstZero2; Exp(3).Dexp(1).RFmd2indx(d+1)=firstZero2;
catch
catchissue='Ln402'
Exp(1).Dexp(1).RFmd2indx(d+1)=384; Exp(2).Dexp(1).RFmd2indx(d+1)=384; Exp(3).Dexp(1).RFmd2indx(d+1)=384; %if crapout,Then use spot384 as default to keep going
end
try
Exp(1).Dexp(1).RFmd2pltN=RF2mp; Exp(2).Dexp(1).RFmd2pltN=RF2mp; Exp(3).Dexp(1).RFmd2pltN=RF2mp;
catch
catchissue='Ln408'
Exp(1).Dexp(1).RFmd2pltN=1; Exp(2).Dexp(1).RFmd2pltN=1; Exp(3).Dexp(1).RFmd2pltN=1;
end
end % if RF2scanN doesn't exist this addition to list will be skipped
@@ -661,31 +604,24 @@ try
Exp(1).Dexp(1).RFstd(d+1)=std(RFcombValList);Exp(2).Dexp(1).RFstd(d+1)=std(RFcombValList);Exp(3).Dexp(1).RFstd(d+1)=std(RFcombValList);
Exp(1).Dexp(1).RFmin(d+1)=min(RFcombValList);Exp(2).Dexp(1).RFmin(d+1)=min(RFcombValList);Exp(3).Dexp(1).RFmin(d+1)=min(RFcombValList);
Exp(1).Dexp(1).RFmax(d+1)=max(RFcombValList);Exp(2).Dexp(1).RFmax(d+1)=max(RFcombValList);Exp(3).Dexp(1).RFmax(d+1)=max(RFcombValList);
%can delete the following redundant line of code
% TODO can delete the following redundant line of code
Exp(2).Dexp(1).RFmean(d+1)=Exp(1).Dexp(1).RFmean(d+1); Exp(3).Dexp(1).RFmean(d+1)=Exp(1).Dexp(1).RFmean(d+1);
end %for d=0:DMnum
end
elseif exist('RF1scanN','var')
Exp(1).Dexp(1).RFmean=Exp(1).Dexp(1).mean1; Exp(2).Dexp(1).RFmean=Exp(2).Dexp(1).mean1; Exp(3).Dexp(1).RFmean=Exp(3).Dexp(1).mean1;
Exp(1).Dexp(1).RFstd=Exp(1).Dexp(1).std1; Exp(2).Dexp(1).RFstd=Exp(2).Dexp(1).std1; Exp(3).Dexp(1).RFstd=Exp(3).Dexp(1).std1;
Exp(1).Dexp(1).RFmin=Exp(1).Dexp(1).min1; Exp(2).Dexp(1).RFmin=Exp(2).Dexp(1).min1; Exp(3).Dexp(1).RFmin=Exp(3).Dexp(1).min1;
Exp(1).Dexp(1).RFmax=Exp(1).Dexp(1).max1; Exp(2).Dexp(1).RFmax=Exp(2).Dexp(1).max1; Exp(3).Dexp(1).RFmax=Exp(3).Dexp(1).max1;
end %if exist('RF2scanN','var')
end
%*************************************************************************************************
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%*************************************************************************************************
%***********DISPERSE REFERENCE PLATES
% DISPERSE REFERENCE PLATES
Exp(expN).Dexp(1).RFmdPindx=[];
Exp(expN).Dexp(1).RFmdPpltN=[];
if exist('drf','var') % ('RF1scanN','var')
% Det. index of change from one MP to the next
i=2;
chgIndx(1)=1;
for j=1:length(drf(:,3))
if j>1
if cell2mat(drf(j,3))~=cell2mat(drf((j-1),3)), chgIndx(i)=j; i=i+1; end
end
@@ -694,38 +630,33 @@ try
uu=zeros(size(drf,1),4);
uu(:,1:4)=cell2mat(drf(:,3:6));
vv=zeros(length(drf),DMnum);
%************************************
dMPs=unique(cell2mat(drf(:,3)));
%*****************************************
for mm=1:length(dMPs)
for d=1:(DMnum)
medianIndxDisp=[];
NZrefIndxP=[];
nonZeroValsP=[];
medValLstDisp=[];
rf1scNdisp=((dMPs(mm)-1)*DMnum)+(d);
try % Determine the dispersed RFs median mean and std if such exist
NZrefIndxP=drfPindx((find(drfPindx(:,dMPs(mm)))),dMPs(mm));
vv(chgIndx(mm):(chgIndx(mm+1)-1),d)=Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5);
%For Global Ref Composite 17_1009 %**************************************************************************
% For Global Ref Composite 17_1009
vvK(chgIndx(mm):(chgIndx(mm+1)-1),d)=Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,3);
vvr(chgIndx(mm):(chgIndx(mm+1)-1),d)=Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,4);
%*****************************************************************************************************
nonZeroValsP=nonzeros(Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5));
minDisp=min(nonZeroValsP);
maxDisp=max(nonZeroValsP);
std1Disp=std(nonZeroValsP);
mean1Disp=mean(nonZeroValsP);
drfVals=Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5);
%MEDIAN Determination for PLATES with Dispersed RFs
if isempty(NZrefIndxP), nonZeroCntDisp=0, medianIndxDisp= NZrefIndxP;
else nonZeroCntDisp=length(NZrefIndxP);
if isempty(NZrefIndxP)
nonZeroCntDisp=0
medianIndxDisp=NZrefIndxP;
else
nonZeroCntDisp=length(NZrefIndxP);
end
if ~isempty(NZrefIndxP) && mod(nonZeroCntDisp,2)==0, medianIndxDisp=NZrefIndxP(1:nonZeroCntDisp-1); end
if ~isempty(NZrefIndxP) && mod(nonZeroCntDisp,2)~=0, medianIndxDisp=NZrefIndxP; end
if ~isempty(NZrefIndxP) && length(medianIndxDisp) > 3 %(.15*384) %To calc. a median, more than 15% of spots must be nonZero
@@ -735,14 +666,12 @@ try
RFmd1posD=NZrefIndxP(nonZeroMedPosIndx);
RFmd1locD(1)=ceil(RFmd1posD/24); %calc r value
RFmd1locD(2)=RFmd1posD - ((RFmd1locD(1)-1)*24); %calc c value
lstindx=lstindx+1;
lstindxOrf=lstindxOrf+1;
aa(lstindx,1)={strcat('RF1mdP(',num2str(d),')')}; %{'RF1md'};
aa(lstindx,2)={strcat(':',num2str(dMPs(mm)),':',num2str(RFmd1locD(1)),':',num2str(RFmd1locD(2)))}; %,'std_',num2str(std1))};
bb(lstindxOrf,1)={strcat('RF1mdP(',num2str(d),')')}; %{'RF1md'};
bb(lstindxOrf,2)={strcat(':',num2str(dMPs(mm)),':',num2str(RFmd1locD(1)),':',num2str(RFmd1locD(2)))}; %,'std_',num2str(std1))};
Exp(1).Dexp(1).RFmdPLB(d,dMPs(mm))=strcat(aa(lstindx,1),aa(lstindx,2)); Exp(2).Dexp(1).RFmdPLB(d,dMPs(mm))=strcat(aa(lstindx,1),aa(lstindx,2)); Exp(3).Dexp(1).RFmdPLB(d,dMPs(mm))=strcat(aa(lstindx,1),aa(lstindx,2));
Exp(1).Dexp(1).RFmdPindx(d,dMPs(mm))=RFmd1posD; Exp(2).Dexp(1).RFmdPindx(d,dMPs(mm))=RFmd1posD; Exp(3).Dexp(1).RFmdPindx(d,dMPs(mm))=RFmd1posD;
Exp(1).Dexp(1).RFmdPpltN(d,dMPs(mm))=dMPs(mm); Exp(2).Dexp(1).RFmdPpltN(d,dMPs(mm))=dMPs(mm); Exp(3).Dexp(1).RFmdPpltN(d,dMPs(mm))=dMPs(mm);
@@ -751,7 +680,6 @@ try
Exp(1).Dexp(1).stdP(d,dMPs(mm))=std1Disp; Exp(2).Dexp(1).stdP(d,dMPs(mm))=std1Disp; Exp(3).Dexp(1).stdP(d,dMPs(mm))=std1Disp;
Exp(1).Dexp(1).minP(d,dMPs(mm))=minDisp; Exp(2).Dexp(1).minP(d,dMPs(mm))=minDisp; Exp(3).Dexp(1).minP(d,dMPs(mm))=minDisp;
Exp(1).Dexp(1).maxP(d,dMPs(mm))=maxDisp; Exp(2).Dexp(1).maxP(d,dMPs(mm))=maxDisp; Exp(3).Dexp(1).maxP(d,dMPs(mm))=maxDisp;
else
% Need to set L r K values to zeros or pick the first spot with zeros
% Spot 1 could be other than zero as the median isn't calculated if fewer than some percent are nonzero
@@ -760,18 +688,14 @@ try
firstZeroD=drfPindx((firstZeroDindx),dMPs(mm));
Exp(expN).Dexp(1).RFmdPindx(d,dMPs(mm))=firstZeroD;
Exp(expN).Dexp(1).RFmdPpltN(d,dMPs(mm))=dMPs(mm); %RF1mp; %Is this supposed to be the MP number or the ScanPlate number???
end %~isempty(NZrefIndxP) && length(medianIndxDisp) > 3 ln584
catch %try ln565
end
catch
medianCalcTryFailed1D='Failed! Failed! Ln565 {Dispersed RF1s} "try" But process continued with bogus Plate spot value!'
try
firstZeroindxD=find(vv((chgIndx(d):chgIndx(d+1)-1),5)==0,1,'first')
firstZeroPindx=uu(firstZeroindxD,4);
Exp(expN).Dexp(1).RFmdPpltN(d,dMPs(mm))=dMPs(mm);
Exp(expN).Dexp(1).RFmdPindx(d,dMPs(mm))=firstZeroPindx;
catch
catchissue='try at Ln565'
Exp(expN).Dexp(1).RFmdPpltN(d,dMPs(mm))=dMPs(mm);
@@ -783,12 +707,11 @@ try
catchissue='Ln'
Exp(expN).Dexp(1).RFmdPpltN=1; %This might keep from breaking BUT ???
end
end %try ~ln565
end
end
end
end %for d=0:DMnum
end %for mm=1:length(dMPs)
%****************CALC. GLOBAL MEAN, STD, AND MEDIAN FOR DISTRIBUTED REFERENCES******************************************************************
% Calc. Global Mean, Std, And Median For Distributed References
uu=horzcat(uu,vv);
for d=1:DMnum
medianIndxD=[];
@@ -798,16 +721,15 @@ try
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)));
if isempty(RFmeanG), nonZeroCntD=0;
else nonZeroCntD= length(nonzeros(vv(:,d)));
if isempty(RFmeanG)
nonZeroCntD=0;
else
nonZeroCntD=length(nonzeros(vv(:,d)));
end
% Calc. of median requires an odd number of indx items
if ~isempty(NZrfIndxG) && mod(nonZeroCntD,2)==0, medianIndxD=NZrfIndxG(1:(size(NZrfIndxG,1)-1)); end
if ~isempty(NZrfIndxG) && mod(nonZeroCntD,2)~=0, medianIndxD=NZrfIndxG(:); end
if ~isempty(NZrfIndxG) && length(medianIndxD) > (.15*size(drf,1)) % To calc. a median, more than 15% of spots must be nonZero
mvalsDG=median(vv(medianIndxD,d)); % (nonzeros(vv(:,d)));
nzPosIndxDG=find(mvalsDG==vv(:,d));
RFmdDGloc(d,1)=uu(nzPosIndxDG,1); % MP of distributedGlobal Median value
@@ -819,14 +741,13 @@ try
aa(lstindx,2)={strcat(':',num2str(RFmdDGloc(d,1)),':',num2str(RFmdDGloc(d,2)),':',num2str(RFmdDGloc(d,3)))}; %,'std_',num2str(std2))};
bb(lstindxOrf,1)={strcat('RF1mdG(',num2str(d),')')};
bb(lstindxOrf,2)={strcat(':',num2str(RFmdDGloc(d,1)),':',num2str(RFmdDGloc(d,2)),':',num2str(RFmdDGloc(d,3)))}; %,'std_',num2str(std2))};
%Composite Reference Amalgum Plot ******************
% Composite Reference Amalgum Plot
lstindx=lstindx+1;
lstindxOrf=lstindxOrf+1;
aa(lstindx,1)={strcat('RFcmpG(',num2str(d),')')};
aa(lstindx,2)={''};
bb(lstindxOrf,1)={strcat('RFcmpG(',num2str(d),')')};
bb(lstindxOrf,2)={''};
%*****************************************************
Exp(1).Dexp(1).RFmdGLB(d)=strcat(aa(lstindx,1),aa(lstindx,2)); Exp(2).Dexp(1).RFmdGLB(d)=strcat(aa(lstindx,1),aa(lstindx,2)); Exp(3).Dexp(1).RFmdGLB(d)=strcat(aa(lstindx,1),aa(lstindx,2));
Exp(1).Dexp(1).RFmdGindx(d)=nzPosIndxDG; Exp(2).Dexp(1).RFmdGindx(d)=nzPosIndxDG; Exp(3).Dexp(1).RFmdGindx(d)=nzPosIndxDG;
Exp(1).Dexp(1).RFmdGpltN(d)=RFmdDGloc(d,1); Exp(2).Dexp(1).RFmdGpltN(d)=RFmdDGloc(d,1); Exp(3).Dexp(1).RFmdGpltN(d)=RFmdDGloc(d,1);
@@ -856,19 +777,12 @@ try
Exp(ic).Dexp(1).RFcmpGr.dm(d).min=min(vvr(medianIndxD,d)); %For Ref Composite 17_1009
Exp(ic).Dexp(1).RFcmpGr.dm(d).max=max(vvr(medianIndxD,d)); %For Ref Composite 17_1009
end
end %if ~isempty(NZrfIndxG(:,d)) && length(medianIndxD) > (.15*size(drf,1))
end %for d=1:DMnum
end % if exist('drf','var')
%END OF DISPERSE REFERENCE PLATAES CALCULATIONS AND LIST ADDITIONS
%*****************************************************************************************************
%SORT and build GeneList
end
end
end
% End Of Disperse Reference Plataes Calculations And List Additions
% Sort And Build Genelist
Exp(1).Dexp(1).srtGnLst={('CheckMP/MPDMfile')};
gnLstRaw=strcat(aa(:,1),aa(:,2));
Exp(1).Dexp(1).srtGnLst=sort(gnLstRaw);
@@ -890,95 +804,75 @@ try
Exp(1).Dexp(1).srtOrfLst=cellstr([{'Failed To Load'}; {' '}]);
Exp(2).Dexp(1).srtOrfLst=cellstr([{'Failed To Load'}; {' '}]);
Exp(3).Dexp(1).srtOrfLst=cellstr([{'Failed To Load'}; {' '}]);
%[openExpfile,scansDir]
if isempty(strfind(openExpfile,'.mat'))
if ~contains(openExpfile,'.mat')
cd(scansDir)
cd ..
cd '..'
ExpPath=pwd;
cd(w)
ExpOutImFile=fullfile(scansDir,openExpfile);
EZvImagesOnly
end
end
%*********************************************************
expN=1; % Fix 170424
DexpN=1;
EZdiagRFsSheet %*
%****************
EZdiagRFsSheet
Exp(1).Dexp(1).RFrnames=rnames; Exp(2).Dexp(1).RFrnames=rnames; Exp(3).Dexp(1).RFrnames=rnames;
Exp(1).Dexp(1).RFdata=data; Exp(2).Dexp(1).RFdata=data; Exp(3).Dexp(1).RFdata=data;
%*********************************************************
RFconfig=0;
if sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmean'))&&...
~isempty(Exp(expN).Dexp(1).RFmean)&&...
sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmeanG'))&&...
isempty(Exp(expN).Dexp(1).RFmeanG)
if sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmean')) ...
&& ~isempty(Exp(expN).Dexp(1).RFmean) ...
&& sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmeanG')) ...
&& isempty(Exp(expN).Dexp(1).RFmeanG)
RFconfig=1;
end
if sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmean'))==0 ||...
isempty(Exp(expN).Dexp(1).RFmean)&&...
sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmeanG'))&&...
~isempty(Exp(expN).Dexp(1).RFmeanG)
if sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmean'))==0 ...
|| isempty(Exp(expN).Dexp(1).RFmean) ...
&& sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmeanG')) ...
&& ~isempty(Exp(expN).Dexp(1).RFmeanG)
RFconfig=2;
end
if sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmean'))&&...
~isempty(Exp(expN).Dexp(1).RFmean)&&...
sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmeanG'))&&...
~isempty(Exp(expN).Dexp(1).RFmeanG)
if sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmean')) ...
&& ~isempty(Exp(expN).Dexp(1).RFmean) ...
&& sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmeanG')) ...
&& ~isempty(Exp(expN).Dexp(1).RFmeanG)
RFconfig=3;
end
Exp(1).RFconfig=RFconfig; Exp(2).RFconfig=RFconfig; Exp(3).RFconfig=RFconfig; % ZoneRelated
%*****************************
try
msgBadGeneName
catch
end
try
Exp(1).Dexp(1).resetHtmpTg=3; Exp(2).Dexp(1).resetHtmpTg=3; Exp(3).Dexp(1).resetHtmpTg=3; % ZoneRelated
if RFconfig==0,
if RFconfig==0
RFconfigMsg='No RF1 references in this Experiment Job'
Exp(1).resetHtmpTg=3; Exp(2).resetHtmpTg=3; Exp(3).resetHtmpTg=3; % ZoneRelated
end
catch
end
%*****************************
prntHt=0;
% HtMapTog 'string', 'Current user HL/HN' selection'
try
Exp(1).htmapPBsel=0;
set(handles.HtMapTog1,'string','L')
Exp(2).htmapPBsel=0; %ZoneRelated
set(handles.HtMapTog2,'string','L')
Exp(3).htmapPBsel=0;
set(handles.HtMapTog3,'string','L')
catch
% expN=1;
end
%************************************************************************
%Added 17-1023 For User Addition of Gene Composites to ListBox
for ic=1:3
Expaa{ic,1}= aa; Expbb{ic,1}= bb;
Expaa{ic,1}=aa;
Expbb{ic,1}=bb;
end
%**********************************************************************
htMapTogPBfg=0;
Exp(1).htmapRFanswer={'G','L'}; % ZoneRelated
Exp(2).htmapRFanswer={'G','L'};
Exp(3).htmapRFanswer={'G','L'};
zonePB=expN; % added 230828 to fix migration
%------Adapt for AppDesigner 230821-----------
global ghandles
ghandles=handles;
%global Exp(4)
ghandles.guiFig=gcf;
Exp(4).guiFig=gcf;

View File

@@ -20,7 +20,6 @@ clear all
%P=[40,40];
%center=[refPtR+ round(.5*width), refPtC+ round(.5*width)];
%A=zeros(70,70);
%---------------------------------------------------------------------
%radius=14;
diaExt=2*(radius+1);
circBoxA=zeros(diaExt,diaExt);
@@ -30,13 +29,11 @@ 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;
cirPixA=nnz(cirMask);
optCirMask=double(cirMask);
optCirMask(optCirMask==0)=0.8;
%+++++++++++Foto Circle Fram(e)+++++++++++++++++++++
% Foto Circle Fram(e)
expansion=2;
radExpan=radius+expansion;
FdiaExt=2*(radExpan);
@@ -46,17 +43,14 @@ center= [radExpan+1, radExpan+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);
FoptCirMask=double(FcirMask);
FoptCirMask(FoptCirMask==1)=2;
% FoptCirMask(FoptCirMask==0)=1;
%********Combine Masks to create circular boundry************
% Combine Masks to create circular boundry
padOptCirMask=padarray(optCirMask,[expansion-1 expansion-1],0.8);
FoptCirMask=FoptCirMask .* padOptCirMask;
FoptCirMask(FoptCirMask==1.6)=0.8;
FoptCirMask(FoptCirMask==0)=1;
FoptCirMask(FoptCirMask==2)=1;
%---------------------------------------------------
% imagesc(cirMask)

View File

@@ -3,8 +3,6 @@
global ghandles
global Exp
try
lnwidth=str2num(Exp(4).plotPars{1})
axisFontSz=str2num(Exp(4).plotPars{2})
@@ -34,12 +32,11 @@ set(gcf,'OuterPosition',(get(0,'screensize')))
disphOLbX(1)={get(Exp(zone).hOLb(1),'XData')}
disphOLbY(1)={get(Exp(zone).hOLb(1),'YData')}
catch end
hn=hn+1
notDup=1;
end
notDup=0;
for hN=2:length(Exp(zone).hOL)
% Bounce-dupicate data removal
for j=1:(hN-1)
@@ -61,12 +58,12 @@ for hN=2:length(Exp(zone).hOL)
try
disphOLbX(hn)={get(Exp(zone).hOLb(hN),'XData')};
disphOLbY(hn)={get(Exp(zone).hOLb(hN),'YData')};
catch end
catch
end
tmp(hn)=strrep(Exp(zone).hOLname(hN),'_','-')
catch ME
disp(ME)
display('error leading to line 59 catch')
end
end
end
@@ -78,14 +75,12 @@ for hN=2:length(Exp(zone).hOL)
set(hprint,'linewidth',lnwidth) %0.5 then 1.5 now 6
set(gca,'fontsize',axisFontSz) % 8 to 15 to 21
linecolor(i)={get(hprint,'color')};
else
hprint=semilogy(cell2mat(disphOLX(i)),cell2mat(disphOLY(i)))
set(hprint,'linewidth',lnwidth) %0.5 then 1.5 now 4.0
set(gca,'fontsize',axisFontSz) % 8 to 15 to 21
linecolor(i)={get(hprint,'color')};
end
hold all
end
@@ -93,7 +88,6 @@ hold all
legName=tmp
hleg=legend((legName),'location','NEO')
set(hleg,'fontsize',legFontSz)
try
for i=1:hn
if semiLog==0
@@ -102,11 +96,11 @@ try
hprint=semilogy(cell2mat(disphOLbX(i)),cell2mat(disphOLbY(i)),'marker','+','markerEdgeColor',cell2mat(linecolor(i)),'markerSize',markerSz, 'linestyle','none')
end
end
catch end
catch
end
hold off
%*******End of Standard Overlay Plot***********************
% End of Standard Overlay Plot
else %if Composite Plot
for hcN=1:(Exp(zone).cTraceN -1)
disphOLX(hcN)={get(Exp(zone).hCmean(hcN),'XData')};
@@ -122,7 +116,6 @@ hold off
set(hprint,'linewidth',lnwidth) %0.5 then 1.5 now 6
set(gca,'fontsize',axisFontSz) % 8 to 15 to 21
linecolor(hcN)={get(hprint,'color')};
else
hprint=semilogy(cell2mat(disphOLX(hcN)),cell2mat(disphOLY(hcN)))
set(hprint,'linewidth',lnwidth) %0.5 then 1.5 now 4.0
@@ -131,26 +124,19 @@ hold off
end
hold all
legName=tmp
hleg=legend((legName),'location','NEO')
set(hleg,'fontsize',legFontSz)
%{
for i=1:hn
hprint=plot(cell2mat(disphOLbX(i)),cell2mat(disphOLbY(i)),'marker','+','markerEdgeColor',cell2mat(linecolor(i)),'markerSize',markerSz, 'linestyle','none')
end
%}
end
for i=1:(Exp(zone).cTraceN -1)
hBprint=plot(cell2mat(disphOLbX(i)),cell2mat(disphOLbY(i)))
set(hBprint,'linewidth',.5) %lnwidth) %0.5 then 1.5 now 6
set(hBprint,'color',linecolor{i})
hCprint=plot(cell2mat(disphOLcX(i)),cell2mat(disphOLcY(i)))
set(hCprint,'linewidth',0.5) %lnwidth) %0.5 then 1.5 now 6
set(hBprint,'color',linecolor{i})

View File

@@ -1,4 +1,4 @@
% Create the text in an axis:
% Create the text in an axis
hFstrip=figure;
%figure(hFstrip,'Visible','off')

View File

@@ -25,7 +25,6 @@ if get(handles.GeneOrfTog,'value')==0
if strcmpi(gnXref,'HO'), gene=strcat(gene,',',gnXref);end
name=strcat(char(gene),'->',char(orfXref));
end
elseif get(handles.GeneOrfTog,'value')==1
orf=MP(1,LBmp).orf{1,1}(indx);
orfLength=length(char(orf));
@@ -44,6 +43,7 @@ if isempty(a)
name='Not Found';
desc=[]; proc=[]; func=[]; loc=[];
end
%{
if get(handles.listboxGnOrf,'value')&& ~isempty(a)
desc=char(text(a,32,:));

View File

@@ -60,13 +60,9 @@ function ButtonName=questdlg(Question,Title,Btn1,Btn2,Btn3,Default)
%
% See also DIALOG, ERRORDLG, HELPDLG, INPUTDLG, LISTDLG,
% MSGBOX, WARNDLG, FIGURE, TEXTWRAP, UIWAIT, UIRESUME.
% Copyright 1984-2010 The MathWorks, Inc.
% $Revision: 5.55.4.17 $
if nargin<1
error('MATLAB:questdlg:TooFewArguments', 'Too few arguments for QUESTDLG');
end
@@ -74,21 +70,18 @@ end
Interpreter='none';
Question=dialogCellstrHelper(Question);
%%%%%%%%%%%%%%%%%%%%%
%%% General Info. %%%
%%%%%%%%%%%%%%%%%%%%%
% General Information
Black =[0 0 0 ]/255;
% LightGray =[192 192 192 ]/255;
% LightGray2 =[160 160 164 ]/255;
% MediumGray =[128 128 128 ]/255;
% White =[255 255 255 ]/255;
%%%%%%%%%%%%%%%%%%%%
%%% Nargin Check %%%
%%%%%%%%%%%%%%%%%%%%
% Nargin Check
if nargout>1
error('MATLAB:questdlg:WrongNumberOutputs', 'Wrong number of output arguments for QUESTDLG');
end
if nargin==1,Title=' ';end
if nargin<=2, Default='Yes';end
if nargin==3, Default=Btn1 ;end
@@ -105,10 +98,7 @@ if isstruct(Default),
Default=Default.Default;
end
%%%%%%%%%%%%%%%%%%%%%%%
%%% Create QuestFig %%%
%%%%%%%%%%%%%%%%%%%%%%%
% Create QuestFig
FigPos=get(0,'DefaultFigurePosition');
FigPos(3)=267;
FigPos(4)=70;
@@ -127,29 +117,22 @@ QuestFig=dialog( ...
'Tag' ,Title ...
);
%%%%%%%%%%%%%%%%%%%%%
%%% Set Positions %%%
%%%%%%%%%%%%%%%%%%%%%
% Set Positions
DefOffset =10;
IconWidth =54;
IconHeight =54;
IconXOffset=DefOffset;
IconYOffset=FigPos(4)-DefOffset-IconHeight; %#ok
IconCMap=[Black;get(QuestFig,'Color')]; %#ok
DefBtnWidth =56;
BtnHeight =22;
BtnYOffset=DefOffset;
BtnWidth=DefBtnWidth;
ExtControl=uicontrol(QuestFig , ...
ExtControl=uicontrol(...
QuestFig , ...
'Style' ,'pushbutton', ...
'String' ,' ' ...
);
btnMargin=1.4;
set(ExtControl,'String',Btn1);
BtnExtent=get(ExtControl,'Extent');
@@ -165,38 +148,28 @@ if NumButtons > 1
end
end
BtnHeight=max(BtnHeight,BtnExtent(4)*btnMargin);
delete(ExtControl);
MsgTxtXOffset=IconXOffset+IconWidth;
FigPos(3)=max(FigPos(3),MsgTxtXOffset+NumButtons*(BtnWidth+2*DefOffset));
set(QuestFig,'Position',FigPos);
BtnXOffset=zeros(NumButtons,1);
if NumButtons==1,
BtnXOffset=(FigPos(3)-BtnWidth)/2;
elseif NumButtons==2,
BtnXOffset=[MsgTxtXOffset
FigPos(3)-DefOffset-BtnWidth];
BtnXOffset=[MsgTxtXOffset FigPos(3)-DefOffset-BtnWidth];
elseif NumButtons==3,
BtnXOffset=[MsgTxtXOffset
0
FigPos(3)-DefOffset-BtnWidth];
BtnXOffset=[MsgTxtXOffset 0 FigPos(3)-DefOffset-BtnWidth];
BtnXOffset(2)=(BtnXOffset(1)+BtnXOffset(3))/2;
end
MsgTxtYOffset=DefOffset+BtnYOffset+BtnHeight;
% Calculate current msg text width and height. If negative,
% clamp it to 1 since its going to be recalculated/corrected later
% based on the actual msg string
MsgTxtWidth=max(1, FigPos(3)-DefOffset-MsgTxtXOffset-IconWidth);
MsgTxtHeight=max(1, FigPos(4)-DefOffset-MsgTxtYOffset);
MsgTxtForeClr=Black;
MsgTxtBackClr=get(QuestFig,'Color');
CBString='uiresume(gcbf)';
DefaultValid=false;
DefaultWasPressed=false;
@@ -214,7 +187,6 @@ for i=1:NumButtons
DefaultValid=true;
DefaultButton=1;
end
case 2
ButtonString=Btn2;
ButtonTag='Btn2';
@@ -260,11 +232,8 @@ MsgHandle=uicontrol(QuestFig , ...
);
[WrapString,NewMsgTxtPos]=textwrap(MsgHandle,Question,75);
% NumLines=size(WrapString,1);
AxesHandle=axes('Parent',QuestFig,'Position',[0 0 1 1],'Visible','off');
texthandle=text( ...
'Parent' ,AxesHandle , ...
'Units' ,'pixels' , ...
@@ -279,42 +248,32 @@ texthandle=text( ...
);
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.
MsgTxtWidth=max([MsgTxtWidth NewMsgTxtPos(3)+2 textExtent(3)]);
MsgTxtHeight=max([MsgTxtHeight NewMsgTxtPos(4)+2 textExtent(4)]);
MsgTxtXOffset=IconXOffset+IconWidth+DefOffset;
FigPos(3)=max(NumButtons*(BtnWidth+DefOffset)+DefOffset, ...
MsgTxtXOffset+MsgTxtWidth+DefOffset);
% Center Vertically around icon
if IconHeight>MsgTxtHeight,
IconYOffset=BtnYOffset+BtnHeight+DefOffset;
MsgTxtYOffset=IconYOffset+(IconHeight-MsgTxtHeight)/2;
FigPos(4)=IconYOffset+IconHeight+DefOffset;
% center around text
% Center around text
else
MsgTxtYOffset=BtnYOffset+BtnHeight+DefOffset;
IconYOffset=MsgTxtYOffset+(MsgTxtHeight-IconHeight)/2;
FigPos(4)=MsgTxtYOffset+MsgTxtHeight+DefOffset;
end
if NumButtons==1,
if NumButtons==1
BtnXOffset=(FigPos(3)-BtnWidth)/2;
elseif NumButtons==2,
BtnXOffset=[(FigPos(3)-DefOffset)/2-BtnWidth
(FigPos(3)+DefOffset)/2
];
elseif NumButtons==3,
elseif NumButtons==2
BtnXOffset=[(FigPos(3)-DefOffset)/2-BtnWidth (FigPos(3)+DefOffset)/2];
elseif NumButtons==3
BtnXOffset(2)=(FigPos(3)-BtnWidth)/2;
BtnXOffset=[BtnXOffset(2)-DefOffset-BtnWidth
BtnXOffset(2)
BtnXOffset(2)+BtnWidth+DefOffset
];
BtnXOffset=[BtnXOffset(2)-DefOffset-BtnWidth BtnXOffset(2) BtnXOffset(2)+BtnWidth+DefOffset];
end
set(QuestFig ,'Position',getnicedialoglocation(FigPos, get(QuestFig,'Units')));
@@ -323,7 +282,6 @@ BtnPos=cellfun(@(bh)get(bh,'Position'), BtnHandle, 'UniformOutput', false);
BtnPos=cat(1,BtnPos{:});
BtnPos(:,1)=BtnXOffset;
BtnPos=num2cell(BtnPos,2);
assert(iscell(BtnPos));
cellfun(@(bh,pos)set(bh, 'Position', pos), BtnHandle, BtnPos, 'UniformOutput', false);
@@ -332,11 +290,8 @@ if DefaultValid
end
delete(MsgHandle);
set(texthandle, 'Position',[MsgTxtXOffset MsgTxtYOffset 0]);
IconAxes=axes(...
'Parent' ,QuestFig , ...
'Units' ,'Pixels' , ...
@@ -346,12 +301,10 @@ IconAxes=axes( ...
);
set(QuestFig ,'NextPlot','add');
load dialogicons.mat questIconData questIconMap;
IconData=questIconData;
questIconMap(256,:)=get(QuestFig,'Color');
IconCMap=questIconMap;
Img=image('CData',IconData,'Parent',IconAxes);
set(QuestFig, 'Colormap', IconCMap);
set(IconAxes, ...
@@ -361,10 +314,8 @@ set(IconAxes, ...
'YLim' ,get(Img,'YData') ...
);
% make sure we are on screen
% Make sure we are on screen
movegui(QuestFig)
set(QuestFig ,'WindowStyle','modal','Visible','on');
drawnow;