Organize old files

This commit is contained in:
2024-07-29 18:12:57 -04:00
parent d2a5d9e69f
commit 39672a6ca0
98 changed files with 57004 additions and 19259 deletions

Binary file not shown.

View File

@@ -0,0 +1,245 @@
%ImageDisplay
global Exp
global ghandles
global zonePB
prntHt=0;
%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)
try
char((Exp(expN).Dexp(1).MP(mx).genename{1}(384)))
MPnum=mx;
catch
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'),
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)
tPtsSize=size(Exp(expN).Dexp(DexpN).FexpScanBMtp{1,1},(3));
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)
tPtsSize=size(Exp(expN).Dexp(DexpN).FexpScanBMtp{1,1},(3));
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)
tPtsSize=size(Exp(expN).Dexp(DexpN).FexpScanBMtp{1,1},(3));
set(handles.Tptsldr3,'min',1,'max',tPtsSize)
end
end
ghandles=handles;
scan=Exp(expN).Dexp(DexpN).scan;
destPerMP= length(Exp(expN).Dexp(DexpN).DM.drug);
if expN==1,MPsel=floor(get(handles.MPsldr1,'value')); end
if expN==2,MPsel=floor(get(handles.MPsldr2,'value')); end
if expN==3,MPsel=floor(get(handles.MPsldr3,'value')); end
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(:))
n=1;
for ii= 1:tPtsSize
if exist(fullfile(Exp(expN).Dexp(DexpN).ExpFoldr,num2str(plateNum),strcat((num2str(ii)),'.bmp'))) ==2; %the .bmp file exists
bmpLst(n)= ii
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
if expN==1,
set(handles.Tptsldr1,'max',tPtsSize);
set(ghandles.Tptsldr1,'max',tPtsSize);
set(handles.Tpted1,'string', num2str(tPtSel));
set(ghandles.Tpted1,'string', num2str(tPtSel));
if tPtsSize<= tPtSel,
set(handles.Tptsldr1,'value', tPtsSize)
set(ghandles.Tptsldr1,'value', tPtsSize)
tPtSel= tPtsSize
set(handles.Tpted1,'string', num2str(tPtsSize))
set(ghandles.Tpted1,'string', num2str(tPtsSize))
end
end
if expN==2
set(handles.Tptsldr2,'max',tPtsSize);
set(ghandles.Tptsldr2,'max',tPtsSize);
set(handles.Tpted2,'string', num2str(tPtSel));
set(ghandles.Tpted2,'string', num2str(tPtSel));
if tPtsSize<= tPtSel,
set(handles.Tptsldr2,'value', tPtsSize)
set(ghandles.Tptsldr2,'value', tPtsSize)
tPtSel= tPtsSize
set(handles.Tpted2,'string', num2str(tPtsSize))
set(ghandles.Tpted2,'string', num2str(tPtsSize))
end
end
if expN==3
set(handles.Tptsldr3,'max',tPtsSize);
set(ghandles.Tptsldr3,'max',tPtsSize);
set(handles.Tpted3,'string', num2str(tPtSel));
set(ghandles.Tpted3,'string', num2str(tPtSel));
if tPtsSize<= tPtSel,
set(handles.Tptsldr3,'value', tPtsSize)
set(ghandles.Tptsldr3,'value', tPtsSize)
tPtSel= tPtsSize
set(handles.Tpted3,'string', num2str(tPtsSize))
set(ghandles.Tpted3,'string', num2str(tPtsSize))
end
end
%---------------------------------------------------------
Exp(expN).Dexp(DexpN).MPsel=MPsel;
Exp(expN).Dexp(DexpN).destPerMP=destPerMP;
Exp(expN).Dexp(DexpN).pertSel=pertSel;
Exp(expN).Dexp(DexpN).tPtSel=tPtSel;
Exp(expN).Dexp(DexpN).plateNum=plateNum;
%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
if expN==3, expAxes=ghandles.Iaxes3;end
axes(expAxes)
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}))
if expN==1,set(handles.DM1,'string',DMstr); end
if expN==2,set(handles.DM2,'string',DMstr); end
if expN==3,set(handles.DM3,'string',DMstr); end
tPtStr=strcat('T=', num2str(scan(1,plateNum).plate(1).t0Series(tPtSel)));
if expN==1,set(handles.tptTm1,'string',tPtStr); 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);
if expN==1,set(handles.expName1,'string',expStrg); end
if expN==2,set(handles.expName2,'string',expStrg); end
if expN==3,set(handles.expName3,'string',expStrg); end
%********************
try
htMapTogPBfg=0;
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 (in
%********************
if expN==1
zonesel=1;
zonePB= 1;
set(handles. zonePB1,'value',1)
set(handles. zonePB2,'value',0)
set(handles. zonePB3,'value',0)
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)
else
set(handles.listboxGnOrf,'string',Exp(1).Dexp(DexpN).srtGnLst)
end
end
if expN==2
zonesel=2;
zonePB= 2;
set(handles. zonePB2,'value',1)
set(handles. zonePB1,'value',0)
set(handles. zonePB3,'value',0)
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)
else
set(handles.listboxGnOrf,'string',Exp(2).Dexp(DexpN).srtGnLst)
end
end
if expN==3
zonesel=3;
zonePB= 3;
set(handles. zonePB3,'value',1)
set(handles. zonePB2,'value',0)
set(handles. zonePB1,'value',0)
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)
else
set(handles.listboxGnOrf,'string',Exp(3).Dexp(DexpN).srtGnLst)
end
end

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,238 @@
%EZlstBoxExtCmp.m
%Called by EZviewGui.m (NOT by EZvDatatip.m and EZlstBoxExt.m
%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
end
Exp(expN).cLmdEven= 0; %Added for Cummulative Median and Mean 'C' plot
RFDMflg=0;
if zoneSel==1,DexpN= (get(ghandles.DN1,'value')); end
if zoneSel==2,DexpN= (get(ghandles.DN2,'value')); end
if zoneSel==3,DexpN= (get(ghandles.DN3,'value')); end
try
p1=cell2mat(strfind(selGnOrf,'('));
p2= cell2mat(strfind(selGnOrf,')'));
dmNum= str2num(selGnOrf{1}(p1+1:p2-1));
inDM= str2num(selGnOrf{1}(p1+1:p2-1));
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 ******************************************
%try
if RFcmpGFlg==0
K= Exp(expN).Dexp(DexpN).RFcmpK(RFnum).dm(inDM).med; Ks= num2str(K);
r= Exp(expN).Dexp(DexpN).RFcmpr(RFnum).dm(inDM).med; rs= num2str(r);
l= Exp(expN).Dexp(DexpN).RFcmpL(RFnum).dm(inDM).med; Ls= num2str(l);
Kl= K - Exp(expN).Dexp(DexpN).RFcmpK(RFnum).dm(inDM).std;
Ku= K + Exp(expN).Dexp(DexpN).RFcmpK(RFnum).dm(inDM).std;
rl= r - Exp(expN).Dexp(DexpN).RFcmpr(RFnum).dm(inDM).std;
ru= r + Exp(expN).Dexp(DexpN).RFcmpr(RFnum).dm(inDM).std;
lfast= l - Exp(expN).Dexp(DexpN).RFcmpL(RFnum).dm(inDM).std;
lslow= l + Exp(expN).Dexp(DexpN).RFcmpL(RFnum).dm(inDM).std;
elseif RFcmpGFlg==1
K= Exp(expN).Dexp(DexpN).RFcmpGK.dm(inDM).med; Ks= num2str(K);
r= Exp(expN).Dexp(DexpN).RFcmpGr.dm(inDM).med; rs= num2str(r);
l= Exp(expN).Dexp(DexpN).RFcmpGL.dm(inDM).med; Ls= num2str(l);
Kl= K - Exp(expN).Dexp(DexpN).RFcmpGK.dm(inDM).std;
Ku= K + Exp(expN).Dexp(DexpN).RFcmpGK.dm(inDM).std;
rl= r - Exp(expN).Dexp(DexpN).RFcmpGr.dm(inDM).std;
ru= r + Exp(expN).Dexp(DexpN).RFcmpGr.dm(inDM).std;
lfast= l - Exp(expN).Dexp(DexpN).RFcmpGL.dm(inDM).std;
lslow= l + Exp(expN).Dexp(DexpN).RFcmpGL.dm(inDM).std;
end
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;
%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;
traceN=Exp(1).traceN;
end
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;
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;
Exp(expN).Trace(traceN).Dexp(nn).DM(inDM).UsrKvals= Exp(expN).Dexp(nn).RFcmpGK.dm(inDM).Kvals;
Exp(expN).Trace(traceN).Dexp(nn).DM(inDM).Usrrvals= Exp(expN).Dexp(nn).RFcmpGr.dm(inDM).rvals;
end
else
for dm=1:length(Exp(expN).Dexp(DexpN).DM.drug)
Exp(expN).Trace(traceN).Dexp(DexpN).DM(dm).UsrLvals= Exp(expN).Dexp(DexpN).RFcmpGL.dm(dm).Lvals;
Exp(expN).Trace(traceN).Dexp(DexpN).DM(dm).UsrKvals= Exp(expN).Dexp(DexpN).RFcmpGK.dm(dm).Kvals;
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
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
%catch
% catchissue='Ln68 EZlstBoxCmpExt'
%end %trycatch
%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
if isequal(selGnOrf{1}(1:3),'RF1')|| isequal(selGnOrf{1}(1:3),'RF2')|| RFcmpGFlg==1
gene= {selGnOrf{1}(1:p2)};
geneOrfstr= gene;
grfgenestr= gene;
else
gene=MP(1,LBmp).genename{1,1}(indx); orf=MP(1,LBmp).orf{1,1}(indx);
geneOrfstr= strcat(gene,'_',orf,'_','m',num2str(LBmp),'r',num2str(LBr),'c',num2str(LBc),'_',tPtStr);
grfgenestr= strcat(gene,'_',orf,'_','m',num2str(LBmp),'r',num2str(LBr),'c',num2str(LBc));
end
%spec=MP(1,LBmp).specifics{1,1}(indx); %orfrep=MP(1,plateNum).orfRep{1,1}(indx);
%tPtStr=strcat('T=', num2str(scan(1,plateNum).plate(1).t0Series(tPtSel)));
graphStr=strcat(grfgenestr,'_','L=',Lstr,'_','r=',rstr,'_','K=',Kstr);
spotDescrip=strcat(graphStr,'->',DMstr);
xp=char(Exp(zoneSel).Dexp(DexpN).resDir);
if ispc,
slashPos=strfind(char(Exp(zoneSel).Dexp(DexpN).resDir),'\');
else
slashPos=strfind(char(Exp(zoneSel).Dexp(DexpN).resDir),'/');
end
startPos=slashPos(length(slashPos)-1) +1;
endPos=slashPos(length(slashPos)) -1;
expStr= {xp(startPos:endPos)}
Exp(zoneSel).hOLname(traceN)= spotDescrip; %graphStr; %ghandles.Exp(zoneSel).hOLname(traceN)= graphStr;
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****************************************************************************
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
set(ghandles.OLexp1,'string',Exp(zoneSel).hOLexpNm(traceN));
end
if zoneSel==2 %&& get(ghandles.rotPB2,'value') ~=1
if length(char(Exp(zoneSel).hOLname(traceN)))>40,set(ghandles.OLay2,'FontSize',8);end
set(ghandles.OLay2,'string', Exp(zoneSel).hOLname(traceN));
if length(char(Exp(zoneSel).hOLexpNm(traceN)))>40,set(ghandles.OLexp2,'FontSize',8);end
set(ghandles.OLexp2,'string',Exp(zoneSel).hOLexpNm(traceN));
end
if zoneSel==3 %&& get(ghandles.rotPB3,'value') ~=1
if length(char(Exp(zoneSel).hOLname(traceN)))>40,set(ghandles.OLay3,'FontSize',8);end
set(ghandles.OLay3,'string', Exp(OLay).hOLname(traceN));
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
%***********************************************************************************************************************

View File

@@ -0,0 +1,307 @@
%EZlstBoxExt.m
%Calls either EZdestComp.m
%or if 'Chrono' EZmDayPlotUCmp.m and EZmDayTrend.m and if ghandles.CompositeTog_,EZmDayPlotUcomposite
%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
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
if zoneSel==2,DexpN= (get(handles.DN2,'value')); end
if zoneSel==3,DexpN= (get(handles.DN3,'value')); end
try
p1=cell2mat(strfind(selGnOrf,'('));
p2= cell2mat(strfind(selGnOrf,')'));
dmNum= str2num(selGnOrf{1}(p1+1:p2-1));
inDM= selGnOrf{1}(p1+1:p2-1);
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 %*
%***************
else % Runs to end of EZlstBoxExt.m within this else condition
if zoneSel==1
Max=floor(get(handles.MPsldr1,'max'));
Min=floor(get(handles.MPsldr1,'min'));
if str2num(inMP) >= Min && str2num(inMP) <= Max
set(handles.MPed1,'string',inMP)
set(handles.MPsldr1,'value',str2double(inMP));
else
if str2num(inMP) >= Max, set(handles.MPsldr1,'value',Max); set(handles.MPed1,'string',num2str(Max));end
if str2num(inMP) <= Min, set(handles.MPsldr1,'value',Min),set(handles.MPed1,'string',num2str(Min));end
end
end
if zoneSel==2
Max=floor(get(handles.MPsldr2,'max'));
Min=floor(get(handles.MPsldr2,'min'));
if str2num(inMP) >= Min && str2num(inMP) <= Max
set(handles.MPed2,'string',inMP)
set(handles.MPsldr2,'value',str2double(inMP));
else
if str2num(inMP) >= Max, set(handles.MPsldr2,'value',Max); set(handles.MPed2,'string',num2str(Max));end
if str2num(inMP) <= Min, set(handles.MPsldr2,'value',Min),set(handles.MPed2,'string',num2str(Min));end
end
end
if zoneSel==3
Max=floor(get(handles.MPsldr3,'max'));
Min=floor(get(handles.MPsldr3,'min'));
if str2num(inMP) >= Min && str2num(inMP) <= Max
set(handles.MPed3,'string',inMP)
set(handles.MPsldr3,'value',str2double(inMP));
else
if str2num(inMP) >= Max, set(handles.MPsldr3,'value',Max); set(handles.MPed3,'string',num2str(Max));end
if str2num(inMP) <= Min, set(handles.MPsldr3,'value',Min),set(handles.MPed3,'string',num2str(Min));end
end
end
if RFDMflg,
if zoneSel==1
Max=floor(get(handles.DMsldr1,'max'));
Min=floor(get(handles.DMsldr1,'min'));
if str2num(inDM) >= Min && str2num(inDM) <= Max
set(handles.DMed1,'string',inDM)
set(handles.DMsldr1,'value',str2double(inDM));
else
if str2num(inDM) >= Max, set(handles.DMsldr1,'value',Max); set(handles.DMed1,'string',num2str(Max));end
if str2num(inDM) <= Min, set(handles.DMsldr1,'value',Min),set(handles.DMed1,'string',num2str(Min));end
end
end
if zoneSel==2
Max=floor(get(handles.DMsldr2,'max'));
Min=floor(get(handles.DMsldr2,'min'));
if str2num(inDM) >= Min && str2num(inDM) <= Max
set(handles.DMed2,'string',inDM)
set(handles.DMsldr2,'value',str2double(inDM));
else
if str2num(inDM) >= Max, set(handles.DMsldr2,'value',Max); set(handles.DMed2,'string',num2str(Max));end
if str2num(inDM) <= Min, set(handles.DMsldr2,'value',Min),set(handles.DMed2,'string',num2str(Min));end
end
end
if zoneSel==3
Max=floor(get(handles.DMsldr3,'max'));
Min=floor(get(handles.DMsldr3,'min'));
if str2num(inDM) >= Min && str2num(inDM) <= Max
set(handles.DMed3,'string',inDM)
set(handles.DMsldr3,'value',str2double(inDM));
else
if str2num(inDM) >= Max, set(handles.DMsldr3,'value',Max); set(handles.DMed3,'string',num2str(Max));end
if str2num(inDM) <= Min, set(handles.DMsldr3,'value',Min),set(handles.DMed3,'string',num2str(Min));end
end
end
end
%**************************************************************************
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 %*
%***********************
else
%***********************
EZplotUcmp %*
%***********************
end
%*******************************************************************
%***********PLOT Selected Gene/Orf Spot ******************************************
% if non-Composite ("normal") then - ...
elseif CompositeTrendFlg~=1
destPerMP= Exp(zoneSel).Dexp(DexpN).destPerMP; %length(gS.DM1.drug);
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
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);
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;
traceN=Exp(1).traceN;
end
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;
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;
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
%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
if isequal(selGnOrf{1}(1:3),'RF1')
gene= {selGnOrf{1}(1:p2)};
geneOrfstr= strcat(gene,'_','m',num2str(LBmp),'r',num2str(LBr),'c',num2str(LBc),'_',tPtStr);
grfgenestr= strcat(gene,'_','m',num2str(LBmp),'r',num2str(LBr),'c',num2str(LBc));
else
gene=MP(1,LBmp).genename{1,1}(indx); orf=MP(1,LBmp).orf{1,1}(indx);
geneOrfstr= strcat(gene,'_',orf,'_','m',num2str(LBmp),'r',num2str(LBr),'c',num2str(LBc),'_',tPtStr);
grfgenestr= strcat(gene,'_',orf,'_','m',num2str(LBmp),'r',num2str(LBr),'c',num2str(LBc));
end
spec=MP(1,LBmp).specifics{1,1}(indx); %orfrep=MP(1,plateNum).orfRep{1,1}(indx);
tPtStr=strcat('T=', num2str(scan(1,plateNum).plate(1).t0Series(tPtSel)));
graphStr=strcat(grfgenestr,'_','L=',Lstr,'_','r=',rstr,'_','K=',Kstr);
spotDescrip=strcat(graphStr,'->',DMstr);
xp=char(Exp(zoneSel).Dexp(DexpN).resDir);
if ispc,
slashPos=strfind(char(Exp(zoneSel).Dexp(DexpN).resDir),'\');
else
slashPos=strfind(char(Exp(zoneSel).Dexp(DexpN).resDir),'/');
end
startPos=slashPos(length(slashPos)-1) +1;
endPos=slashPos(length(slashPos)) -1
expStr= {xp(startPos:endPos)}
Exp(zoneSel).hOLname(traceN)= spotDescrip; %graphStr; %ghandles.Exp(zoneSel).hOLname(traceN)= graphStr;
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='Ln141 EZlstBoxExt'
msg='Error'
end % trycatch zoneSel<4 datatip selection from Image (not from an OverLay Plot)
end %if get(ghandles.CompositeTog1,'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
set(ghandles.OLexp1,'string',Exp(zoneSel).hOLexpNm(traceN));
end
if zoneSel==2 %&& get(ghandles.rotPB2,'value') ~=1
if length(char(Exp(zoneSel).hOLname(traceN)))>40,set(ghandles.OLay2,'FontSize',8);end
set(ghandles.OLay2,'string', Exp(zoneSel).hOLname(traceN));
if length(char(Exp(zoneSel).hOLexpNm(traceN)))>40,set(ghandles.OLexp2,'FontSize',8);end
set(ghandles.OLexp2,'string',Exp(zoneSel).hOLexpNm(traceN));
end
if zoneSel==3 %&& get(ghandles.rotPB3,'value') ~=1
if length(char(Exp(zoneSel).hOLname(traceN)))>40,set(ghandles.OLay3,'FontSize',8);end
set(ghandles.OLay3,'string', Exp(OLay).hOLname(traceN));
if length(char(Exp(zoneSel).hOLexpNm(traceN)))>40,set(ghandles.OLexp3,'FontSize',8);end
set(ghandles.OLexp3,'string',Exp(OLay).hOLexpNm(traceN));
end
%*****************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};
if zoneSel==1, expAxes=ghandles.Iaxes1;end
if zoneSel==2, expAxes=ghandles.Iaxes2;end
if zoneSel==3, expAxes=ghandles.Iaxes3;end
%axes(ghandles.Iaxes1)
plot(expAxes,(spotCoor(2)+24),(spotCoor(1)+24),'.y')
%***********************GraphicDestinationPerturbationComparison**15_0821************************************************
EZdatatip=0; %**
if strcmp((Exp(expN).DexpType),'single')||...
strcmp((Exp(expN).DexpType),'multi')
%****************
EZdestComp %**
%****************
elseif strcmp((Exp(expN).DexpType),'chrono')
%************
EZmDayTrend %**
%************
end
%***********************************************************************************************************************
%*********************HeatMap Text Field*********************************
try
ll=num2str(l);
if length(ll)>5,htl= ll(1:5);else htl=ll;end
catch
htl=' ';
end
try
n1= num2str(Exp(expN).Dexp(DexpN).HtMpIntN1(indx));
if length(n1)>5,N1= n1(1:5);else N1=n1; end
htN1=strcat('_N1=',N1);
catch,
htN1=' ';
end
try
htmapStr=strcat('L= ',htl, htN1)
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
catch
end
end %if sgdInfoOnly==1

View File

@@ -0,0 +1,257 @@
%EZlstBoxExt
%global Exp
%expN=1;
RFDMflg=0;
try
p1=cell2mat(strfind(selGnOrf,'('));
p2= cell2mat(strfind(selGnOrf,')'));
dmNum= str2num(selGnOrf{1}(p1+1:p2-1));
inDM= selGnOrf{1}(p1+1:p2-1);
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
else % Runs to end of EZlstBoxExt.m within this else condition
if zoneSel==1
Max=floor(get(handles.MPsldr1,'max'));
Min=floor(get(handles.MPsldr1,'min'));
if str2num(inMP) >= Min && str2num(inMP) <= Max
set(handles.MPed1,'string',inMP)
set(handles.MPsldr1,'value',str2double(inMP));
else
if str2num(inMP) >= Max, set(handles.MPsldr1,'value',Max); set(handles.MPed1,'string',num2str(Max));end
if str2num(inMP) <= Min, set(handles.MPsldr1,'value',Min),set(handles.MPed1,'string',num2str(Min));end
end
end
if zoneSel==2
Max=floor(get(handles.MPsldr2,'max'));
Min=floor(get(handles.MPsldr2,'min'));
if str2num(inMP) >= Min && str2num(inMP) <= Max
set(handles.MPed2,'string',inMP)
set(handles.MPsldr2,'value',str2double(inMP));
else
if str2num(inMP) >= Max, set(handles.MPsldr2,'value',Max); set(handles.MPed2,'string',num2str(Max));end
if str2num(inMP) <= Min, set(handles.MPsldr2,'value',Min),set(handles.MPed2,'string',num2str(Min));end
end
end
if zoneSel==3
Max=floor(get(handles.MPsldr3,'max'));
Min=floor(get(handles.MPsldr3,'min'));
if str2num(inMP) >= Min && str2num(inMP) <= Max
set(handles.MPed3,'string',inMP)
set(handles.MPsldr3,'value',str2double(inMP));
else
if str2num(inMP) >= Max, set(handles.MPsldr3,'value',Max); set(handles.MPed3,'string',num2str(Max));end
if str2num(inMP) <= Min, set(handles.MPsldr3,'value',Min),set(handles.MPed3,'string',num2str(Min));end
end
end
if RFDMflg,
if zoneSel==1
Max=floor(get(handles.DMsldr1,'max'));
Min=floor(get(handles.DMsldr1,'min'));
if str2num(inDM) >= Min && str2num(inDM) <= Max
set(handles.DMed1,'string',inDM)
set(handles.DMsldr1,'value',str2double(inDM));
else
if str2num(inDM) >= Max, set(handles.DMsldr1,'value',Max); set(handles.DMed1,'string',num2str(Max));end
if str2num(inDM) <= Min, set(handles.DMsldr1,'value',Min),set(handles.DMed1,'string',num2str(Min));end
end
end
if zoneSel==2
Max=floor(get(handles.DMsldr2,'max'));
Min=floor(get(handles.DMsldr2,'min'));
if str2num(inDM) >= Min && str2num(inDM) <= Max
set(handles.DMed2,'string',inDM)
set(handles.DMsldr2,'value',str2double(inDM));
else
if str2num(inDM) >= Max, set(handles.DMsldr2,'value',Max); set(handles.DMed2,'string',num2str(Max));end
if str2num(inDM) <= Min, set(handles.DMsldr2,'value',Min),set(handles.DMed2,'string',num2str(Min));end
end
end
if zoneSel==3
Max=floor(get(handles.DMsldr3,'max'));
Min=floor(get(handles.DMsldr3,'min'));
if str2num(inDM) >= Min && str2num(inDM) <= Max
set(handles.DMed3,'string',inDM)
set(handles.DMsldr3,'value',str2double(inDM));
else
if str2num(inDM) >= Max, set(handles.DMsldr3,'value',Max); set(handles.DMed3,'string',num2str(Max));end
if str2num(inDM) <= Min, set(handles.DMsldr3,'value',Min),set(handles.DMed3,'string',num2str(Min));end
end
end
end
%*********************************************************************************
EZVimDisplay
%***********PLOT Selected Gene/Orf Spot ******************************************
try
destPerMP= Exp(zoneSel).Dexp(DexpN).destPerMP; %length(gS.DM1.drug);
%MPsel=LBmb; %floor(get(handles.MPsldr1,'value'));
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;
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);
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;
traceN=Exp(1).traceN;
end
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;
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');
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
%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
if isequal(selGnOrf{1}(1:3),'RF1')
gene= {selGnOrf{1}(1:p2)};
geneOrfstr= strcat(gene,'_','m',num2str(LBmp),'r',num2str(LBr),'c',num2str(LBc),'_',tPtStr);
grfgenestr= strcat(gene,'_','m',num2str(LBmp),'r',num2str(LBr),'c',num2str(LBc));
else
gene=MP(1,LBmp).genename{1,1}(indx); orf=MP(1,LBmp).orf{1,1}(indx);
geneOrfstr= strcat(gene,'_',orf,'_','m',num2str(LBmp),'r',num2str(LBr),'c',num2str(LBc),'_',tPtStr);
grfgenestr= strcat(gene,'_',orf,'_','m',num2str(LBmp),'r',num2str(LBr),'c',num2str(LBc));
end
spec=MP(1,LBmp).specifics{1,1}(indx); %orfrep=MP(1,plateNum).orfRep{1,1}(indx);
tPtStr=strcat('T=', num2str(scan(1,plateNum).plate(1).t0Series(tPtSel)));
graphStr=strcat(grfgenestr,'_','L=',Lstr,'_','r=',rstr,'_','K=',Kstr);
spotDescrip=strcat(graphStr,'->',DMstr);
xp=char(Exp(zoneSel).Dexp(DexpN).resDir);
if ispc,
slashPos=strfind(char(Exp(zoneSel).Dexp(DexpN).resDir),'\');
else
slashPos=strfind(char(Exp(zoneSel).Dexp(DexpN).resDir),'/');
end
startPos=slashPos(length(slashPos)-1) +1;
endPos=slashPos(length(slashPos)) -1
expStr= {xp(startPos:endPos)}
Exp(zoneSel).hOLname(traceN)= spotDescrip; %graphStr; %ghandles.Exp(zoneSel).hOLname(traceN)= graphStr;
Exp(zoneSel).hOLexpNm(traceN)= expStr; %ghandles.Exp(expN).hOLexpNm(traceN)= expStr;
Exp(zoneSel).hOLresDir(traceN)= {Exp(zoneSel).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='Ln141 EZlstBoxExt'
msg='Error'
end % trycatch zoneSel<4 datatip selection from Image (not from an OverLay Plot)
%**************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
set(ghandles.OLexp1,'string',Exp(zoneSel).hOLexpNm(traceN));
end
if zoneSel==2 %&& get(ghandles.rotPB2,'value') ~=1
if length(char(Exp(zoneSel).hOLname(traceN)))>40,set(ghandles.OLay2,'FontSize',8);end
set(ghandles.OLay2,'string', Exp(zoneSel).hOLname(traceN));
if length(char(Exp(zoneSel).hOLexpNm(traceN)))>40,set(ghandles.OLexp2,'FontSize',8);end
set(ghandles.OLexp2,'string',Exp(zoneSel).hOLexpNm(traceN));
end
if zoneSel==3 %&& get(ghandles.rotPB3,'value') ~=1
if length(char(Exp(zoneSel).hOLname(traceN)))>40,set(ghandles.OLay3,'FontSize',8);end
set(ghandles.OLay3,'string', Exp(OLay).hOLname(traceN));
if length(char(Exp(zoneSel).hOLexpNm(traceN)))>40,set(ghandles.OLexp3,'FontSize',8);end
set(ghandles.OLexp3,'string',Exp(OLay).hOLexpNm(traceN));
end
%*****************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}
if zoneSel==1, expAxes=ghandles.Iaxes1;end
if zoneSel==2, expAxes=ghandles.Iaxes2;end
if zoneSel==3, expAxes=ghandles.Iaxes3;end
%axes(ghandles.Iaxes1)
plot(expAxes,(spotCoor(2)+24),(spotCoor(1)+24),'.y')
%***********************GraphicDestinationPertibationComparison**15_0821************************************************
EZdatatip=0;
EZdestComp
%***********************************************************************************************************************
%*********************HeatMap Text Field*********************************
try
ll=num2str(l);
if length(ll)>5,htl= ll(1:5);else htl=ll;end
catch
htl=' ';
end
try
n1= num2str(Exp(expN).Dexp(DexpN).HtMpIntN1(indx));
if length(n1)>5,N1= n1(1:5);else N1=n1; end
htN1=strcat('_N1=',N1);
catch,
htN1=' ';
end
try
htmapStr=strcat('L= ',htl, htN1)
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
catch
end
end %if sgdInfoOnly==1

View File

@@ -0,0 +1,665 @@
%EZvDatatip 230802 attempting to fix for R2023a
%Calls to EZdestComp.m EZmDayTrend.m
global ghandles
global Exp
global zonePB
RFcmpGFlg=0; %Test 180105 as it goes to EZmDayTrend.m
lstBoxCmpFlg=0;
curKey=get(gcf,'currentkey')
htMapFg=0;
if ghandles.Iaxes1==get(htargetAxes,'Parent'),expN=1;
elseif ghandles.Iaxes2==get(htargetAxes,'Parent'),expN=2;
elseif ghandles.Iaxes3==get(htargetAxes,'Parent'),expN=3;
elseif ghandles.OLaxes1==get(htargetAxes,'Parent'),OLay=1; expN=1; %zone=1; datacursormode off;
elseif ghandles.OLaxes2==get(htargetAxes,'Parent'),OLay=2; expN=2; %zone=2; datacursormode off;
elseif ghandles.OLaxes3==get(htargetAxes,'Parent'),OLay=3; expN=3; %zone=3; datacursormode off;
elseif ghandles.HtMap1==get(htargetAxes,'Parent'),expN=1; htMapFg=1;
elseif ghandles.HtMap2==get(htargetAxes,'Parent'),expN=2; htMapFg=1;
elseif ghandles.HtMap3==get(htargetAxes,'Parent'),expN=3; htMapFg=1;
else
return
end
if expN==1,DexpN= (get(ghandles.DN1,'value')); end
if expN==2,DexpN= (get(ghandles.DN2,'value')); end
if expN==3,DexpN= (get(ghandles.DN3,'value')); end
% 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
destPerMP= Exp(expN).Dexp(DexpN).destPerMP; %length(gS.DM1.drug);
MPsel=Exp(expN).Dexp(DexpN).MPsel; %floor(get(handles.MPsldr1,'value'));
pertSel=Exp(expN).Dexp(DexpN).pertSel; %floor(get(handles.DMsldr1,'value'));
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
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
plateLoc= ptrPos;
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);
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 expN==1, plotAxes=ghandles.Paxes1; OLaxes=ghandles.OLaxes1;
Exp(1).traceN=Exp(1).traceN+1;
traceN=Exp(1).traceN;
end
if expN==2, plotAxes=ghandles.Paxes2; OLaxes=ghandles.OLaxes2;
Exp(2).traceN=Exp(2).traceN+1;
traceN=Exp(2).traceN;
end
if expN==3, plotAxes=ghandles.Paxes3; OLaxes=ghandles.OLaxes3;
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');
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 )));
if K==0||r==0||l==0, g(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);
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
%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
if expN==3,DMstr=char(get(ghandles.DM3,'string'));end
gene=MP(1,MPsel).genename{1,1}(indx); orf=MP(1,MPsel).orf{1,1}(indx);
spec=MP(1,MPsel).specifics{1,1}(indx); %orfrep=MP(1,plateNum).orfRep{1,1}(indx);
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),'\');
else
slashPos=strfind(char(Exp(expN).Dexp(DexpN).resDir),'/');
end
startPos=slashPos(length(slashPos)-2) +1;
endPos=(slashPos(length(slashPos)) -1);
expStr= {xp(startPos:endPos)};
Exp(expN).hOLname(traceN)= spotDescrip; %ZoneRelated %graphStr; %ghandles.Exp(expN).hOLname(traceN)= graphStr;
Exp(expN).hOLexpNm(traceN)= expStr; %ghandles.Exp(expN).hOLexpNm(traceN)= expStr;
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
set(ghandles.OLay1,'string', Exp(expN).hOLname(traceN));
try if length(char(Exp(expN).hOLexpNm(traceN)))>40,set(ghandles.OLexp1,'FontSize',8);end, catch end
set(ghandles.OLexp1,'string',Exp(expN).hOLexpNm(traceN));
end
if expN==2 %&& get(ghandles.rotPB2,'value') ~=1
try if length(char(Exp(expN).hOLname(traceN)))>40,set(ghandles.OLay2,'FontSize',8);end, catch end
set(ghandles.OLay2,'string', Exp(expN).hOLname(traceN));
try if length(char(Exp(expN).hOLexpNm(traceN)))>40,set(ghandles.OLexp2,'FontSize',8);end, catch end
set(ghandles.OLexp2,'string',Exp(expN).hOLexpNm(traceN));
end
if expN==3 %&& get(ghandles.rotPB3,'value') ~=1
try if length(char(Exp(expN).hOLname(traceN)))>40,set(ghandles.OLay3,'FontSize',8);end, catch end
set(ghandles.OLay3,'string', Exp(expN).hOLname(traceN));
try if length(char(Exp(expN).hOLexpNm(traceN)))>40,set(ghandles.OLexp3,'FontSize',8);end, catch end
set(ghandles.OLexp3,'string',Exp(expN).hOLexpNm(traceN));
end
catch
end
%*******************************************************
%{
if expN==1
zonesel=1;
set(ghandles.zoneRad1,'value',1)
set(ghandles.zoneRad2,'value',0)
set(ghandles.zoneRad3,'value',0)
orfLstSel=get(ghandles.GeneOrfTog,'value');
if orfLstSel==1
set(ghandles.listboxGnOrf,'string',Exp(1).Dexp(DexpN).srtOrfLst)
else
set(ghandles.listboxGnOrf,'string',Exp(1).Dexp(DexpN).srtGnLst)
end
end
if expN==2
zonesel=2;
set(ghandles.zoneRad2,'value',1)
set(ghandles.zoneRad1,'value',0)
set(ghandles.zoneRad3,'value',0)
orfLstSel=get(ghandles.GeneOrfTog,'value');
if orfLstSel==1
set(ghandles.listboxGnOrf,'string',Exp(2).Dexp(DexpN).srtOrfLst)
else
set(ghandles.listboxGnOrf,'string',Exp(2).Dexp(DexpN).srtGnLst)
end
end
if expN==3
zonesel=3;
set(ghandles.zoneRad3,'value',1)
set(ghandles.zoneRad2,'value',0)
set(ghandles.zoneRad1,'value',0)
orfLstSel=get(ghandles.GeneOrfTog,'value');
if orfLstSel==1
set(ghandles.listboxGnOrf,'string',Exp(3).Dexp(DexpN).srtOrfLst)
else
set(ghandles.listboxGnOrf,'string',Exp(3).Dexp(DexpN).srtGnLst)
end
end
%}
%****************************************************************
%Zone PB set here as replacement for zonePB radio buttons 230815
if expN==1
zonesel=1;
set(ghandles. zonePB1,'value',1)
set(ghandles. zonePB2,'value',0)
set(ghandles. zonePB3,'value',0)
set(ghandles.zonePB1,'BackgroundColor',[1.0 0.6 0.6])
set(ghandles.zonePB2,'BackgroundColor',[1.0 1.0 1.0])
set(ghandles.zonePB3,'BackgroundColor',[1.0 1.0 1.0])
orfLstSel=get(ghandles.GeneOrfTog,'value');
if orfLstSel==1
set(ghandles.listboxGnOrf,'string',Exp(1).Dexp(DexpN).srtOrfLst)
else
set(ghandles.listboxGnOrf,'string',Exp(1).Dexp(DexpN).srtGnLst)
end
end
if expN==2
zonesel=2;
set(ghandles. zonePB2,'value',1)
set(ghandles. zonePB1,'value',0)
set(ghandles. zonePB3,'value',0)
set(ghandles.zonePB2,'BackgroundColor',[1.0 0.6 0.6])
set(ghandles.zonePB1,'BackgroundColor',[1.0 1.0 1.0])
set(ghandles.zonePB3,'BackgroundColor',[1.0 1.0 1.0])
orfLstSel=get(ghandles.GeneOrfTog,'value');
if orfLstSel==1
set(ghandles.listboxGnOrf,'string',Exp(2).Dexp(DexpN).srtOrfLst)
else
set(ghandles.listboxGnOrf,'string',Exp(2).Dexp(DexpN).srtGnLst)
end
end
if expN==3
zonesel=3;
set(ghandles. zonePB3,'value',1)
set(ghandles. zonePB2,'value',0)
set(ghandles. zonePB1,'value',0)
set(ghandles.zonePB3,'BackgroundColor',[1.0 0.6 0.6])
set(ghandles.zonePB1,'BackgroundColor',[1.0 1.0 1.0])
set(ghandles.zonePB2,'BackgroundColor',[1.0 1.0 1.0])
orfLstSel=get(ghandles.GeneOrfTog,'value');
if orfLstSel==1
set(ghandles.listboxGnOrf,'string',Exp(3).Dexp(DexpN).srtOrfLst)
else
set(ghandles.listboxGnOrf,'string',Exp(3).Dexp(DexpN).srtGnLst)
end
end
%***********************************************************************
Exp(expN).Trace(traceN).UsrGLB= geneOrfstr;
Exp(expN).Trace(traceN).dmSel= pertSel;
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********************+++++++++++++++++*************
try
OLayTest=OLay<4
msg='OLay'
%make all traces blue
for i=1:length(Exp(OLay).hOL(:))
try set(Exp(OLay).hOL(i),'color',[0 0 1]), catch end
end
%if get(ghandles.rotPB1,'value')~=1,
for i=1:length(Exp(OLay).hOL(:))
htargetAxes
Exp(OLay).hOL(i)
if htargetAxes==Exp(OLay).hOL(i)
if OLay==1 && get(ghandles.rotPB1,'value')~=1,
set(htargetAxes,'color',[1 0 0])
try if length(char(Exp(OLay).hOLname(i)))>40,set(ghandles.OLay1,'FontSize',8);end, catch, end
set(ghandles.OLay1,'string', Exp(OLay).hOLname(i));
traceLab= char(Exp(OLay).hOLname(i));
try if length(char(Exp(OLay).hOLexpNm(i)))>40,set(ghandles.OLexp1,'FontSize',8);end, catch, end
set(ghandles.OLexp1,'string',Exp(OLay).hOLexpNm(i));
OLresDir= Exp(OLay).hOLresDir(i);
Exp(OLay).hOLplateNum(i)= Exp(expN).Dexp(DexpN).plateNum %bug fix for OLay "chrono' RF_cmp( ) trend
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])
try if length(char(Exp(OLay).hOLname(i)))>40,set(ghandles.OLay2,'FontSize',8);end, catch, end
set(ghandles.OLay2,'string', Exp(OLay).hOLname(i));
traceLab= char(Exp(OLay).hOLname(i));
try if length(char(Exp(OLay).hOLexpNm(i)))>40,set(ghandles.OLexp2,'FontSize',8);end, catch, end
set(ghandles.OLexp2,'string',Exp(OLay).hOLexpNm(i));
OLresDir= Exp(OLay).hOLresDir(i);
Exp(OLay).hOLplateNum(i)= Exp(expN).Dexp(DexpN).plateNum %bug fix for OLay "chrono' RF_cmp( ) trend
plateNum= Exp(expN).Dexp(DexpN).plateNum
OLplateNum= Exp(OLay).hOLplateNum(i);
seltraceN=i;
end
if OLay==3 && get(ghandles.rotPB3,'value') ~=1
set(htargetAxes,'color',[1 0 0])
try if length(char(Exp(OLay).hOLname(i)))>40,set(ghandles.OLay3,'FontSize',8);end, catch, end
set(ghandles.OLay3,'string', Exp(OLay).hOLname(i));
traceLab= char(Exp(OLay).hOLname(i));
try if length(char(Exp(OLay).hOLexpNm(i)))>40,set(ghandles.OLexp3,'FontSize',8);end, catch, end
set(ghandles.OLexp3,'string',Exp(OLay).hOLexpNm(i));
OLresDir= Exp(OLay).hOLresDir(i);
Exp(OLay).hOLplateNum(i)= Exp(expN).Dexp(DexpN).plateNum %bug fix for OLay "chrono' RF_cmp( ) trend
plateNum= Exp(expN).Dexp(DexpN).plateNum
OLplateNum= Exp(OLay).hOLplateNum(i);
seltraceN=i;
end
Exp(OLay).seltraceN=seltraceN;
else
msg='Cant Find trace'
end
end % => for i=1:length(Exp(OLay).hOL(:))
%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')
rindx= strfind(rxcy,'r')
LBr= str2num(rxcy((rindx+1):cindx-1))
LBc= str2num(tracename((pos_(2)+cindx): pos_(3)-1))
indx=((LBr-1)*24) +LBc
grfgenestr= tracename(1:pos_(3)-1)
scan= Exp(OLay).Dexp(DexpN).scan;
EZdatatip=2;
try
tracename=char(Exp(OLay).hOLname(seltraceN))
EZdatatip=2;
catch
end
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'****************
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
set(Exp(OLay).hOL(i),'Visible','off')
set(Exp(OLay).hOLb(i),'Visible','off')
for j=1:length(Exp(OLay).hOL(:))
if isequal(get(Exp(OLay).hOL(j),'Visible'),'on'), maxhN= j; end
end
end
if htargetAxes==Exp(OLay).hOL(i), break;end
end
set(Exp(OLay).hOL(maxhN),'color',[1 0 0]) %Set latest trace red
set(Exp(OLay).hOLb(maxhN),'color',[0 1 0])
if OLay==1
try if length(char(Exp(OLay).hOLname(maxhN)))>40,set(ghandles.OLay1,'FontSize',8);end, catch, end
set(ghandles.OLay1,'string', Exp(OLay).hOLname(maxhN));
traceLab= char(Exp(OLay).hOLname(maxhN));
try if length(char(Exp(OLay).hOLexpNm(maxhN)))>40,set(ghandles.OLexp1,'FontSize',8);end, catch, end
set(ghandles.OLexp1,'string',Exp(OLay).hOLexpNm(maxhN));
OLresDir= Exp(OLay).hOLresDir(maxhN);
OLplateNum= Exp(OLay).hOLplateNum(maxhN);
end
end
%------HIDE 22222222222222222-----
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
end
for i=1:length(Exp(OLay).hOL(:))
if htargetAxes==Exp(OLay).hOL(i)
hidAx2traceN=i
set(Exp(OLay).hOL(i),'Visible','off')
set(Exp(OLay).hOLb(i),'Visible','off')
for j=1:length(Exp(OLay).hOL(:))
try if isequal(get(Exp(OLay).hOL(j),'Visible'),'on'), maxhN= j; end, catch end
end
end
if htargetAxes==Exp(OLay).hOL(i), break;end
end
set(Exp(OLay).hOL(maxhN),'color',[1 0 0]) %Set latest trace red
set(Exp(OLay).hOLb(maxhN),'color',[0 1 0])
if OLay==2
try if length(char(Exp(OLay).hOLname(maxhN)))>40,set(ghandles.OLay2,'FontSize',8);end, catch, end
set(ghandles.OLay2,'string', Exp(OLay).hOLname(maxhN));
traceLab= char(Exp(OLay).hOLname(maxhN));
try if length(char(Exp(OLay).hOLexpNm(maxhN)))>40,set(ghandles.OLexp2,'FontSize',8);end, catch, end
set(ghandles.OLexp2,'string',Exp(OLay).hOLexpNm(maxhN));
OLresDir= Exp(OLay).hOLresDir(maxhN);
OLplateNum= Exp(OLay).hOLplateNum(maxhN);
end
end %if rotPB2 ....==1
%------HIDE 33333333333333-----
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
set(Exp(OLay).hOL(i),'Visible','off')
set(Exp(OLay).hOLb(i),'Visible','off')
for j=1:length(Exp(OLay).hOL(:))
try if isequal(get(Exp(OLay).hOL(j),'Visible'),'on'), maxhN= j; end, catch, end
end
end
if htargetAxes==Exp(OLay).hOL(i), break;end
end
set(Exp(OLay).hOL(maxhN),'color',[1 0 0]) %Set latest trace red
set(Exp(OLay).hOLb(maxhN),'color',[0 1 0])
if OLay==3
try if length(char(Exp(OLay).hOLname(maxhN)))>40,set(ghandles.OLay3,'FontSize',8);end, catch, end
set(ghandles.OLay3,'string', Exp(OLay).hOLname(maxhN));
traceLab= char(Exp(OLay).hOLname(maxhN));
try if length(char(Exp(OLay).hOLexpNm(maxhN)))>40,set(ghandles.OLexp3,'FontSize',8);end, catch, end
set(ghandles.OLexp3,'string',Exp(OLay).hOLexpNm(maxhN));
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
expN=OLay
EZdatatip= 2
catch
NoOLay=1;
EZdatatip=1;
end
if get(ghandles.spotTog,'value')==1 && NoOLay
OLresDir= Exp(expN).Dexp(DexpN).resDir;
OLplateNum=plateNum;
imLoc= [picLoc1(2), picLoc1(1)];
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 %**
%*************
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
if exist('OLay') %User clicked on an Overlay
if get(ghandles.spotTog,'value')==1 && get(ghandles.rotPB1,'value') ~=1 && OLay<4
msg='OLay with SpotTog On and Hide off'
pos_=strfind(traceLab,'_')
rcStr=traceLab(pos_(2)+1:pos_(3)-1)
cPos=findstr(rcStr,'c');
rUsr=str2num(rcStr(2:cPos-1));
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) %*
%********************************************************
end
end
catch
end
[output_txt]=datatipp(obj,event_obj);
%*********************HeatMap Text Field*********************************
try
ll=num2str(l);
if length(ll)>5,htl= ll(1:5);else htl=ll;end
catch
htl=' ';
end
try
kk=num2str(K);
if length(kk)>5,htk= kk(1:5);else htk=kk;end
catch
htk=' ';
end
try
rr=num2str(r);
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
htN1=strcat('_N1=',N1);
catch
htN1=' ';
end
try
n2= num2str(Exp(expN).HtMpIntN2(indx)); %num2str(Exp(expN).Dexp(DexpN).HtMpIntN2(indx));
if length(n2)>5,N2= n2(1:5);else N2=n2; end
htN2=strcat('_N2=',N2);
catch
htN2=' ';
end
if Exp(expN).htmapPBsel==1, htmapStr= strcat('K= ',htk); end
if Exp(expN).htmapPBsel==2, htmapStr= strcat('r= ',htr); end
try
if Exp(expN).htmapPBsel==0 || Exp(expN).htmapPBsel>2
htmapStr=strcat('L= ',htl, htN1,htN2)
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
end
catch
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
end
catch
end
%datacursormode(gcf)
%**********************************************Test Area
%Added 18_0105 to define RFcmpGFlg for EZmDayTrend.m when an Image spot
%is clicked
tempLB= str2mat(selGnOrf)
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
end
%attemp to accomodate problems in newer Matlab which pops an unneccessay
%{
if verLessThan('matlab','8.4') %)
else %accomodate new matlab changes after 2014a fix 2nd update 23_0227
close(1)
end
%blank figure that the user has to minimize
if verLessThan('matlab','8.4') %original work 23_0227 updated 23_0525 (8.4 changed to 8.3)
else %accomodate new matlab changes after 2014a fix 2nd update 23_0227
clf
end
%}

View File

@@ -0,0 +1,522 @@
global ghandles
global Exp
%datacursormode(gcf)
%{
[output_txt]=datatipp(obj,event_obj);
clkPos=getCursorInfo(datacursormode(gcf));
cpos=clkPos.Position;
htargetAxes= clkPos.Target;
%}
%pause(1)
curKey=get(gcf,'currentkey')
htMapFg=0;
if ghandles.Iaxes1==get(htargetAxes,'Parent'),expN=1;
elseif ghandles.Iaxes2==get(htargetAxes,'Parent'),expN=2;
elseif ghandles.Iaxes3==get(htargetAxes,'Parent'),expN=3;
elseif ghandles.OLaxes1==get(htargetAxes,'Parent'),OLay=1; %zone=1; datacursormode off;
elseif ghandles.OLaxes2==get(htargetAxes,'Parent'),OLay=2; %zone=2; datacursormode off;
elseif ghandles.OLaxes3==get(htargetAxes,'Parent'),OLay=3; %zone=3; datacursormode off;
elseif ghandles.HtMap1==get(htargetAxes,'Parent'),expN=1; htMapFg=1;
elseif ghandles.HtMap2==get(htargetAxes,'Parent'),expN=2; htMapFg=1;
elseif ghandles.HtMap3==get(htargetAxes,'Parent'),expN=3; htMapFg=1;
else
return
end
try
ImageSel=expN<4
destPerMP= Exp(expN).Dexp(DexpN).destPerMP; %length(gS.DM1.drug);
MPsel=Exp(expN).Dexp(DexpN).MPsel; %floor(get(handles.MPsldr1,'value'));
pertSel=Exp(expN).Dexp(DexpN).pertSel; %floor(get(handles.DMsldr1,'value'));
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;
%x2ypos= [1400-cpos(2) cpos(1)] %for HorzRotatedImage
ptrPos=[cpos(1),cpos(2)]; %for VerticleImage
if htMapFg==0
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];
%indx=(picLoc1(1)-1)*24+picLoc1(2)
%spotFrm= Exp(expN).Dexp(DexpN).FexpScanSpots{1}{m,n,tPtSel};
spotFrm= Exp(expN).Dexp(DexpN).FexpScanSpots{plateNum}{m,n,tPtSel}; %20160108
end
end
end %for n=1:16
end %for m=1:24
destcompMsg= 'GoodDataTip';
catch
destcompMsg= 'BadDataTip';
m
n
end
plateLoc= [(17-picLoc1(1)) picLoc1(2)];
indx=(plateLoc(1)-1)*24+plateLoc(2);
elseif htMapFg==1
plateLoc= ptrPos;
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);
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 expN==1, plotAxes=ghandles.Paxes1; OLaxes=ghandles.OLaxes1;
Exp(1).traceN=Exp(1).traceN+1;
traceN=Exp(1).traceN;
end
if expN==2, plotAxes=ghandles.Paxes2; OLaxes=ghandles.OLaxes2;
Exp(2).traceN=Exp(2).traceN+1;
traceN=Exp(2).traceN;
end
if expN==3, plotAxes=ghandles.Paxes3; OLaxes=ghandles.OLaxes3;
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');
try for i=1:length(Exp(expN).hOL(:)),set(Exp(expN).hOL(i),'color',[0 0 1]); end, catch, end %ZoneRelated
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*');
catch
%{
g = K ./ (1 + exp(-r.* (t - l )));
if K==0||r==0||l==0, g(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);
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
%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
if expN==3,DMstr=char(get(ghandles.DM3,'string'));end
gene=MP(1,MPsel).genename{1,1}(indx); orf=MP(1,MPsel).orf{1,1}(indx);
spec=MP(1,MPsel).specifics{1,1}(indx); %orfrep=MP(1,plateNum).orfRep{1,1}(indx);
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)));
%graphStr=strcat(grfgenestr,'_','L=',num2str(l),'_','r=',num2str(r),'_','K=',num2str(K));
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),'\');
else
slashPos=strfind(char(Exp(expN).Dexp(DexpN).resDir),'/');
end
startPos=slashPos(length(slashPos)-1) +1;
endPos=slashPos(length(slashPos)) -1
expStr= {xp(startPos:endPos)}
Exp(expN).hOLname(traceN)= spotDescrip; %ZoneRelated %graphStr; %ghandles.Exp(expN).hOLname(traceN)= graphStr;
Exp(expN).hOLexpNm(traceN)= expStr; %ghandles.Exp(expN).hOLexpNm(traceN)= expStr;
Exp(expN).hOLresDir(traceN)= {Exp(expN).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
set(ghandles.OLay1,'string', Exp(expN).hOLname(traceN));
try if length(char(Exp(expN).hOLexpNm(traceN)))>40,set(ghandles.OLexp1,'FontSize',8);end, catch end
set(ghandles.OLexp1,'string',Exp(expN).hOLexpNm(traceN));
end
if expN==2 %&& get(ghandles.rotPB2,'value') ~=1
try if length(char(Exp(expN).hOLname(traceN)))>40,set(ghandles.OLay2,'FontSize',8);end, catch end
set(ghandles.OLay2,'string', Exp(expN).hOLname(traceN));
try if length(char(Exp(expN).hOLexpNm(traceN)))>40,set(ghandles.OLexp2,'FontSize',8);end, catch end
set(ghandles.OLexp2,'string',Exp(expN).hOLexpNm(traceN));
end
if expN==3 %&& get(ghandles.rotPB3,'value') ~=1
try if length(char(Exp(expN).hOLname(traceN)))>40,set(ghandles.OLay3,'FontSize',8);end, catch end
set(ghandles.OLay3,'string', Exp(expN).hOLname(traceN));
try if length(char(Exp(expN).hOLexpNm(traceN)))>40,set(ghandles.OLexp3,'FontSize',8);end, catch end
set(ghandles.OLexp3,'string',Exp(expN).hOLexpNm(traceN));
end
catch
end
%*******************************************************
if expN==1
zonesel=1;
set(ghandles.zoneRad1,'value',1)
set(ghandles.zoneRad2,'value',0)
set(ghandles.zoneRad3,'value',0)
orfLstSel=get(ghandles.GeneOrfTog,'value');
if orfLstSel==1
set(ghandles.listboxGnOrf,'string',Exp(expN).Dexp(DexpN).srtOrfLst)
else
set(ghandles.listboxGnOrf,'string',Exp(expN).Dexp(DexpN).srtGnLst)
end
end
if expN==2
zonesel=2;
set(ghandles.zoneRad2,'value',1)
set(ghandles.zoneRad1,'value',0)
set(ghandles.zoneRad3,'value',0)
orfLstSel=get(ghandles.GeneOrfTog,'value');
if orfLstSel==1
set(ghandles.listboxGnOrf,'string',Exp(2).srtOrfLst)
else
set(ghandles.listboxGnOrf,'string',Exp(2).srtGnLst)
end
end
if expN==3
zonesel=3;
set(ghandles.zoneRad3,'value',1)
set(ghandles.zoneRad2,'value',0)
set(ghandles.zoneRad1,'value',0)
orfLstSel=get(ghandles.GeneOrfTog,'value');
if orfLstSel==1
set(ghandles.listboxGnOrf,'string',Exp(3).srtOrfLst)
else
set(ghandles.listboxGnOrf,'string',Exp(3).srtGnLst)
end
end
%**************************************************************
catch
msg='NotImage'
end % trycatch expN<4 datatip selection from Image (not from an OverLay Plot)
%******************************************************************************************
%Write Selected Trace Info to OLAY header********************+++++++++++++++++*************
try
OLayTest=OLay<4
msg='OLay'
%make all traces blue
for i=1:length(Exp(OLay).hOL(:))
try set(Exp(OLay).hOL(i),'color',[0 0 1]), catch end
end
%if get(ghandles.rotPB1,'value')~=1,
for i=1:length(Exp(OLay).hOL(:))
htargetAxes
Exp(OLay).hOL(i)
if htargetAxes==Exp(OLay).hOL(i)
if OLay==1 && get(ghandles.rotPB1,'value')~=1,
set(htargetAxes,'color',[1 0 0])
try if length(char(Exp(OLay).hOLname(i)))>40,set(ghandles.OLay1,'FontSize',8);end, catch, end
set(ghandles.OLay1,'string', Exp(OLay).hOLname(i));
traceLab= char(Exp(OLay).hOLname(i));
try if length(char(Exp(OLay).hOLexpNm(i)))>40,set(ghandles.OLexp1,'FontSize',8);end, catch, end
set(ghandles.OLexp1,'string',Exp(OLay).hOLexpNm(i));
OLresDir= Exp(OLay).hOLresDir(i);
OLplateNum= Exp(OLay).hOLplateNum(i);
seltraceN=i;
end
if OLay==2 && get(ghandles.rotPB2,'value') ~=1
set(htargetAxes,'color',[1 0 0])
try if length(char(Exp(OLay).hOLname(i)))>40,set(ghandles.OLay2,'FontSize',8);end, catch, end
set(ghandles.OLay2,'string', Exp(OLay).hOLname(i));
traceLab= char(Exp(OLay).hOLname(i));
try if length(char(Exp(OLay).hOLexpNm(i)))>40,set(ghandles.OLexp2,'FontSize',8);end, catch, end
set(ghandles.OLexp2,'string',Exp(OLay).hOLexpNm(i));
OLresDir= Exp(OLay).hOLresDir(i);
OLplateNum= Exp(OLay).hOLplateNum(i);
seltraceN=i;
end
if OLay==3 && get(ghandles.rotPB3,'value') ~=1
set(htargetAxes,'color',[1 0 0])
try if length(char(Exp(OLay).hOLname(i)))>40,set(ghandles.OLay3,'FontSize',8);end, catch, end
set(ghandles.OLay3,'string', Exp(OLay).hOLname(i));
traceLab= char(Exp(OLay).hOLname(i));
try if length(char(Exp(OLay).hOLexpNm(i)))>40,set(ghandles.OLexp3,'FontSize',8);end, catch, end
set(ghandles.OLexp3,'string',Exp(OLay).hOLexpNm(i));
OLresDir= Exp(OLay).hOLresDir(i);
OLplateNum= Exp(OLay).hOLplateNum(i);
seltraceN=i;
end
Exp(OLay).seltraceN=seltraceN;
else
msg='Cant Find trace'
end
end % => for i=1:length(Exp(OLay).hOL(:))
%Extract row and col values from stored trace label for dest compare plots(EZdestComp)
try
tracename=char(Exp(OLay).hOLname(seltraceN))
pos_= strfind(tracename,'_')
rxcy= tracename(pos_(2):pos_(3))
cindx= strfind(rxcy,'c')
rindx= strfind(rxcy,'r')
LBr= str2num(rxcy((rindx+1):cindx-1))
LBc= str2num(tracename((pos_(2)+cindx): pos_(3)-1))
indx=((LBr-1)*24) +LBc
grfgenestr= tracename(1:pos_(3)-1)
scan= Exp(OLay).scan;
EZdatatip=2;
catch
end
catch
msg='Not in OLay frame-axis'
end %=> try for Write Selected Trace Info to OLAY header******
%HIDE HIDE HIDE ---------------------------------------------------
%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(:))
%htargetAxes %debug info
%Exp(OLay).hOL(i) %debug info
if htargetAxes==Exp(OLay).hOL(i)
hidAx1traceN=i
set(Exp(OLay).hOL(i),'Visible','off')
set(Exp(OLay).hOLb(i),'Visible','off')
for j=1:length(Exp(OLay).hOL(:))
if isequal(get(Exp(OLay).hOL(j),'Visible'),'on'), maxhN= j; end
end
end
if htargetAxes==Exp(OLay).hOL(i), break;end
end
set(Exp(OLay).hOL(maxhN),'color',[1 0 0]) %Set latest trace red
set(Exp(OLay).hOLb(maxhN),'color',[0 1 0])
if OLay==1
try if length(char(Exp(OLay).hOLname(maxhN)))>40,set(ghandles.OLay1,'FontSize',8);end, catch, end
set(ghandles.OLay1,'string', Exp(OLay).hOLname(maxhN));
traceLab= char(Exp(OLay).hOLname(maxhN));
try if length(char(Exp(OLay).hOLexpNm(maxhN)))>40,set(ghandles.OLexp1,'FontSize',8);end, catch, end
set(ghandles.OLexp1,'string',Exp(OLay).hOLexpNm(maxhN));
OLresDir= Exp(OLay).hOLresDir(maxhN);
OLplateNum= Exp(OLay).hOLplateNum(maxhN);
end
end
%------HIDE 22222222222222222-----
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
end
for i=1:length(Exp(OLay).hOL(:))
if htargetAxes==Exp(OLay).hOL(i)
hidAx2traceN=i
set(Exp(OLay).hOL(i),'Visible','off')
set(Exp(OLay).hOLb(i),'Visible','off')
for j=1:length(Exp(OLay).hOL(:))
try if isequal(get(Exp(OLay).hOL(j),'Visible'),'on'), maxhN= j; end, catch end
end
end
if htargetAxes==Exp(OLay).hOL(i), break;end
end
set(Exp(OLay).hOL(maxhN),'color',[1 0 0]) %Set latest trace red
set(Exp(OLay).hOLb(maxhN),'color',[0 1 0])
if OLay==2
try if length(char(Exp(OLay).hOLname(maxhN)))>40,set(ghandles.OLay2,'FontSize',8);end, catch, end
set(ghandles.OLay2,'string', Exp(OLay).hOLname(maxhN));
traceLab= char(Exp(OLay).hOLname(maxhN));
try if length(char(Exp(OLay).hOLexpNm(maxhN)))>40,set(ghandles.OLexp2,'FontSize',8);end, catch, end
set(ghandles.OLexp2,'string',Exp(OLay).hOLexpNm(maxhN));
OLresDir= Exp(OLay).hOLresDir(maxhN);
OLplateNum= Exp(OLay).hOLplateNum(maxhN);
end
end %if rotPB2 ....==1
%------HIDE 33333333333333-----
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
set(Exp(OLay).hOL(i),'Visible','off')
set(Exp(OLay).hOLb(i),'Visible','off')
for j=1:length(Exp(OLay).hOL(:))
try if isequal(get(Exp(OLay).hOL(j),'Visible'),'on'), maxhN= j; end, catch, end
end
end
if htargetAxes==Exp(OLay).hOL(i), break;end
end
set(Exp(OLay).hOL(maxhN),'color',[1 0 0]) %Set latest trace red
set(Exp(OLay).hOLb(maxhN),'color',[0 1 0])
if OLay==3
try if length(char(Exp(OLay).hOLname(maxhN)))>40,set(ghandles.OLay3,'FontSize',8);end, catch, end
set(ghandles.OLay3,'string', Exp(OLay).hOLname(maxhN));
traceLab= char(Exp(OLay).hOLname(maxhN));
try if length(char(Exp(OLay).hOLexpNm(maxhN)))>40,set(ghandles.OLexp3,'FontSize',8);end, catch, end
set(ghandles.OLexp3,'string',Exp(OLay).hOLexpNm(maxhN));
OLresDir= Exp(OLay).hOLresDir(maxhN);
OLplateNum= Exp(OLay).hOLplateNum(maxhN);
end
end
destcompMsg= 'Olay';
catch
msg='Not in OLay frame-axis'
end
%**********************************************************************************
%prevExp=1
NoOLay=0;
try
OLay
expN=OLay
catch
NoOLay=1;
EZdatatip=1;
end
if get(ghandles.spotTog,'value')==1 && NoOLay
OLresDir= Exp(expN).Dexp(DexpN).resDir;
OLplateNum=plateNum;
imLoc= [picLoc1(2), picLoc1(1)];
EZspotview(expN, imLoc,OLresDir,OLplateNum,NoOLay)
end
%*******************************GraphicDestinationPertibationComparison**15_821*******************
%EZdatatip=1;
EZdestComp
%********************************
if get(ghandles.spotTog,'value')==1 && get(ghandles.rotPB1,'value') ~=1 && OLay<4
msg='OLay with SpotTog On and Hide off'
pos_=strfind(traceLab,'_')
rcStr=traceLab(pos_(2)+1:pos_(3)-1)
cPos=findstr(rcStr,'c');
rUsr=str2num(rcStr(2:cPos-1));
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)
end
[output_txt]=datatipp(obj,event_obj);
%*********************HeatMap Text Field*********************************
try
ll=num2str(l);
if length(ll)>5,htl= ll(1:5);else htl=ll;end
catch
htl=' ';
end
try
n1= num2str(Exp(expN).Dexp(DexpN).HtMpIntN1(indx));
if length(n1)>5,N1= n1(1:5);else N1=n1; end
htN1=strcat('_N1=',N1);
catch,
htN1=' ';
end
try
n2= num2str(Exp(expN).Dexp(DexpN).HtMpIntN2(indx));
if length(n2)>5,N2= n2(1:5);else N2=n2; end
htN2=strcat('_N2=',N2);
catch,
htN2=' ';
end
try
htmapStr=strcat('L= ',htl, htN1,htN2)
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
catch
end
%datacursormode(gcf)
%**********************************************Test Area
%{
if get(ghandles.rotPB3,'value') ==1 && OLay==3,
for i=1:length(Exp(OLay).hOL(:))
for j=1:length(Exp(OLay).hOL(:)) %Set all traces blue
set(Exp(OLay).hOL(i),'color',[0 0 1])
end
if htargetAxes==Exp(OLay).hOL(i)
set(Exp(OLay).hOL(i),'Visible','off')
set(Exp(OLay).hOLb(i),'Visible','off')
for j=1:length(Exp(OLay).hOL(:))
if isequal(get(Exp(OLay).hOL(j),'Visible'),'on'), maxhN= j; end
end
end
if htargetAxes==Exp(OLay).hOL(i), break;end
end
set(Exp(OLay).hOL(maxhN),'color',[1 0 0]) %Set latest trace red
set(Exp(OLay).hOLb(maxhN),'color',[0 1 0])
if OLay==3
try if length(char(Exp(OLay).hOLname(maxhN)))>40,set(ghandles.OLay3,'FontSize',8);end, catch, end
set(ghandles.OLay3,'string', Exp(OLay).hOLname(maxhN));
traceLab= char(Exp(OLay).hOLname(maxhN));
try if length(char(Exp(OLay).hOLexpNm(maxhN)))>40,set(ghandles.OLexp3,'FontSize',8);end, catch, end
set(ghandles.OLexp3,'string',Exp(OLay).hOLexpNm(maxhN));
OLresDir= Exp(OLay).hOLresDir(maxhN);
OLplateNum= Exp(OLay).hOLplateNum(maxhN);
end
end %if rotPB3...==1
%}

View File

@@ -0,0 +1,749 @@
%EZvInitLoad
clear Exp
global Exp
w=pwd;
Exp(1).Dexp(1).DexpType='single';
Exp(2).Dexp(1).DexpType='single';
Exp(3).Dexp(1).DexpType='single';
Exp(1).Dexp(1).DexpType= 1;
Exp(2).Dexp(1).DexpN= 1;
Exp(3).Dexp(1).DexpN= 1;
set(handles.GeneOrfTog,'value',0)
try load 'EZsgdInfo'; catch disp('Fail to load EZsgdInfo file from code directory'); end
Exp(4).SGDnum=SGDnum;
Exp(4).SGDtext=SGDtext;
Exp(4).SGDraw=SGDraw;
Exp(4).interacPBsel=0;
try
%Non PC accommodatition
if ispc,cd(fullfile('C:\')); % \Easy\Experiments'));
else
cd(fullfile('~'))
end
[openExpfile,openExppath] = uigetfile('.mat','Open Experiment folder and data storage .mat file name','MultiSelect','off')
try
ExpOutmat= fullfile(openExppath,openExpfile);
load(ExpOutmat);
cd(openExppath)
cd ..;
resDir=pwd;
Exp(1).Dexp(1).resDir=resDir;
Exp(2).Dexp(1).resDir=resDir;
Exp(3).Dexp(1).resDir=resDir;
cd ..;
ExpPath=pwd;
Exp(1).Dexp(1).ExpFoldr=ExpPath;
Exp(2).Dexp(1).ExpFoldr=ExpPath;
Exp(3).Dexp(1).ExpFoldr=ExpPath;
cd(w)
load (fullfile(Exp(1).Dexp(1).ExpFoldr,'MasterPlateFiles','MPDMmat.mat'))
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;
Exp(3).Dexp(1).ImParMat=ImParMat;
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;
catch
end
Exp(1).traceN=0; Exp(2).traceN=0; Exp(3).traceN=0; %ZoneRelated
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
Exp(4).plotPars={'4','36','10','5'};
expN=1;
MPnum=length(Exp(expN).Dexp(1).MP);
set(handles.MPsldr1,'min',1,'max',MPnum)
set(handles.MPsldr2,'min',1,'max',MPnum)
set(handles.MPsldr3,'min',1,'max',MPnum)
DMnum= length(Exp(expN).Dexp(1).DM.drug);
set(handles.DMsldr1,'min',1,'max',DMnum) %DMnum,'value',1.01) %100,'value',1.01)
set(handles.DMsldr2,'min',1,'max',DMnum)
set(handles.DMsldr3,'min',1,'max',DMnum)
tPtsSize=size(Exp(expN).Dexp(1).FexpScanBMtp{1,1},(3));
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/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]);
set(handles.MPsldr2,'SliderStep',[1/length(MP) 1/length(MP)]);
set(handles.DMsldr2,'SliderStep',[1/length(DM.drug) 1/length(DM.drug)]);
set(handles.Tptsldr2,'SliderStep',[1/tPtsSize 1/tPtsSize]);
set(handles.MPsldr3,'SliderStep',[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]);
try
xp=char(Exp(expN).Dexp(1).resDir);
if ispc,
slashPos=strfind(char(Exp(expN).Dexp(1).resDir),'\');
else
slashPos=strfind(char(Exp(expN).Dexp(1).resDir),'/');
end
startPos=slashPos(length(slashPos)-1) +1;
endPos=slashPos(length(slashPos)) -1;
expStr= xp(startPos:endPos);
set(handles.expName1,'string',expStr);
set(handles.expName2,'string',expStr);
set(handles.expName3,'string',expStr);
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(openExppath,openExpfile);
try
DNLaxes1= handles.DNLaxes1; DNLaxes2= handles.DNLaxes2; DNLaxes3= handles.DNLaxes3;
zeroCLn= zeros(1,DMnum);
Exp(expN).expLoadCnt(1)=1; %ZoneRelated
Exp(1).hzeroCLn(1) = plot(DNLaxes1,zeroCLn,1:DMnum,'y'); try set(Exp(1).hzeroCLn,'visible','off'); catch ME, end
Exp(2).hzeroCLn(1) = plot(DNLaxes2,zeroCLn,1:DMnum,'y'); try set(Exp(2).hzeroCLn,'visible','off'); catch ME, end
Exp(3).hzeroCLn(1) = plot(DNLaxes3,zeroCLn,1:DMnum,'y'); try set(Exp(3).hzeroCLn,'visible','off'); catch ME, end
Exp(1).expLoadCnt=1;
Exp(2).expLoadCnt=1;
Exp(3).expLoadCnt=1;
catch ME, ME.message,
end
%**********************************************************************
%****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=[];
for mp=1: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;
try RF2fullPlate=sum(ismember((Exp(expN).Dexp(1).MP(mp).genename{1}),'RF2'))==384; catch, mp, msg=strcat(num2str(mp),' genename ERROR'), end
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,
Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)={'OCT1_'};
%genename{1}(ind384) replace numeric with a space ' ' or something
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)**************
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)),' ')...
&& ~strcmpi((Exp(expN).Dexp(1).MP(mp).orf{1}(ind384)),' ')...
&& ~strcmpi((Exp(expN).Dexp(1).MP(mp).orf{1}(ind384)),'')...
&& ~isempty((Exp(expN).Dexp(1).MP(mp).orf{1}(ind384)))...
&& ~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)),' ')...
&& ~strcmpi((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),' ')...
&& ~strcmpi((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),'')...
&& ~isempty((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)))...
&& ~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')
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== length(Exp(expN).Dexp(1).MP) ) && ...
~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)
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));
drf(dRF1indx,2)={strcat(':',num2str(mp),':',num2str(r),':',num2str(c))};
drf(dRF1indx,3)={mp}; drfMP(dRF1indx,mp)= 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'))...
%**********************************************************************
catch
error='EZexpSel lineAfter 135 EZvInitLoad.m'
mp
ind384
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(1).MP)
%*****************************************************
%Cover case if mutorfs RFs are labeled RF1 or RF2
try
Exp(1).Dexp(1).mutSpotIndx.wRFs= union(RFs, mutorfs);
catch
msg= 'No RFs Found in Exp! wRFs'
Exp(1).Dexp(1).mutSpotIndx.wRFs= mutorfs;
end
try
Exp(1).Dexp(1).mutSpotIndx.woRFs= setdiff(mutorfs,RFs);
catch
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=[];
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);
end
%
if ~isempty(nonZeroIndx) && mod(nonZeroCnt,2)==0, medianIndx= nonZeroIndx(1:nonZeroCnt-1); end
if ~isempty(nonZeroIndx) && mod(nonZeroCnt,2)~=0, medianIndx= nonZeroIndx, end
if ~isempty(nonZeroIndx) && length(medianIndx) > (.15*384) %To calc. a median, more than 15% of spots must be nonZero
medValLst= Exp(expN).Dexp(1).scan(rf1scN).plate(1).CFout(medianIndx,5);
medValList1{d+1}= medValLst;
min1= min(medValLst);
max1= max(medValLst);
std1= std(medValLst);
mean1= mean(medValLst)
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
RFmd1loc(2)= RFmd1pos - ((RFmd1loc(1)-1)*24); %calc c value
lstindx=lstindx+1;
lstindxOrf= lstindxOrf+1;
aa(lstindx,1)= {strcat('RF1md(',num2str(d+1),')')};
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))};
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;
Exp(1).Dexp(1).RFmd1pltN= RF1mp; Exp(2).Dexp(1).RFmd1pltN= RF1mp; Exp(3).Dexp(1).RFmd1pltN= RF1mp;
Exp(1).Dexp(1).RFmd1val(d+1)= mval1; Exp(2).Dexp(1).RFmd1val(d+1)= mval1; Exp(3).Dexp(1).RFmd1val(d+1)= mval1;
Exp(1).Dexp(1).mean1(d+1)= mean1; Exp(2).Dexp(1).mean1(d+1)= mean1; Exp(3).Dexp(1).mean1(d+1)= mean1;
Exp(1).Dexp(1).std1(d+1)= std1; Exp(2).Dexp(1).std1(d+1)= std1; Exp(3).Dexp(1).std1(d+1)= std1;
Exp(1).Dexp(1).min1(d+1)= min1; Exp(2).Dexp(1).min1(d+1)= min1; Exp(3).Dexp(1).min1(d+1)= min1;
Exp(1).Dexp(1).max1(d+1)= max1; Exp(2).Dexp(1).max1(d+1)= max1; Exp(3).Dexp(1).max1(d+1)= max1;
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
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
Exp(1).Dexp(1).RFmd1pltN= RF1mp; Exp(2).Dexp(1).RFmd1pltN= RF1mp; Exp(3).Dexp(1).RFmd1pltN= RF1mp;
catch
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')
%*************************************************************************************
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=[];
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;
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
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);
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
RFmd2loc(2)= RFmd2pos - ((RFmd2loc(1)-1)*24); %calc c value
lstindx=lstindx+1;
lstindxOrf= lstindxOrf+1;
aa(lstindx,1)= {strcat('RF2md(',num2str(d+1),')')}; %{'RF2md'};
aa(lstindx,2)={strcat(':',num2str(RF2mp),':',num2str(RFmd2loc(1)),':',num2str(RFmd2loc(2)))}; %,' std~',num2str(std2))};
bb(lstindxOrf,1)= {strcat('RF2md(',num2str(d+1),')')}; %{'RF2md'};
bb(lstindxOrf,2)={strcat(':',num2str(RF2mp),':',num2str(RFmd2loc(1)),':',num2str(RFmd2loc(2)))}; %,' std~',num2str(std2))};
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;
Exp(1).Dexp(1).RFmd2val(d+1)= mval2; Exp(2).Dexp(1).RFmd2val(d+1)= mval2; Exp(3).Dexp(1).RFmd2val(d+1)= mval2;
Exp(1).Dexp(1).mean2(d+1)= mean2; Exp(2).Dexp(1).mean2(d+1)= mean2; Exp(3).Dexp(1).mean2(d+1)= mean2;
Exp(1).Dexp(1).std2(d+1)= std2; Exp(2).Dexp(1).std2(d+1)= std2; Exp(3).Dexp(1).std2(d+1)= std2;
Exp(1).Dexp(1).min2(d+1)= min2; Exp(2).Dexp(1).min2(d+1)= min2; Exp(3).Dexp(1).min2(d+1)= min2;
Exp(1).Dexp(1).max2(d+1)= max2; Exp(2).Dexp(1).max2(d+1)= max2; Exp(3).Dexp(1).max2(d+1)= max2;
else
% Pick the first spot with zeros
% Use that position to satisfy and keep process OK
medianCalcFailed2= 'To Few nonZero spots for valid median RF2 selection'
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
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
error='EZexpSel lineAfter 354'
end %if RF2scanN doesn't exist this addition to list will be skipped
RFcombValList= cat(1,medValList1{d+1},medValList2{d+1});
Exp(1).Dexp(1).RFmean(d+1)= mean(RFcombValList);Exp(2).Dexp(1).RFmean(d+1)= mean(RFcombValList);Exp(3).Dexp(1).RFmean(d+1)= mean(RFcombValList);
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
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
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')
%*************************************************************************************************
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%*************************************************************************************************
%***********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
end
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)
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);
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);
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
medValLstDisp= Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(medianIndxDisp,5);
mval1Disp=median(medValLstDisp);
nonZeroMedPosIndx=find(mval1Disp==nonZeroValsP);
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);
Exp(1).Dexp(1).RFmedianP(d,dMPs(mm))= mval1Disp; Exp(2).Dexp(1).RFmedianP(d,dMPs(mm))= mval1Disp; Exp(3).Dexp(1).RFmedianP(d,dMPs(mm))= mval1Disp;
Exp(1).Dexp(1).meanP(d,dMPs(mm))= mean1Disp; Exp(2).Dexp(1).meanP(d,dMPs(mm))= mean1Disp; Exp(3).Dexp(1).meanP(d,dMPs(mm))= mean1Disp;
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
medianCalcFailedD= 'To Few nonZero spots for valid median RF1 selection'
firstZeroDindx= find(((Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5))==0),1,'first');
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
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);
Exp(expN).Dexp(1).RFmdPindx(d,dMPs(mm))=384; %if crapout,Then use spot384 as default to keep going
end
try
Exp(expN).Dexp(1).RFmdPpltN= dMPs(mm);
catch
catchissue='Ln'
Exp(expN).Dexp(1).RFmdPpltN= 1; %This might keep from breaking BUT ???
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******************************************************************
uu= horzcat(uu,vv);
for d=1:DMnum
medianIndxD=[];
NZrfIndxG=[];
minG = min(nonzeros(vv(:,d)));
maxG = max(nonzeros(vv(:,d)));
RFmeanG=mean(nonzeros(vv(:,d)));
RFstdG= std(nonzeros(vv(:,d)));
NZrfIndxG= find(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
RFmdDGloc(d,2)= uu(nzPosIndxDG,2); %calc r value
RFmdDGloc(d,3)= uu(nzPosIndxDG,3); %calc c value
lstindx=lstindx+1;
lstindxOrf= lstindxOrf+1;
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))};
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);
Exp(1).Dexp(1).RFmdGscanN(d)= uu(nzPosIndxDG,4); Exp(2).Dexp(1).RFmdGscanN(d)= uu(nzPosIndxDG,4); Exp(3).Dexp(1).RFmdGscanN(d)= uu(nzPosIndxDG,4);
Exp(1).Dexp(1).RFmedianG(d)= mvalsDG; Exp(2).Dexp(1).RFmedianG(d)= mvalsDG; Exp(3).Dexp(1).RFmedianG(d)= mvalsDG;
Exp(1).Dexp(1).RFmeanG(d)= RFmeanG; Exp(2).Dexp(1).RFmeanG(d)= RFmeanG; Exp(3).Dexp(1).RFmeanG(d)= RFmeanG;
Exp(1).Dexp(1).RFstdG(d)= RFstdG; Exp(2).Dexp(1).RFstdG(d)= RFstdG; Exp(3).Dexp(1).RFstdG(d)= RFstdG;
Exp(1).Dexp(1).RFminG(d)= minG; Exp(2).Dexp(1).RFminG(d)= minG; Exp(3).Dexp(1).RFminG(d)= minG;
Exp(1).Dexp(1).RFmaxG(d)= maxG; Exp(2).Dexp(1).RFmaxG(d)= maxG; Exp(3).Dexp(1).RFmaxG(d)= maxG;
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
Exp(1).Dexp(1).srtGnLst={('CheckMP/MPDMfile')};
gnLstRaw= strcat(aa(:,1),aa(:,2));
Exp(1).Dexp(1).srtGnLst= sort(gnLstRaw);
Exp(2).Dexp(1).srtGnLst=Exp(1).Dexp(1).srtGnLst;
Exp(3).Dexp(1).srtGnLst=Exp(1).Dexp(1).srtGnLst;
orfLstRaw=strcat(bb(:,1),bb(:,2));
Exp(1).Dexp(1).srtOrfLst= sort(orfLstRaw);
Exp(2).Dexp(1).srtOrfLst=Exp(1).Dexp(1).srtOrfLst;
Exp(3).Dexp(1).srtOrfLst=Exp(1).Dexp(1).srtOrfLst;
set(handles.listboxGnOrf,'string',Exp(1).Dexp(1).srtGnLst)
catch ME %Outer loop try around entire code subroutine
cd(w)
set(handles.listboxGnOrf,'string',cellstr([{'Failed To Load'}; {'Check MPDMmat file'};{'Check .xls files'};{'Check \Fotos .mat files'};{'Check \matResults file'}]))
%Exp(expN).Dexp(1).srtGnLst={('Failed To Load')};
Exp(1).Dexp(1).srtGnLst=cellstr([{'Failed To Load'}; {' '}]);
Exp(2).Dexp(1).srtGnLst=cellstr([{'Failed To Load'}; {' '}]);
Exp(3).Dexp(1).srtGnLst=cellstr([{'Failed To Load'}; {' '}]);
%Exp(expN).srtOrfLst={('Failed To Load')};
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,openExppath]
if isempty(strfind(openExpfile,'.mat'))
cd(openExppath)
cd ..
ExpPath=pwd;
cd(w)
ExpOutImFile= fullfile(openExppath,openExpfile);
EZvImagesOnly
end
end
%*********************************************************
DexpN=1;
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)
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)
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)
RFconfig=3;
end
Exp(1).RFconfig= RFconfig; Exp(2).RFconfig= RFconfig; Exp(3).RFconfig= RFconfig; %ZoneRelated
%*****************************
try msgBadGeneName, catch, end
try
Exp(1).resetHtmpTg =3; Exp(2).resetHtmpTg =3; Exp(3).resetHtmpTg =3; %ZoneRelated
if RFconfig==0,
RFconfigMsg= 'No RF1 references in this Experiment Job'
Exp(1).resetHtmpTg =1; Exp(2).resetHtmpTg =1; Exp(3).resetHtmpTg =1; %ZoneRelated
end
catch
end
%*****************************
% HtMapTog 'string', 'Current user HL/HN' selection'
try
Exp(1).htmapPBsel=0;
set(handles.HtMapTog1,'string','HL')
Exp(2).htmapPBsel=0; %ZoneRelated
set(handles.HtMapTog2,'string','HL')
Exp(3).htmapPBsel=0;
set(handles.HtMapTog3,'string','HL')
catch
% expN=1;
end
htMapTogPBfg=0;
Exp(1).htmapRFanswer= {'G','L'}; %ZoneRelated
Exp(2).htmapRFanswer= {'G','L'};
Exp(3).htmapRFanswer= {'G','L'};

View File

@@ -0,0 +1,4 @@
%EZviewGui.m startup
EZviewGui

View File

@@ -0,0 +1,4 @@
%EZviewGui_export.m startup
EZviewGui_export

View File

@@ -0,0 +1,4 @@
%EZviewGui_App.mlapp startup
EZviewGui_App
EZviewGui_App

View File

@@ -0,0 +1,4 @@
%EZviewGui_App.mlapp startup
EZviewGui_App_7

View File

@@ -0,0 +1,4 @@
%EZviewGui_App.mlapp startup
EZviewGui_App

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,144 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Migration Report for EZviewGui</title>
<style type="text/css">
html body {
height: 100%;
padding: 0; margin: 0;
color: #474747;
font: 13px/1.384 Arial, Helvetica, sans-serif;
}
/*Report Title Header*/
h1 {
font-family: Futura, Arial, Helvetica, sans-serif;
font-size: 28px;
font-weight: 400;
color: #fff;
margin: 0;
padding: 15px;
}
/*Report Section Headers*/
h2 {
padding-bottom: 2px;
margin: 20px 0 17px 0;
border-bottom: 1px solid #cbcbcb;
color: #c45400;
font: normal normal 22px/1.136 Arial,Helvetica,sans-serif;
}
/*Report Subsection Headers*/
h3 {
margin: 20px 0 20px 0;
font: normal bold 17px/1.35 Arial, Helvetica, sans-serif;
}
ul.childHasIcon {
padding-left: 20px;
}
ul > li.success {
list-style: none;
/*Check-mark image*/
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAK2SURBVHjaVJNPaFRXFMZ/b96MmUZGURMyHaoTa0QrRReD4KIlwriRRhPpoi1ddeNG4krFRbAbceOf0qJuSoWWWlooIiKlCSkp1ARksEmpi8GSQjKJUSYk/p1J5r17vi7ee609cFf3+33n3HvO8SgdJYn+oZFODw4DBxB7hYoSMzJVZBo12a2fzr9X55XwEoOBoZGyYNCDfgEyIQkMzIRkBKupYXN89svVg8OJgU+hxMDQSBk45+GVJSJQQk5IYGbIhIfrcSF78ttrC3P336wC+ANXlzqBs0A5EgtkSMJMMRxXFN11mSm/pr05sTSXX0qBDkvqj0Qx6MBC/QuVt77Pp/uvkV9bxJzhZ5r7cx2LHwGZtMQBGUhRmSaB/Zd9rb+OD98+zub1Paxbs5FjNw9GJm2NXuDLtMz2RuUC8VsVG2T9di4fGqaQ6+ZubZTvJ69goWEy/PTKTmBDykxFc0LOOLHvMu+8cQjnjDRtXDsyTiHXTaU2xpmfP6EyO4Y5Q6EgFXQBubRMM+a0zcx4t9hHb3c/j5/Ncbr3Cpva80w9HOfU7Q8IwhbmonaagQv8x0A25ZxVzAxz4tupS0jG5323eT1XZHL+DoM3+mgFLZwzEp2c0WpmqsBKypxGLb785vcLfH3vAgCT878xeKMvAp1FM5Ecg5Wn6+8Bz1Pm3K1W0xu2UFhofDf5BX8t/snFsZPxDMSZzaLOSKw2suOPHuyaAJb9v+c+bmze/aBuTnuE6wrCgJt/fMVyox6NcNwRCTARtjLV5fkt1+vTb1WAmk+hxOzUjumOrTMLkuVTXtCdgMmHJTux2nxt/Ml88Xptat+vwCzw0qdQAmCh2lPNZBsTJluU8ySsDazdhf6j1sts5cVS548P75d+qE/vrMTw8v+28ZXIAB3ABiAHZIEV4HkMLQJBIv5nAPq180UQOlmCAAAAAElFTkSuQmCC') no-repeat;
padding-left: 20px;
margin-bottom: 5px;
}
ul.verifications > li {
margin: 7px 0 7px 0;
}
table {
width: 100%;
border-collapse: collapse;
}
table,th,tr,td {
border: 1px solid #ccc;
text-align: left;
vertical-align: top;
padding: 8px 15px;
}
tr:nth-child(odd) {
background-color: #fafafa;
}
a { color: #187dbb; text-decoration: none; }
a:visited { color: #004b87; text-decoration: none; }
a:hover { color: #004b87; text-decoration: underline;}
code {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}
.reportTitle {
min-height: 52px;
background: #2f7eb2;
}
.reportBody {
padding: 0 15px 0 15px;
}
/*Classes that are used by HTML that is added dynamically by the report generator */
.detailsWorkaround {
padding: 10px 0px;
}
.detailsWorkaroundHeader {
padding-right: 5px;
font-weight: bold;
}
.hidden {
display: none;
}
.visible {
display: block;
}
.showMore {
margin-top: 5px;
}
</style>
</head>
<body>
<div class="reportTitle">
<h1>Migration Report for <code>EZviewGui</code></h1>
</div>
<div class="reportBody">
<section>
<h3>Your GUIDE app was migrated to App Designer and is ready for validation.</h3>
<h2>Migration Results</h2>
<ul class="childHasIcon">
<li class="success"><b>EZviewGui_App_7.mlapp</b> file created</li>
<li class="success"><b>2105</b> lines of code analyzed in EZviewGui.m</li>
<li class="success"><b>160</b> components created and initialized</li>
<li class="success"><b>75</b> callbacks and utility functions configured and enabled to function in App Designer</li>
</ul>
</section>
<section>
<h2>Validate Your Migrated App</h2>
<p>The migration tool enables most of your app code to execute. Now, you need to fully validate your migrated app to make sure it behaves as expected. Consider doing the following verifications:</p>
<ul>
<li>Verify Layout
<ul class="verifications">
<li>Run your app and verify the initial layout of all components is as expected.</li>
<li>If your app dynamically shows, hides, or enables additional components or options in response to selections made within the app, confirm these behave as expected.</li>
</ul>
</li>
<li>Verify Callbacks
<ul class="verifications">
<li>Run and close your app to confirm there are no startup or termination errors.</li>
<li>Exercise the workflows specific to your app, starting with the most basic, and gradually proceeding to the more complex ones.</li>
</ul>
</li>
</ul>
<p>If unexpected errors occur, either within the app or at the MATLAB command line, address those issues before continuing with the validation. For troubleshooting assistance and additional information, see <a href="matlab:helpview(fullfile(docroot,'matlab', 'creating_guis', 'differences-between-app-designer-and-guide.html#mw_7f306e19-74d0-4c0b-989d-74ed63e32ddd'));">GUIDE Migration Strategies</a>.</p>
</section>
</div>
<script type="text/javascript">
// Toggles showing the "Show More (10)" hyperlink with the "Show less" hyperlink
function toggleShowMore(selectedHyperlink) {
// Find the parent td for the selected hyperlink ("Show more" or "Show less")
var td = selectedHyperlink.parentElement.parentElement;
// Toggle the "hidden" class on all of the elements but the first 3. The first 3 we want to always be
// visible.
var tags = td.children;
for (var i=3; i<tags.length; i++) {
tags[i].classList.toggle("hidden");
}
}
</script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,426 @@
%EZhtMap
global Exp
global ghandles
global adj
global flip
if isempty(adj), adj=1.5; flip='T'; end
load('MyColormap1','modJet1')
load('MyColormap2','modJet2')
%load('MyColormap2','modJet0')
%adj= 1.5;
cleanPallet=zeros(24,16);
if expN==1,DexpN= (get(handles.DN1,'value')); end
if expN==2,DexpN= (get(handles.DN2,'value')); end
if expN==3,DexpN= (get(handles.DN3,'value')); end
Exp(expN).DexpN=DexpN;
try
if expN==1,MPsel=floor(get(ghandles.MPsldr1,'value')); end
if expN==2,MPsel=floor(get(ghandles.MPsldr2,'value')); end
if expN==3,MPsel=floor(get(ghandles.MPsldr3,'value')); end
if expN==1,pertSel=floor(get(ghandles.DMsldr1,'value')); end
if expN==2,pertSel=floor(get(ghandles.DMsldr2,'value')); end
if expN==3,pertSel=floor(get(ghandles.DMsldr3,'value')); end
catch
MPsel=1;
pertSel=1;
end
if expN==1, expAxes=ghandles.Iaxes1;end
if expN==2, expAxes=ghandles.Iaxes2;end
if expN==3, expAxes=ghandles.Iaxes3;end
dmN= length(Exp(expN).Dexp(DexpN).DM.drug);
mpSel= Exp(expN).Dexp(DexpN).MPsel;
dmSel= Exp(expN).Dexp(DexpN).pertSel;
scnN= dmSel + (dmN*(mpSel-1));
if expN==1,htTog= Exp(1).htmapPBsel;end
if expN==2,htTog= Exp(2).htmapPBsel;end
if expN==3,htTog= Exp(3).htmapPBsel;end
%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)
if L(i,j)>LpStd,
L4hMap(i,j)= LpStd;
elseif L(i,j)<LnStd && L(i,j)~=0
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);
h=image(L4hMap); %hTogHt=image(L4hMap);
if isequal(char(flip) , 'T')
colormap(flipud(modJet1)) %(flipud(hot)) %(jet); % invert heat map for L so that fastgrowth is 'hotter' red
else
colormap(modJet2)
end
set(h,'CDataMapping','scale') %set(hTogHt,'CDataMapping','scale')
else
figure
h= image(cleanPallet); %hTogHt= image(cleanPallet);
h=image(L4hMap); %hTogHt=image(L4hMap);
if isequal(char(flip) , 'T')
colormap(flipud(modJet1)) %(flipud(hot)) %(jet); % invert heat map for L so that fastgrowth is 'hotter' red
else
colormap(modJet2)
end
set(h,'CDataMapping','scale')
end
%h=image(L);
%colormap(flipud(hot)) %(jet); % invert heat map for L so that fastgrowth is 'hotter' red
%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
%if expN==1,cla(handles.HtMap1);copyobj(hTogHt,ghandles.HtMap1);end
%if expN==2,cla(handles.HtMap2);copyobj(hTogHt,ghandles.HtMap2);end
%if expN==3,cla(handles.HtMap3);copyobj(hTogHt,ghandles.HtMap3);end
close(hTogHt)
else %if clicking to produce a 'printable' save display
set(gca,'XDir','reverse')
set(gca,'XTickMode','manual')
%set(gca,'XTickLabel',{'2';'4';'6';'8';'10';'12';'14';'16'})
%set(gca,'XTickLabel',{'16';'14';'12';'10';'8';'6';'4';'2'})
%set(gca,'XTick',{0;2;4;6;8;10;12;14;16;18})
colorbar
expLblHtmap= Exp(expN).Dexp.ExpFoldr;
mediaLBhtmap= char(strcat(', Agar-',Exp(expN).Dexp(DexpN).DM.media{pertSel},' ',Exp(expN).Dexp(DexpN).DM.drug{pertSel},Exp(expN).Dexp(DexpN).DM.conc{pertSel},...
' ',Exp(expN).Dexp(DexpN).DM.mod1{pertSel},Exp(expN).Dexp(DexpN).DM.conc1{pertSel},' ',Exp(expN).Dexp(DexpN).DM.mod2{pertSel},Exp(expN).Dexp(DexpN).DM.conc2{pertSel}));
title({strcat('L HeatMap for - ',expLblHtmap),strcat('MP=',num2str(mpSel),' ,DM=',num2str(dmSel),mediaLBhtmap)})
end
%3333333333 KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
elseif htTog==1
colormap(modJet1);
K= Exp(expN).Dexp(DexpN).scan(scnN).plate.CFout(:,3);
K=reshape(K,24,16);
%Data rescaling for Heatmap display (color ranged mean+/std*multiplier)
pStd= mean(nonzeros(K(:)))+(adj*std(nonzeros(K(:))));
nStd= mean(nonzeros(K(:)))-(adj*std(nonzeros(K(:))));
for i=1:size(K,1)
for j=1:size(K,2)
if K(i,j)>pStd,
hMap(i,j)= pStd;
elseif K(i,j)<nStd && K(i,j)~=0
hMap(i,j)= nStd;
elseif K(i,j)== 0
hMap(i,j)= nStd-0.2*std(K(:));
else
hMap(i,j)= K(i,j);
end
end
end
%---------------------------------------------------
if prntHt== 0
hTogHt= figure;
h=image(cleanPallet);
else
figure
h= image(cleanPallet);
end
%h=image(cleanPallet);
h=image(hMap);
colormap(modJet1); % heat map
set(h,'CDataMapping','scale')
if expN==1,cla(handles.HtMap1);copyobj(h,ghandles.HtMap1);end
if expN==2,cla(handles.HtMap2);copyobj(h,ghandles.HtMap2);end
if expN==3,cla(handles.HtMap3);copyobj(h,ghandles.HtMap3);end
if prntHt== 0
close(hTogHt)
else
set(gca,'XDir','reverse')
set(gca,'XTickMode','manual')
%set(gca,'XTickLabel',{'2';'4';'6';'8';'10';'12';'14';'16'})
%set(gca,'XTickLabel',{'16';'14';'12';'10';'8';'6';'4';'2'})
%set(gca,'XTick',{0;2;4;6;8;10;12;14;16;18})
colorbar
expLblHtmap= Exp(expN).Dexp.ExpFoldr;
mediaLBhtmap= char(strcat(', Agar-',Exp(expN).Dexp(DexpN).DM.media{pertSel},' ',Exp(expN).Dexp(DexpN).DM.drug{pertSel},Exp(expN).Dexp(DexpN).DM.conc{pertSel},...
' ',Exp(expN).Dexp(DexpN).DM.mod1{pertSel},Exp(expN).Dexp(DexpN).DM.conc1{pertSel},' ',Exp(expN).Dexp(DexpN).DM.mod2{pertSel},Exp(expN).Dexp(DexpN).DM.conc2{pertSel}));
title({strcat('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);
r=reshape(r,24,16);
%Data rescaling for Heatmap display (color ranged mean+/std*multiplier)
pStd= mean(nonzeros(r(:)))+(adj*std(nonzeros(r(:))));
nStd= mean(nonzeros(r(:)))-(adj*std(nonzeros(r(:))));
for i=1:size(r,1)
for j=1:size(r,2)
if r(i,j)>pStd,
hMap(i,j)= pStd;
elseif r(i,j)<nStd && r(i,j)~=0,
hMap(i,j)= nStd;
elseif r(i,j)== 0
hMap(i,j)= nStd-0.2*std(r(:));
else
hMap(i,j)= r(i,j);
end
end
end
%---------------------------------------------------
if prntHt== 0
hTogHt= figure;
h=image(cleanPallet);
else
figure
h= image(cleanPallet);
end
%h=image(cleanPallet);
h=image(hMap);
colormap(modJet1); % heat map
set(h,'CDataMapping','scale')
if expN==1,cla(handles.HtMap1);copyobj(h,ghandles.HtMap1);end
if expN==2,cla(handles.HtMap2);copyobj(h,ghandles.HtMap2);end
if expN==3,cla(handles.HtMap3);copyobj(h,ghandles.HtMap3);end
if prntHt== 0
close(hTogHt)
else
set(gca,'XDir','reverse')
set(gca,'XTickMode','manual')
%set(gca,'XTickLabel',{'2';'4';'6';'8';'10';'12';'14';'16'})
%set(gca,'XTickLabel',{'16';'14';'12';'10';'8';'6';'4';'2'})
%set(gca,'XTick',{0;2;4;6;8;10;12;14;16;18})
colorbar
expLblHtmap= Exp(expN).Dexp.ExpFoldr;
mediaLBhtmap= char(strcat(', Agar-',Exp(expN).Dexp(DexpN).DM.media{pertSel},' ',Exp(expN).Dexp(DexpN).DM.drug{pertSel},Exp(expN).Dexp(DexpN).DM.conc{pertSel},...
' ',Exp(expN).Dexp(DexpN).DM.mod1{pertSel},Exp(expN).Dexp(DexpN).DM.conc1{pertSel},' ',Exp(expN).Dexp(DexpN).DM.mod2{pertSel},Exp(expN).Dexp(DexpN).DM.conc2{pertSel}));
title({strcat('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
if RFconfig==2,
QctrlRF= 'Select Distributed Control RF option: (G)Global, (L)Local';
QpertRF= 'Select Distributed Perturbation RF option: (G)Global, (L)Local';
defaultanswer= {'G','L'}; %{'80','60','100','3,4,5','N','39','Y','G','L'};
try defaultanswer= Exp(expN).htmapRFanswer; catch, defaultanswer= {'G','L'};end %ZoneRelated
end
if RFconfig==3,
QctrlRF= 'Select Control RF option: (F)FullPlate, (G)GlobalDistributed, (L)LocalDistributed';
QpertRF= 'Select Perturbation RF option: (F)FullPlate, (G)GlobalDistributed, (L)LocalDistributed';
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,...
};
name='Interaction User Input';
numlines=1;
answer=inputdlg(prompt,name,numlines,defaultanswer);
if RFconfig==2,
if ~ismember(answer{1},['g' 'G' 'l' 'L']), answer(1)=defaultanswer(1); end
if ~ismember(answer{2},['g' 'G' 'l' 'L']), answer(2)=defaultanswer(2); end
end
if RFconfig==3,
if ~ismember(answer{1},['f' 'F' 'g' 'G' 'l' 'L']), answer(1)=defaultanswer(1); end
if ~ismember(answer{2},['f' 'F' 'g' 'G' 'l' 'L']), answer(2)=defaultanswer(2); end
end
answer(1)= strrep(answer(1),'f','F'); answer(1)= strrep(answer(1),'g','G'); answer(1)= strrep(answer(1),'l','L');
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
htMapTogPBfg=0;
answer= Exp(expN).htmapRFanswer; %ZoneRelated
%for j=1:1 %dmN
% for m=1:1 %mpN
j=dmSel;
DM0= dmSel; DMj= dmSel;
m= mpSel;
%****************
anN= [1 2]; %*
EZintRFs %* Call subroutine to interpret user RF inputs & det. Rn and Rs values
%****************
scnNdm1= 1 + (dmN*(m-1))
scnN= j + (dmN*(m-1)) % 1,6,11..; 2,7,12 ..; 3,8,13..;
Xn{m,j,1}= [];
Xln{m,j,1}= [];
Xhn{m,j,1}= [];
Xn{m,1,:}=Exp(expN).Dexp(DexpN).scan(scnNdm1).plate(1).CFout(:,5);
Xln{m,1,:}=Exp(expN).Dexp(DexpN).scan(scnNdm1).plate(1).CFout(:,11); %Exp(expN).Dexp(DexpN).scan(DM{j}(m)).plate(1).CFout(:,11);
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
%{
intL{m,j,:}(Xn{m,j,:}==1.2*(max(Xn{m,j,:})))= 100;
intL{m,j,:}(intL{m,j,:}==0)=-0.0001;
%}
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);
for i=1:384
%Select lower or upper boundary value based on Yn(1)
if Xn{m,j}(i) >= (Rn(j)+RsReduced(j));
deltaYp(i)= Xln{m,j}(i)-Xln{m,1}(i);
elseif Xn{m,j}(i) < (Rn(j)-RsReduced(j));
deltaYn(i)= Xhn{m,j}(i)-Xhn{m,1}(i);
% Insert else
end
%Calculate deltaXRp and deltaXRn for each plate based on growth relative to deltaRp or deltaRn
if deltaYp(i)>= deltaRp(j)
deltaXRp(i)= deltaYp(i)-deltaRp(j);
deltaXR{m,j}(i)= deltaXRp(i); %Consoludate into deltaXR{m,j}(i) cell array
elseif deltaYn(i) < deltaRn(j)
deltaXRn(i)= deltaYn(i)-deltaRn(j);
deltaXR{m,j}(i)= deltaXRn(i); %Consoludate into deltaXR{m,j}(i) cell array
if deltaYn(i)==0, deltaXR{m,j}(i)=0; end
end
%Ambiguous results that have delta gene values that are less than the variance of Reference+/-std
end %for i=1:384
deltaXRl= deltaXR{m,j,:};
htMpN1Lzeros999= deltaXR{m,j,:};
deltaXRl(htmpCpyXn==0)=1.2*max(deltaXRl);
htMpN1Lzeros999(htmpCpyXn==0)=999;
Exp(expN).HtMpIntN1=htMpN1Lzeros999';
%**************************************************************************
I=reshape(deltaXRl,24,16);
if prntHt== 0
hTogHt= figure;
h=image(cleanPallet);
else
figure
h= image(cleanPallet);
end
%h=figure;
h=image(I);
colormap(jet); % heat map
set(h,'CDataMapping','scale')
if expN==1,cla(handles.HtMap1);copyobj(h,ghandles.HtMap1);end
if expN==2,cla(handles.HtMap2);copyobj(h,ghandles.HtMap2);end
if expN==3,cla(handles.HtMap3);copyobj(h,ghandles.HtMap3);end
if prntHt== 0
close(hTogHt)
else
set(gca,'XDir','reverse')
set(gca,'XTickMode','manual')
%set(gca,'XTickLabel',{'2';'4';'6';'8';'10';'12';'14';'16'})
%set(gca,'XTickLabel',{'16';'14';'12';'10';'8';'6';'4';'2'})
%set(gca,'XTick',{0;2;4;6;8;10;12;14;16;18})
colorbar
expLblHtmap= Exp(expN).Dexp.ExpFoldr;
mediaLBhtmap= char(strcat(', Agar-',Exp(expN).Dexp(DexpN).DM.media{pertSel},' ',Exp(expN).Dexp(DexpN).DM.drug{pertSel},Exp(expN).Dexp(DexpN).DM.conc{pertSel},...
' ',Exp(expN).Dexp(DexpN).DM.mod1{pertSel},Exp(expN).Dexp(DexpN).DM.conc1{pertSel},' ',Exp(expN).Dexp(DexpN).DM.mod2{pertSel},Exp(expN).Dexp(DexpN).DM.conc2{pertSel}));
title({strcat('N1 HeatMap for - ',expLblHtmap),strcat('MP=',num2str(mpSel),' ,DM=',num2str(dmSel),mediaLBhtmap)})
end
% 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
%****************
scnNdm1= 1 + (dmN*(m-1))
scnN= j + (dmN*(m-1)) % 1,6,11..; 2,7,12 ..; 3,8,13..;
Xn{m,j,1}= [];
Xn{m,1,:}=Exp(expN).Dexp(DexpN).scan(scnNdm1).plate(1).CFout(:,5);
Xn{m,j,:}=Exp(expN).Dexp(DexpN).scan(scnN).plate(1).CFout(:,5);
htmpCpyXn=Xn{m,j,:}'; % Use to find and delineate no growth spots with 999 in text field (infinite interaction) value;
intL= ((Xn{m,j,:} - Xn{m,1,:}) - (Rn(j)-Rn(1)));
Exp(expN).HtMpIntN2=intL; %ZoneRelated
intL= Exp(expN).HtMpIntN2; %ZoneRelated
I=reshape(intL,24,16);
if prntHt== 0
hTogHt= figure;
h=image(cleanPallet);
elsef
figure
h= image(cleanPallet);
end
%h=figure
h=image(I)
colormap(jet); % heat map
set(h,'CDataMapping','scale')
if expN==1,cla(handles.HtMap1);copyobj(h,ghandles.HtMap1);end
if expN==2,cla(handles.HtMap2);copyobj(h,ghandles.HtMap2);end
if expN==3,cla(handles.HtMap3);copyobj(h,ghandles.HtMap3);end
if prntHt== 0
close(hTogHt)
else
set(gca,'XDir','reverse')
set(gca,'XTickMode','manual')
%set(gca,'XTickLabel',{'2';'4';'6';'8';'10';'12';'14';'16'})
%set(gca,'XTickLabel',{'16';'14';'12';'10';'8';'6';'4';'2'})
%set(gca,'XTick',{0;2;4;6;8;10;12;14;16;18})
colorbar
expLblHtmap= Exp(expN).Dexp.ExpFoldr;
mediaLBhtmap= char(strcat(', Agar-',Exp(expN).Dexp(DexpN).DM.media{pertSel},' ',Exp(expN).Dexp(DexpN).DM.drug{pertSel},Exp(expN).Dexp(DexpN).DM.conc{pertSel},...
' ',Exp(expN).Dexp(DexpN).DM.mod1{pertSel},Exp(expN).Dexp(DexpN).DM.conc1{pertSel},' ',Exp(expN).Dexp(DexpN).DM.mod2{pertSel},Exp(expN).Dexp(DexpN).DM.conc2{pertSel}));
title({strcat('N2 HeatMap for - ',expLblHtmap),strcat('MP=',num2str(mpSel),' ,DM=',num2str(dmSel),mediaLBhtmap)})
end
end %if htTog==
prntHt= 0;
%************* *****
EZhtMapText %* Update htMapText for location on the first 'roll thru of htMapPB
%************* *****

View File

@@ -0,0 +1,641 @@
%single gene L based interaction shift display
%function EZinteractDev4
global Exp
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 sum(ismember(fieldnames(Exp(expN).Dexp(DexpN)),'RFmean'))&&...
~isempty(Exp(expN).Dexp(DexpN).RFmean)&&...
sum(ismember(fieldnames(Exp(expN).Dexp(DexpN)),'RFmeanG'))&&...
isempty(Exp(expN).Dexp(DexpN).RFmeanG)
RFconfig=1;
end
if sum(ismember(fieldnames(Exp(expN).Dexp(DexpN)),'RFmean'))==0 ||...
isempty(Exp(expN).Dexp(DexpN).RFmean)&&...
sum(ismember(fieldnames(Exp(expN).Dexp(DexpN)),'RFmeanG'))&&...
~isempty(Exp(expN).Dexp(DexpN).RFmeanG)
RFconfig=2;
end
if sum(ismember(fieldnames(Exp(expN).Dexp(DexpN)),'RFmean'))&&...
~isempty(Exp(expN).Dexp(DexpN).RFmean)&&...
sum(ismember(fieldnames(Exp(expN).Dexp(DexpN)),'RFmeanG'))&&...
~isempty(Exp(expN).Dexp(DexpN).RFmeanG)
RFconfig=3;
end
if (sum(ismember(fieldnames(Exp(expN).Dexp(DexpN)),'RFmean'))==0 ||...
isempty(Exp(expN).Dexp(DexpN).RFmean))&&...
(sum(ismember(fieldnames(Exp(expN).Dexp(DexpN)),'RFmeanG'))==0||...
isempty(Exp(expN).Dexp(DexpN).RFmeanG))
return
end
%RFconfig= 2; %1= FullPlateOnly; 2= DistributedOnly; 3= Both FullPlate && Distributed
if RFconfig==1,
defaultanswer={'80','60','100','3,4,5','N','39','Y'};
end
if RFconfig==2,
QctrlRF= 'Select Distributed Control RF option: (G)Global, (L)Local';
QpertRF= 'Select Distributed Perturbation RF option: (G)Global, (L)Local';
defaultanswer={'80','60','100','3,4,5','N','39','Y','G','L'};
end
if RFconfig==3,
QctrlRF= 'Select Control RF option: (F)FullPlate, (G)GlobalDistributed, (L)LocalDistributed';
QpertRF= 'Select Perturbation RF option: (F)FullPlate, (G)GlobalDistributed, (L)LocalDistributed';
defaultanswer={'80','60','100','3,4,5','N','39','Y','F','L'};
end
%User Input decode for application ***************************
if RFconfig==1,
prompt={'Enter LeftSide Central Boundary in Percent:',...
'Enter RightSide Central Boundary in Percent:', ...
'Enter percent of Reference Standard Deviation to use', ...
'Enter Perturbation Numbers for set intersect:' ...
'Remove No Growth Infinite Interactors:' ...
'Number of Bins for Histograms'...
'Subplots(Y), Multiple Plots(N), Suspend Plots(S)'};
else
prompt={'Enter LeftSide Central Boundary in Percent:',...
'Enter RightSide Central Boundary in Percent:', ...
'Enter percent of Reference Standard Deviation to use', ...
'Enter Perturbation Numbers for set intersect:' ...
'Remove No Growth Infinite Interactors:' ...
'Number of Bins for Histograms'...
'Subplots(Y), Multiple Plots(N), Suspend Plots(S)',...
QctrlRF,...
QpertRF,...
};
end
name='Interaction User Input';
numlines=1;
%defaultanswer={'80','60','100','3,4,5','N','39','Y','0,',''};
answer=inputdlg(prompt,name,numlines,defaultanswer);
negPercent= str2double(cell2mat(answer(1)));
posPercent= str2double(cell2mat(answer(2)));
percentRs= str2double(cell2mat(answer(3)));
DMstr= cell2mat(answer(4));
DMcomas=strfind((cell2mat(answer(4))),',');
removInfinL= answer(5);
numBins= str2double(cell2mat(answer(6)));
subplotX= answer(7);
%{
rfMPstr= cell2mat(answer(8));
rfMPcomas=strfind((cell2mat(answer(8))),',');
rfGeneName= answer(9);
n=0;
rfMPsel(1)=0;
for i= rfMPcomas,
n=n+1
rfMPsel(n)= str2double(rfMPstr(i-1:i))
if i== max(rfMPcomas)
rfMPsel(n+1)= str2double(rfMPstr(i:end))
end
end
%}
n=0;
for i= DMcomas,
n=n+1
DMsel(n)= str2double(DMstr(i-1:i))
if i== max(DMcomas)
DMsel(n+1)= str2double(DMstr(i:end))
end
end
%**************************************************************
%Rn=Exp(expN).Dexp(DexpN).RFmean;
%Rs=Exp(expN).Dexp(DexpN).RFstd;
dmN= length(Exp(expN).Dexp(DexpN).DM.drug);
mpN= length(Exp(expN).Dexp(DexpN).MP);
%Intc1=3; IntcLst=5;
%Calculate Interaction values (with and without
%standardDeviation/Upper-Lower boundary compensation
for j=1:dmN
for m=1:mpN
%****************
DM0= 1;
DMj= j;
anN= [8 9];
EZintRFs %* Call subroutine to interpret user RF inputs
%****************
scnN= j + (dmN*(m-1)) % 1,6,11..; 2,7,12 ..; 3,8,13..;
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);
Xn{m,j,:}(Xn{m,j,:}==0)= 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);
methCalc=1;
if methCalc==0
intL{m,j,:} = (Xn{m,j,:} - Rn(j));
intL{m,j,:}(Xn{m,j,:}==140)= 100;
else
intL{m,j,:} = ((Xn{m,j,:} - Xn{m,1,:}) - (Rn(j)-Rn(1)));
intL{m,j,:}(Xn{m,j,:}==140)= 100;
intL{m,j,:}(intL{m,j,:}==0)=-0.1;
end
if methCalc==0
deltaXR{m,j}= zeros(1,384);
deltaXR{m,j}(Xn{m,j} >=(Rn(j)+Rs(j)))= ( Xln{m,j}(Xn{m,j} >=(Rn(j)+Rs(j))))- (Rn(j)+Rs(j));
deltaXR{m,j}(Xn{m,j} < (Rn(j)-Rs(j)))= ( Xhn{m,j}(Xn{m,j} < (Rn(j)-Rs(j))))- (Rn(j)-Rs(j));
Xneg= Xhn{m,j}- (Rn(j)-Rs(j));
Xpos= Xln{m,j}- (Rn(j)+Rs(j));
for i=1:length(Xpos(:)),
%deltaXR{m,j}(i)= Xpos(i);
if deltaXR{m,j}(i)==0
try
if abs(Xpos(i))<abs(Xneg(i)), deltaXR{m,j}(i)= Xpos(i);end
catch, end
end
end
for i=1:length(Xneg(:)),
if deltaXR{m,j}(i)==0, deltaXR{m,j}(i)= Xneg(i); end
try
if abs(Xpos(i))>abs(Xneg(i)), deltaXR{m,j}(i)= Xneg(i); end
catch
end
end
%else else else else
else %if methCalc~=0
%percentRs= 100;
RsReduced(j)= percentRs/100* Rs(j)
%{
Yn{m,j}= Xn{m,j}-Xn{m,1}; %Yn is deltaXn
Yn{m,j}(Yn{m,j}==0)=-0.5;
Yln{m,j}= Xln{m,j}-Xln{m,1};
Yln{m,j}(Yln{m,j}==0)=-0.5;
Yhn{m,j}= Xhn{m,j}-Xhn{m,1};
Yhn{m,j}(Yhn{m,j}==0)=-0.5;
%}
%deltaRp(j)= (Rn(j)+RsReduced(j))-Rn(1); %
deltaRp(j)= (Rn(j)+RsReduced(j))-(Rn(1)+RsReduced(1));
%deltaRn(j)= (Rn(j)-RsReduced(j))-Rn(1); %
deltaRn(j)=(Rn(j)-RsReduced(j))-(Rn(1)-RsReduced(1));
if deltaRp(j)==0, deltaRp(j)=0.2; end
if deltaRn(j)==0, deltaRn(j)=0.2; end
deltaYp= zeros(1,384); deltaYn= zeros(1,384);
deltaXRp= zeros(1,384); deltaXRn= zeros(1,384);
deltaXR{m,j}= zeros(1,384);
for i=1:384
%Select lower or upper boundary value based on Yn(1)
if Xn{m,j}(i) >= (Rn(j)+RsReduced(j));
deltaYp(i)= Xln{m,j}(i)-Xln{m,1}(i);
elseif Xn{m,j}(i) < (Rn(j)-RsReduced(j));
deltaYn(i)= Xhn{m,j}(i)-Xhn{m,1}(i);
% Insert else
end
%Calculate deltaXRp and deltaXRn for each plate based on growth relative to deltaRp or deltaRn
if deltaYp(i)>= deltaRp(j)
deltaXRp(i)= deltaYp(i)-deltaRp(j);
deltaXR{m,j}(i)= deltaXRp(i); %Consoludate into deltaXR{m,j}(i) cell array
elseif deltaYn(i) < deltaRn(j)
deltaXRn(i)= deltaYn(i)-deltaRn(j);
deltaXR{m,j}(i)= deltaXRn(i); %Consoludate into deltaXR{m,j}(i) cell array
if deltaYn(i)==0, deltaXR{m,j}(i)=0; end
end
%Ambiguous results that have delta gene values that are less than the variance of Reference+/-std
end %for i=1:384
%**************************************************************************
end %if methCalc==0
deltaXR{m,j,:}(Xn{m,j,:}==140)= 100;
deltaXR{m,j,:}(Xln{m,j,:}==0)= 100;
deltaXR{m,j,:}(isnan(Xln{m,j,:}))= 120;
deltaXR{m,j,:}(Xhn{m,j,:}==0)= 100;
deltaXR{m,j,:}(isnan(Xhn{m,j,:}))= 120;
%Compile all gene related L values for the each pert-DM (j).
addend= (1+((m-1)*384)) %((((m-1)*j)*384)+1);
intLcmp(addend:addend+383,j)= cell2mat(intL(m,j,:)); %((addend:addend+383),j)= cell2mat(intL(j,m,:));
intLadjcmp(addend:addend+383,j)= cell2mat(deltaXR(m,j,:)); %((addend:addend+383),j)= cell2mat(deltaXR(j,m,:));
end %m=1:mpN
%Remove RFs and Blank (or non annotated ' ') orf data Then
%Filter data per user intput
intLc{j}= intLcmp(:,j);
intLwoRFs{j}(1,:)= intLcmp(Exp(expN).Dexp(DexpN).mutSpotIndx.woRFs,j);
intLwoRFs{j}(2,:)= Exp(expN).Dexp(DexpN).mutSpotIndx.woRFs;%Index of non-RF non-blank spots %Crude early intLcmp(385:(mpN-1)*384,j);
if strcmpi(removInfinL,'Y')
intLwoRFs0{j}(1,:)= intLwoRFs{j}(1,(intLwoRFs{j}(1,:)~= 100)); %intLcmp(Exp(1).mutSpotIndx.woRFs,j);
intLwoRFs0{j}(2,:)= intLwoRFs{j}(2,(intLwoRFs{j}(1,:)~= 100)); % intLcmp(385:(mpN-1)*384,j);
clear intLwoRFs
intLwoRFs{j}(1,:)= intLwoRFs0{j}(1,:);
intLwoRFs{j}(2,:)= intLwoRFs0{j}(2,:);
end
intLwoRFsorted{j}= sortrows(intLwoRFs{j}',1);
clear intLcmpSortGT0 intLcmpSortLT0
tempIntL= intLwoRFsorted{j}(:,1);
intLcmpSortGT0= tempIntL((tempIntL) >0);
if ~isempty(intLcmpSortGT0)
centPosCnt= round(posPercent/100 * length(intLcmpSortGT0));
intLposSel{j}=intLwoRFsorted{j}((length(intLcmpSortGT0)+centPosCnt): end,:);
posIntboundryCentralVal(j)= intLcmpSortGT0((centPosCnt),:); %For Histogram use
else
posIntboundryCentralVal(j)= 0;
end
intLcmpSortLT0= tempIntL((tempIntL) <0);
if ~isempty(intLcmpSortLT0)
centNegCnt= round(negPercent/100 * length(intLcmpSortLT0));
intLnegSel{j}=intLwoRFsorted{j}((1:(length(intLcmpSortLT0)-centNegCnt)),:);
negIntboundryCentralVal(j)= intLcmpSortLT0(((length(intLcmpSortLT0))-(centNegCnt)),:); %For Histogram use
else
negIntboundryCentralVal(j)=0;
end
%Find potential Interactors within selected range
if j== DMsel(1) %Intc1,
InterslstPos{1}= intLposSel{DMsel(1)}(:,2) %intLcmpposInd{Intc1}
InterslstNeg{1}= intLnegSel{DMsel(1)}(:,2) %intLcmpnegInd{Intc1}
elseif sum(ismember(DMsel,j))==1 %Intc1 && j<=IntcLst
InterslstPos{1}=(intersect(InterslstPos{1},intLposSel{j}(:,2))); %,intLcmpposInd{j}))
InterslstNeg{1}=(intersect(InterslstNeg{1},intLnegSel{j}(:,2))); %,intLcmpnegInd{j}))
end
%Convolute experiment spot index to get scan#, MP# and plateIndx needed
%later to obtain genename and other descriptors and correlate data
try
intLposDIndx{j}(:,2)=ceil((intLposSel{j}(:,2))/384); %mp plate numb column
intLposDIndx{j}(:,3)=(rem(intLposSel{j}(:,2),384));
nn=(intLposDIndx{j}(:,3)==0);
intLposDIndx{j}(nn,3)= 384;
intLposDIndx{j}(:,1)= j + (dmN*((intLposDIndx{j}(:,2))-1)); %scan numb column %intLposDIndx(:,2)* intLposDIndx(:,3);
catch
end
try
intLnegDIndx{j}(:,2)=ceil((intLnegSel{j}(:,2))/384); %mp plate numb column
intLnegDIndx{j}(:,3)=(rem(intLnegSel{j}(:,2),384));
nn=(intLnegDIndx{j}(:,3)==0); %fixed 170405 was using (intL'pos'DIndx{j}(:,3)==0);
intLnegDIndx{j}(nn,3)= 384;
intLnegDIndx{j}(:,1)= j + (dmN*((intLnegDIndx{j}(:,2))-1)); %scan numb
catch
end
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%********************************************************************************************
%ADJUSTED L for Reference Standard deviation(More conservative) Interaction List compilation
if strcmpi(removInfinL,'N')
intLadjwoRFs{j}(1,:)=intLadjcmp(Exp(expN).Dexp(DexpN).mutSpotIndx.woRFs,j);
intLadjwoRFs{j}(2,:)= Exp(expN).Dexp(DexpN).mutSpotIndx.woRFs; %intLadjcmp(385:(mpN-1)*384,j); %intLadjcmp(Exp(expN).Dexp(DexpN).mutSpotIndx.woRFs,j);
elseif strcmpi(removInfinL,'Y')
intLadjwoRFs{j}(1,:)=intLadjcmp(Exp(expN).Dexp(DexpN).mutSpotIndx.woRFs,j);
intLadjwoRFs{j}(2,:)= Exp(expN).Dexp(DexpN).mutSpotIndx.woRFs; %intLadjcmp(385:(mpN-1)*384,j); %intLadjcmp(Exp(expN).Dexp(DexpN).mutSpotIndx.woRFs,j);
intLadjwoRFs100{j}(1,:)= intLadjwoRFs{j}(1,(intLadjwoRFs{j}(1,:)~= 100)) ; %intLcmp(Exp(1).mutSpotIndx.woRFs,j);
intLadjwoRFs100{j}(2,:)= intLadjwoRFs{j}(2,(intLadjwoRFs{j}(1,:)~= 100)) ; % Remove Index where spots are infinite (=100);
intLadjwoRFs0{j}(1,:)= intLadjwoRFs100{j}(1,(intLadjwoRFs100{j}(1,:)~= 0)); % Remove Index where spots are indeterminely within the range of Ref STD
intLadjwoRFs0{j}(2,:)= intLadjwoRFs100{j}(2,(intLadjwoRFs100{j}(1,:)~= 0)); % Remove Index where spots are indeterminely within the range of Ref STD
clear intLadjwoRFs
intLadjwoRFs{j}(1,:)= intLadjwoRFs0{j}(1,:); %Put filtered results back into intLadjwoRFs
intLadjwoRFs{j}(2,:)= intLadjwoRFs0{j}(2,:); %Put filtered results back into intLadjwoRFs
end
intLwoRFsortedAdj{j}= sortrows(intLadjwoRFs{j}',1);
clear intLadjSortGT0 intLadjSortLT0
tempIntLadj= intLwoRFsortedAdj{j}(:,1);
intLadjSortLT0= tempIntLadj((tempIntLadj) <0);
intLadjSort0s= tempIntLadj(tempIntLadj ==0)
intLadjSortGT0= tempIntLadj(tempIntLadj >0); %=0);
if ~isempty(intLadjSortGT0)&& ~isempty(intLadjSortLT0)
centPosCntAdj= round(posPercent/100 * length(intLadjSortGT0));
intLposSelAdj{j}=intLwoRFsortedAdj{j}((length(intLadjSortLT0)+ length(intLadjSort0s) + centPosCntAdj): end,:);
posIntboundryCentralValAdj(j)= intLadjSortGT0(centPosCntAdj,:);
else
posIntboundryCentralValAdj(j)= 0;
end
if ~isempty(intLadjSortLT0)
try
centNegCntAdj= round(negPercent/100 * length(intLadjSortLT0));
intLnegSelAdj{j}=intLwoRFsortedAdj{j}((1:(length(intLadjSortLT0)-centNegCntAdj)),:);
negIntboundryCentralValAdj(j)= intLadjSortLT0(((length(intLadjSortLT0))-(centNegCntAdj)),:);
catch,negIntboundryCentralValAdj(jj)= 1;
end
else
negIntboundryCentralValAdj(j)= 1;
end
if j== DMsel(1) %Intc1,
InterslstPosAdj{1}= intLposSelAdj{DMsel(1)}(:,2) %intLcmpposInd{Intc1}
InterslstNegAdj{1}= intLnegSelAdj{DMsel(1)}(:,2) %intLcmpnegInd{Intc1}
elseif sum(ismember(DMsel,j))==1 % j>Intc1 && j<=IntcLst
InterslstPosAdj{1}=(intersect(InterslstPosAdj{1},intLposSelAdj{j}(:,2))); %,intLcmpposInd{j}))
InterslstNegAdj{1}=(intersect(InterslstNegAdj{1},intLnegSelAdj{j}(:,2))); %,intLcmpnegInd{j}))
end
%Convolute experiment spot index to get scan#, MP# and plateIndx needed
%later to obtain genename and other descriptors and correlate data
try
intLposDIndxAdj{j}(:,2)=ceil((intLposSelAdj{j}(:,2))/384); %mp plate numb column
intLposDIndxAdj{j}(:,3)=(rem(intLposSelAdj{j}(:,2),384));
nn=(intLposDIndxAdj{j}(:,3)==0);
intLposDIndx{j}(nn,3)= 384;
intLposDIndxAdj{j}(:,1)= j + (dmN*((intLposDIndxAdj{j}(:,2))-1)); %scan numb column %intLposDIndx(:,2)* intLposDIndx(:,3);
catch
end
try
intLnegDIndxAdj{j}(:,2)=ceil((intLnegSelAdj{j}(:,2))/384); %mp plate numb column
intLnegDIndxAdj{j}(:,3)=(rem(intLnegSelAdj{j}(:,2),384));
nn=(intLnegDIndxAdj{j}(:,3)==0); %Fixed 170405 (intL'pos'DIndxAdj{j}(:,3)==0);
intLnegDIndxAdj{j}(nn,3)= 384;
intLnegDIndxAdj{j}(:,1)= j + (dmN*((intLnegDIndxAdj{j}(:,2))-1)); %scan numb
catch
end
end %j=1:dmN
%****************************************************************************************
%*****End of Main looping proceedure***********************************************************************************
%****************************************************************************************
%get interaction values for each DM drugmedia agar type
IntersValsPos= intLcmp(InterslstPos{1},DMsel);
IntersValsNeg= intLcmp(InterslstNeg{1},DMsel);
IntersValsPosAdj= intLadjcmp(InterslstPosAdj{1},DMsel);
IntersValsNegAdj= intLadjcmp(InterslstNegAdj{1},DMsel);
%*********************************************************
%Build 'genelist' data sheet for interactors
selIntPx{1}(:,6)=InterslstPos{1};
selIntPx{1}(:,2)=ceil((InterslstPos{1})/384); %mp plate numb column
selIntPx{1}(:,3)=(rem(InterslstPos{1},384));
nn=(selIntPx{1}(:,3)==0);
selIntPx{1}(nn,3)= 384;
selIntPx{1}(:,4)= ceil(selIntPx{1}(:,3)/24); %row numb
selIntPx{1}(:,5)= rem(selIntPx{1}(:,3),24);
mm=(selIntPx{1}(:,5)==0);
selIntPx{1}(mm,5)= 24;
selIntPx{1}(:,1)= j + (dmN*((selIntPx{1}(:,2))-1)); %scan numb column %intLposDIndx(:,2)* intLposDIndx(:,3);
selIntP= cell2mat(selIntPx);
selIntNx{1}(:,6)=InterslstNeg{1};
selIntNx{1}(:,2)=ceil((InterslstNeg{1})/384); %mp plate numb column
selIntNx{1}(:,3)=(rem(InterslstNeg{1},384));
nn=(selIntNx{1}(:,3)==0);
selIntNx{1}(nn,3)= 384;
selIntNx{1}(:,4)= ceil(selIntNx{1}(:,3)/24); %row numb
selIntNx{1}(:,5)= rem(selIntNx{1}(:,3),24);
mm=(selIntNx{1}(:,5)==0);
selIntNx{1}(mm,5)= 24;
selIntNx{1}(:,1)= j + (dmN*((selIntNx{1}(:,2))-1)); %scan numb
selIntN= cell2mat(selIntNx);
for i=1:size(selIntP,1)
IPgene(i)=Exp(expN).Dexp(DexpN).MP(selIntP(i,2)).genename{1}(selIntP(i,3));
IPorf(i)= Exp(expN).Dexp(DexpN).MP(selIntP(i,2)).orf{1}(selIntP(i,3));
IPstrain(i)= Exp(expN).Dexp(DexpN).MP(selIntP(i,2)).strain{1}(selIntP(i,3));
IPspecifics(i)=Exp(expN).Dexp(DexpN).MP(selIntP(i,2)).specifics{1}(selIntP(i,3));
IPorfRep(i)=Exp(expN).Dexp(DexpN).MP(selIntP(i,2)).orfRep{1}(selIntP(i,3));
%Bad this is the L data for only the last selected DM perturbation
%Would need to calculate each scan# for each DMsel value
ipL(i)= Exp(expN).Dexp(DexpN).scan(selIntP(i,1)).plate(1).CFout(selIntP(i,3),5);
ipLlower(i)= Exp(expN).Dexp(DexpN).scan(selIntP(i,1)).plate(1).CFout(selIntP(i,3),11);
ipLupper(i)= Exp(expN).Dexp(DexpN).scan(selIntP(i,1)).plate(1).CFout(selIntP(i,3),12);
%*************************************************************************
end
for i=1:size(selIntN,1)
INgene(i)=Exp(expN).Dexp(DexpN).MP(selIntN(i,2)).genename{1}(selIntN(i,3));
INorf(i)= Exp(expN).Dexp(DexpN).MP(selIntN(i,2)).orf{1}(selIntN(i,3));
INstrain(i)= Exp(expN).Dexp(DexpN).MP(selIntN(i,2)).strain{1}(selIntN(i,3));
INspecifics(i)=Exp(expN).Dexp(DexpN).MP(selIntN(i,2)).specifics{1}(selIntN(i,3));
INorfRep(i)=Exp(expN).Dexp(DexpN).MP(selIntN(i,2)).orfRep{1}(selIntN(i,3));
%Bad this is the L data for only the last selected DM perturbation
%Would need to calculate each scan# for each DMsel value
inL(i)= Exp(expN).Dexp(DexpN).scan(selIntN(i,1)).plate(1).CFout(selIntN(i,3),5);
inLlower(i)= Exp(expN).Dexp(DexpN).scan(selIntN(i,1)).plate(1).CFout(selIntN(i,3),11);
inLupper(i)= Exp(expN).Dexp(DexpN).scan(selIntN(i,1)).plate(1).CFout(selIntN(i,3),12);
%*************************************************************************
end
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%**************************************************************************************
%ADJUSTED with STD and curve fit boundaries to produce more conservative interaction values
%Build 'genelist' data sheet for interactors
selIntPxAdj{1}(:,2)=ceil((InterslstPosAdj{1})/384); %mp plate numb column
selIntPxAdj{1}(:,3)=(rem(InterslstPosAdj{1},384));
nn=(selIntPxAdj{1}(:,3)==0);
selIntPxAdj{1}(nn,3)= 384;
selIntPxAdj{1}(:,4)= ceil(selIntPxAdj{1}(:,3)/24); %row numb
selIntPxAdj{1}(:,5)= rem(selIntPxAdj{1}(:,3),24);
mm=(selIntPxAdj{1}(:,5)==0);
selIntPxAdj{1}(mm,5)= 24;
selIntPxAdj{1}(:,1)= j + (dmN*((selIntPxAdj{1}(:,2))-1)); %scan numb column %intLposDIndx(:,2)* intLposDIndx(:,3);
selIntPAdj= cell2mat(selIntPxAdj);
if ~isempty(InterslstNegAdj{1})
selIntNxAdj{1}(:,2)=ceil((InterslstNegAdj{1})/384); %mp plate numb column
selIntNxAdj{1}(:,3)=(rem(InterslstNegAdj{1},384));
nn=(selIntNxAdj{1}(:,3)==0);
selIntNxAdj{1}(nn,3)= 384;
selIntNxAdj{1}(:,4)= ceil(selIntNxAdj{1}(:,3)/24); %row numb
selIntNxAdj{1}(:,5)= rem(selIntNxAdj{1}(:,3),24);
mm=(selIntNxAdj{1}(:,5)==0);
selIntNxAdj{1}(mm,5)= 24;
selIntNxAdj{1}(:,1)= j + (dmN*((selIntNxAdj{1}(:,2))-1)); %scan numb
selIntNAdj= cell2mat(selIntNxAdj);
end
for i=1:size(selIntPAdj,1)
IPgeneAdj(i)=Exp(expN).Dexp(DexpN).MP(selIntPAdj(i,2)).genename{1}(selIntPAdj(i,3));
IPorfAdj(i)= Exp(expN).Dexp(DexpN).MP(selIntPAdj(i,2)).orf{1}(selIntPAdj(i,3));
IPstrainAdj(i)= Exp(expN).Dexp(DexpN).MP(selIntPAdj(i,2)).strain{1}(selIntPAdj(i,3));
IPspecificsAdj(i)=Exp(expN).Dexp(DexpN).MP(selIntPAdj(i,2)).specifics{1}(selIntPAdj(i,3));
IPorfRepAdj(i)=Exp(expN).Dexp(DexpN).MP(selIntPAdj(i,2)).orfRep{1}(selIntPAdj(i,3));
%Bad this is the L data for only the last selected DM perturbation
%Would need to calculate each scan# for each DMsel value
ipLAdj(i)= Exp(expN).Dexp(DexpN).scan(selIntPAdj(i,1)).plate(1).CFout(selIntPAdj(i,3),5);
ipLlowerAdj(i)= Exp(expN).Dexp(DexpN).scan(selIntPAdj(i,1)).plate(1).CFout(selIntPAdj(i,3),11);
ipLupperAdj(i)= Exp(expN).Dexp(DexpN).scan(selIntPAdj(i,1)).plate(1).CFout(selIntPAdj(i,3),12);
%************************************************************************************
end
if ~isempty(InterslstNegAdj{1})
for i=1:size(selIntNAdj,1)
INgeneAdj(i)=Exp(expN).Dexp(DexpN).MP(selIntNAdj(i,2)).genename{1}(selIntNAdj(i,3));
INorfAdj(i)= Exp(expN).Dexp(DexpN).MP(selIntNAdj(i,2)).orf{1}(selIntNAdj(i,3));
INstrainAdj(i)= Exp(expN).Dexp(DexpN).MP(selIntNAdj(i,2)).strain{1}(selIntNAdj(i,3));
INspecificsAdj(i)=Exp(expN).Dexp(DexpN).MP(selIntNAdj(i,2)).specifics{1}(selIntNAdj(i,3));
INorfRepAdj(i)=Exp(expN).Dexp(DexpN).MP(selIntNAdj(i,2)).orfRep{1}(selIntNAdj(i,3));
%Bad this is the L data for only the last selected DM perturbation
%Would need to calculate each scan# for each DMsel value
inLAdj(i)= Exp(expN).Dexp(DexpN).scan(selIntNAdj(i,1)).plate(1).CFout(selIntNAdj(i,3),5);
inLlowerAdj(i)= Exp(expN).Dexp(DexpN).scan(selIntNAdj(i,1)).plate(1).CFout(selIntNAdj(i,3),11);
inLupperAdj(i)= Exp(expN).Dexp(DexpN).scan(selIntNAdj(i,1)).plate(1).CFout(selIntNAdj(i,3),12);
%*************************************************************************************
end
end
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%Plot Histogram******************************************************
%subplotX=1;
figure
RFstds=', ';
for j=1:dmN,
RFstds=strcat(RFstds,'Rs',num2str(j),'_',num2str(Rs(j)));
if j~=dmN, strcat(RFstds,', ');end
end
histName= strcat('ExpZone ',num2str(expN),'-',Exp(expN).Dexp(DexpN).ExpFoldr,', Interaction Values ', ...
', LfFilter-',num2str(negPercent),', RtFilter-',num2str(posPercent),', RemoveNoGrowth-',char(removInfinL), ...
RFstds)
histAdjName= strcat('ExpZone ',num2str(expN),'-',Exp(expN).Dexp(DexpN).ExpFoldr,', Interaction Compensated by Reference Standard Deviation @',num2str(percentRs),'%', '& Upper/Lower Curvefit Boundaries', ...
', LfFilter-',num2str(negPercent),', RtFilter-',num2str(posPercent),', RemoveNoGrowth-',char(removInfinL), ...
RFstds)
if strcmpi(subplotX,'Y')
for j=1:dmN
histLdata= intLwoRFsorted{j}(:,1); %intLcmp(385:(mpN-1)*384,j);
%histLadjData= intLadjcmp(385:(mpN-1)*384,j);
hgLdat{j}=histfitJR(histLdata,numBins,'kernel');
x{j}= get(hgLdat{j}(2),'xdata');
y{j}= get(hgLdat{j}(2),'ydata');
xb{j}=get(hgLdat{j}(1),'xdata');
yb{j}=get(hgLdat{j}(1),'ydata');
ybpostot{j}=sum(yb{j}(2,(xb{j}(1,:)>=0)));
ybnegtot{j}=sum(yb{j}(2,(xb{j}(1,:) <0)));
xbb(j,:)=xb{j}(2,:);
ybb(j,:)=yb{j}(2,:);
clf
end
% figure
if strcmpi(removInfinL,'N')
histLadjData= intLwoRFsortedAdj{j}(:,1); %intLadjcmp(385:(mpN-1)*384,j);
else
intLwoRFsortedAdj4HisW0{j}= sortrows(intLadjwoRFs100{j}',1); %Data including with 0's indeterminate within STD
histLadjData= intLwoRFsortedAdj4HisW0{j}(:,1)
end
for j=1:dmN
histLdata= intLwoRFsorted{j}(:,1); %intLcmp(385:(mpN-1)*384,j);
hgL{j}=subplot(2, 4, j), histfitJR(histLdata,numBins,'kernel') ; hold %hgL{j}=histfit(intLcmp(:,j),31,'kernel')
subplot(2, 4, j),plot(posIntboundryCentralVal(j), 1:3000,'--r')
subplot(2, 4, j),plot(negIntboundryCentralVal(j), 1:3000,'--g')
hold off
end
scnsize=get(0,'screensize')
pos1= [round(scnsize(3)/40), round(scnsize(4)/2 +(scnsize(3)/80)),...
round(scnsize(3) -round(scnsize(3)/80)),round(scnsize(4)/2 -round(scnsize(4)/80))]
set(gcf,'outerposition',pos1)
set(gcf,'Name', histName);
figure
for j=1:dmN
if strcmpi(removInfinL,'N')
histLadjData= intLwoRFsortedAdj{j}(:,1); %intLadjcmp(385:(mpN-1)*384,j);
else
intLwoRFsortedAdj4HisW0{j}= sortrows(intLadjwoRFs100{j}',1); %Data including with 0's indeterminate within STD
histLadjData= intLwoRFsortedAdj4HisW0{j}(:,1)
end
hgLadj{j}=subplot(2, 4, j),histfitJR(histLadjData,numBins,'kernel') ; hold %hgLadj{j}=histfit(intLadjcmp(:,j),31,'kernel')
subplot(2, 4, j),plot(posIntboundryCentralValAdj(j), 1:3000,'--r')
subplot(2, 4, j),plot(negIntboundryCentralValAdj(j), 1:3000,'--g')
hold off
end
pos2= [round(scnsize(3)/40), round(scnsize(4)/30),...
round(scnsize(3) -scnsize(3)/80),round(scnsize(4)/2 -scnsize(4)/80)]
set(gcf,'outerposition',pos2)
set(gcf,'Name', histAdjName)
%set(gcf,'Name', 'Interaction Compensated by Standard Deviation and Upper/Lower Curvefit boundaries')
elseif strcmpi(subplotX,'N')
for j=1:dmN
histLdata= intLwoRFsorted{j}(:,1); %intLcmp(385:(mpN-1)*384,j);
%intLwoRFsortedAdj4HisW0{j}= sortrows(intLadjwoRFs100{j}',1); %Data including with 0's indeterminate within STD
%histLadjData= intLwoRFsortedAdj4HisW0{j}(:,1);
%histLadjData= intLwoRFsortedAdj{j}(:,1); %intLadjcmp(385:(mpN-1)*384,j);%intLadjcmp(385:(mpN-1)*384,j); %intLcmp(:,j); %intLadjcmp(:,j);
if strcmpi(removInfinL,'N')
histLadjData= intLwoRFsortedAdj{j}(:,1); %intLadjcmp(385:(mpN-1)*384,j);
else
intLwoRFsortedAdj4HisW0{j}= sortrows(intLadjwoRFs100{j}',1); %Data including with 0's indeterminate within STD
histLadjData= intLwoRFsortedAdj4HisW0{j}(:,1)
end
figure
hgL{j}=histfitJR(histLdata,numBins,'kernel') ; hold %hgL{j}=histfit(intLcmp(:,j),31,'kernel')
plot(posIntboundryCentralVal(j), 1:3000,'--r')
plot(negIntboundryCentralVal(j), 1:3000,'--g')
set(gcf,'Name', strcat('DM-',num2str(j),'-',histName));
hold off
figure
hgLadj{j}=histfitJR(histLadjData,numBins,'kernel') ; hold %hgLadj{j}=histfit(intLadjcmp(:,j),31,'kernel')
plot(posIntboundryCentralValAdj(j), 1:3000,'--r')
plot(negIntboundryCentralValAdj(j), 1:3000,'--g')
set(gcf,'Name', strcat('DM-',num2str(j),'-',histAdjName));
hold off
x{j}= get(hgL{j}(2),'xdata')
y{j}= get(hgL{j}(2),'ydata');
xb{j}=get(hgL{j}(1),'xdata')
yb{j}=get(hgL{j}(1),'ydata')
ybpostot{j}=sum(yb{j}(2,(xb{j}(1,:)>=0)))
ybnegtot{j}=sum(yb{j}(2,(xb{j}(1,:) <0)))
xbb(j,:)=xb{j}(2,:);
ybb(j,:)=yb{j}(2,:);
end % for j= when subplotX~=1 standard one plot per figure
end %if subplotX==1 histograms placed in subplot figure else multiple histogram plots
if strcmpi(subplotX,'Y')
%{
figure
bar3(ybb);
set(gcf,'Name', 'Unfiltered Interaction Histogram for all DrugMedias; NoGrowth Interactors set to 100hr (highest bin)')
%}
%xxbb=yb{1}(2,:);
%figure
end
EZintPrint
a=1

View File

@@ -0,0 +1,697 @@
%single gene L based interaction shift display
%function EZinteractDev5
global Exp
DexpLen= Exp(expN).DexpLength;
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 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 sum(ismember(fieldnames(Exp(expN).Dexp(DexpN)),'RFmean'))&&...
~isempty(Exp(expN).Dexp(DexpN).RFmean)&&...
sum(ismember(fieldnames(Exp(expN).Dexp(DexpN)),'RFmeanG'))&&...
isempty(Exp(expN).Dexp(DexpN).RFmeanG)
RFconfig=1;
end
if sum(ismember(fieldnames(Exp(expN).Dexp(DexpN)),'RFmean'))==0 ||...
isempty(Exp(expN).Dexp(DexpN).RFmean)&&...
sum(ismember(fieldnames(Exp(expN).Dexp(DexpN)),'RFmeanG'))&&...
~isempty(Exp(expN).Dexp(DexpN).RFmeanG)
RFconfig=2;
end
if sum(ismember(fieldnames(Exp(expN).Dexp(DexpN)),'RFmean'))&&...
~isempty(Exp(expN).Dexp(DexpN).RFmean)&&...
sum(ismember(fieldnames(Exp(expN).Dexp(DexpN)),'RFmeanG'))&&...
~isempty(Exp(expN).Dexp(DexpN).RFmeanG)
RFconfig=3;
end
if (sum(ismember(fieldnames(Exp(expN).Dexp(DexpN)),'RFmean'))==0 ||...
isempty(Exp(expN).Dexp(DexpN).RFmean))&&...
(sum(ismember(fieldnames(Exp(expN).Dexp(DexpN)),'RFmeanG'))==0||...
isempty(Exp(expN).Dexp(DexpN).RFmeanG))
return
end
%RFconfig= 2; %1= FullPlateOnly; 2= DistributedOnly; 3= Both FullPlate && Distributed
if RFconfig==1,
defaultanswer={'80','60','100','3,4,5','N','39','Y'};
end
if RFconfig==2,
QctrlRF= 'Select Distributed Control RF option: (G)Global, (L)Local';
QpertRF= 'Select Distributed Perturbation RF option: (G)Global, (L)Local';
defaultanswer={'80','60','100','3,4,5','N','39','Y','G','L'};
end
if RFconfig==3,
QctrlRF= 'Select Control RF option: (F)FullPlate, (G)GlobalDistributed, (L)LocalDistributed';
QpertRF= 'Select Perturbation RF option: (F)FullPlate, (G)GlobalDistributed, (L)LocalDistributed';
defaultanswer={'80','60','100','3,4,5','N','39','Y','F','L'};
end
%User Input decode for application ***************************
if RFconfig==1,
prompt={'Enter LeftSide Central Boundary in Percent:',...
'Enter RightSide Central Boundary in Percent:', ...
'Enter percent of Reference Standard Deviation to use', ...
'Enter Day Sequence Numbers for set intersect:' ...
'Remove No Growth Infinite Interactors:' ...
'Number of Bins for Histograms'...
'Subplots(Y), Multiple Plots(N), Suspend Plots(S)'};
else
prompt={'Enter LeftSide Central Boundary in Percent:',...
'Enter RightSide Central Boundary in Percent:', ...
'Enter percent of Reference Standard Deviation to use', ...
'Enter Day Sequence Numbers for set intersect:' ...
'Remove No Growth Infinite Interactors:' ...
'Number of Bins for Histograms'...
'Subplots(Y), Multiple Plots(N), Suspend Plots(S)',...
QctrlRF,...
QpertRF,...
};
end
name='Interaction User Input';
numlines=1;
%defaultanswer={'80','60','100','3,4,5','N','39','Y','0,',''};
answer=inputdlg(prompt,name,numlines,defaultanswer);
negPercent= str2double(cell2mat(answer(1)));
posPercent= str2double(cell2mat(answer(2)));
percentRs= str2double(cell2mat(answer(3)));
DMstr= cell2mat(answer(4));
DMcomas=strfind((cell2mat(answer(4))),',');
removInfinL= answer(5);
numBins= str2double(cell2mat(answer(6)));
subplotX= answer(7);
n=0;
for i= DMcomas,
n=n+1
DMsel(n)= str2double(DMstr(i-1:i))
if i== max(DMcomas)
DMsel(n+1)= str2double(DMstr(i:end));
end
end
if strcmp(Exp(expN).DexpType,'chrono'), daysSel= DMsel; end
%**************************************************************
dmN= length(Exp(expN).Dexp(DexpN).DM.drug);
mpN= length(Exp(expN).Dexp(DexpN).MP);
%Intc1=3; IntcLst=5;
%Calculate Interaction values (with and without
%standardDeviation/Upper-Lower boundary compensation
%{
if strcmp(Exp(expN).DexpType, 'single') || strcmp(Exp(expN).DexpType, 'multi')
DMs2use= DMsel;
Dexps2use= DexpN;
elseif strcmp(Exp(expN).DexpType, 'chrono')
DMs2use= pertSel;
nn= daysSel;
end
%}
for j= 1:1:DexpLen
%nn= daysSel(j);
for m=1:mpN
scnN= pertSel + (dmN*(m-1))
%****************
DM0= pertSel; %the DrugMedia choice is constant based on left screeen choice
DMj= pertSel; %j here is the Day experiment number Which
DexpN= j; %Day experiment is also where to find data%nn;
anN= [8 9];
%****************
EZintRFs %* Call subroutine to interpret user RF inputs
%****************
DexpN= Exp(expN).DexpN; %reestablish DexpN
%****************
Xn{m,j,:}=Exp(expN).Dexp(j).scan(scnN).plate(1).CFout(:,5); %Exp(expN).Dexp(nn).scan(DM{j}(m)).plate(1).CFout(:,5);
Xn{m,j,:}(Xn{m,j,:}==0)= 140;
Xln{m,j,:}=Exp(expN).Dexp(j).scan(scnN).plate(1).CFout(:,11); %Exp(expN).Dexp(nn).scan(DM{j}(m)).plate(1).CFout(:,11);
Xhn{m,j,:}=Exp(expN).Dexp(j).scan(scnN).plate(1).CFout(:,12); %Exp(expN).Dexp(nn).scan(DM{j}(m)).plate(1).CFout(:,12);
%methCalc=1;
intL{m,j,:} = ((Xn{m,j,:} - Xn{m,1,:}) - (Rn(j)-Rn(1)));
intL{m,j,:}(Xn{m,j,:}==140)= 100;
intL{m,j,:}(intL{m,j,:}==0)=-0.1;
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.2; end
if deltaRn(j)==0, deltaRn(j)=0.2; end
deltaYp= zeros(1,384); deltaYn= zeros(1,384);
deltaXRp= zeros(1,384); deltaXRn= zeros(1,384);
deltaXR{m,j}= zeros(1,384);
for i=1:384
%Select lower or upper boundary value based on Yn(1)
if Xn{m,j}(i) >= (Rn(j)+RsReduced(j));
deltaYp(i)= Xln{m,j}(i)-Xln{m,1}(i);
elseif Xn{m,j}(i) < (Rn(j)-RsReduced(j));
deltaYn(i)= Xhn{m,j}(i)-Xhn{m,1}(i);
% Insert else
end
%Calculate deltaXRp and deltaXRn for each plate based on growth relative to deltaRp or deltaRn
if deltaYp(i)>= deltaRp(j)
deltaXRp(i)= deltaYp(i)-deltaRp(j);
deltaXR{m,j}(i)= deltaXRp(i); %Consoludate into deltaXR{m,j}(i) cell array
elseif deltaYn(i) < deltaRn(j)
deltaXRn(i)= deltaYn(i)-deltaRn(j);
deltaXR{m,j}(i)= deltaXRn(i); %Consoludate into deltaXR{m,j}(i) cell array
if deltaYn(i)==0, deltaXR{m,j}(i)=0; end
end
%Ambiguous results that have delta gene values that are less than the variance of Reference+/-std
end %for i=1:384
%**************************************************************************
%end %if methCalc==0
deltaXR{m,j,:}(Xn{m,j,:}==140)= 100;
deltaXR{m,j,:}(Xln{m,j,:}==0)= 100;
deltaXR{m,j,:}(isnan(Xln{m,j,:}))= 120;
deltaXR{m,j,:}(Xhn{m,j,:}==0)= 100;
deltaXR{m,j,:}(isnan(Xhn{m,j,:}))= 120;
%Compile all gene related L values for the each Dexp sequencially(j).
addend= (1+((m-1)*384)) %((((m-1)*j)*384)+1);
intLcmp(addend:addend+383,j)= cell2mat(intL(m,j,:)); %For only pertSel across Dexps (((addend:addend+383),j)= cell2mat(intL(j,m,:));
intLadjcmp(addend:addend+383,j)= cell2mat(deltaXR(m,j,:)); %((addend:addend+383),j)= cell2mat(deltaXR(j,m,:));
end %m=1:mpN
%********END m loop assoc'd with MPs for loop***************
%***********************************************************
%Remove RFs and Blank (or non annotated ' ') orf data Then
%Filter data per user intput
intLc{j}= intLcmp(:,j); %j);
intLwoRFs{j}(1,:)= intLcmp(Exp(expN).Dexp(j).mutSpotIndx.woRFs,j);
intLwoRFs{j}(2,:)= Exp(expN).Dexp(j).mutSpotIndx.woRFs;%Index of non-RF non-blank spots
if strcmpi(removInfinL,'Y')
intLwoRFs0{j}(1,:)= intLwoRFs{j}(1,(intLwoRFs{j}(1,:)~= 100)); %Values intLcmp(Exp(1).mutSpotIndx.woRFs,j);
intLwoRFs0{j}(2,:)= intLwoRFs{j}(2,(intLwoRFs{j}(1,:)~= 100)); %MP Spot Index position intLcmp(385:(mpN-1)*384,j);
clear intLwoRFs
intLwoRFs{j}(1,:)= intLwoRFs0{j}(1,:);
intLwoRFs{j}(2,:)= intLwoRFs0{j}(2,:);
end
intLwoRFsorted{j}= sortrows(intLwoRFs{j}',1); %SortBy Values field
clear intLcmpSortGT0 intLcmpSortLT0
tempIntL= intLwoRFsorted{j}(:,1);
intLcmpSortGT0= tempIntL((tempIntL) >0);
if ~isempty(intLcmpSortGT0)
centPosCnt= round(posPercent/100 * length(intLcmpSortGT0));
intLposSel{j}=intLwoRFsorted{j}((length(intLcmpSortGT0)+centPosCnt): end,:);
posIntboundryCentralVal(j)= intLcmpSortGT0((centPosCnt),:); %For Histogram use
else
posIntboundryCentralVal(j)= 0;
end
intLcmpSortLT0= tempIntL((tempIntL) <0);
if ~isempty(intLcmpSortLT0)
centNegCnt= round(negPercent/100 * length(intLcmpSortLT0));
intLnegSel{j}=intLwoRFsorted{j}((1:(length(intLcmpSortLT0)-centNegCnt)),:);
negIntboundryCentralVal(j)= intLcmpSortLT0(((length(intLcmpSortLT0))-(centNegCnt)),:); %For Histogram use
else
negIntboundryCentralVal(j)=0;
end
%Find potential Interactors within selected range
jj=j;
daysSel= daysSel;
%maxNperts= Exp(expN).DexpLength; %(daysSel); %(daysSel);
if jj== daysSel(1) %Intc1,
InterslstPos{1}= intLposSel{daysSel(1)}(:,2) %intLcmpposInd{Intc1}
InterslstNeg{1}= intLnegSel{daysSel(1)}(:,2) %intLcmpnegInd{Intc1}
elseif sum(ismember(daysSel,jj))==1 %Intc1 && jj<=IntcLst
InterslstPos{1}=(intersect(InterslstPos{1},intLposSel{jj}(:,2))); %,intLcmpposInd{jj}))
InterslstNeg{1}=(intersect(InterslstNeg{1},intLnegSel{jj}(:,2))); %,intLcmpnegInd{jj}))
end
%Convolute experiment spot index to get scan#, MP# and plateIndx needed
%later to obtain genename and other descriptors and correlate data
if sum(ismember(daysSel,jj))==1 %might need to? restrict to only the 'daysSel' entered by user
try
intLposDIndx{jj}(:,4)= jj; %Dexp number
intLposDIndx{jj}(:,2)= ceil((intLposSel{jj}(:,2))/(384)); %mp plate numb column
intLposDIndx{jj}(:,3)=rem(intLposSel{jj}(:,2),(384)); %384));
tmp= intLposDIndx{jj}(:,3)==0;
intLposDIndx{jj}(tmp,3)= 384;
intLposDIndx{jj}(:,1)= pertSel + (dmN*((intLposDIndx{jj}(:,2))-1)); %((intLposDIndx{jj}(:,2))-1)); %scan numb column %intLposDIndx(:,2)* intLposDIndx(:,3);
catch
end
try
intLnegDIndx{jj}(:,4)= j; %Dexp number
intLnegDIndx{jj}(:,2)= ceil((intLposSel{jj}(:,2))/(384)); %384); %mp plate numb column
intLnegDIndx{jj}(:,3)= rem(intLnegSel{jj}(:,2),(384));
tmp=(intLnegDIndx{jj}(:,3)==0);
intLnegDIndx{jj}(tmp,3)= 384;
intLnegDIndx{jj}(:,1)= pertSel + (dmN*((intLnegDIndx{jj}(:,2))-1)); %scan numb
catch
end
end %might want to restrict to only the 'daysSel' entered by user
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%********************************************************************************************
%ADJUSTED L for Reference Standard deviation(More conservative) Interaction List compilation
if strcmpi(removInfinL,'N')
intLadjwoRFs{jj}(1,:)=intLadjcmp(Exp(expN).Dexp(DexpN).mutSpotIndx.woRFs,jj);
intLadjwoRFs{jj}(2,:)= Exp(expN).Dexp(DexpN).mutSpotIndx.woRFs; %intLadjcmp(385:(mpN-1)*384,jj); %intLadjcmp(Exp(expN).Dexp(DexpN).mutSpotIndx.woRFs,jj);
elseif strcmpi(removInfinL,'Y')
intLadjwoRFs{jj}(1,:)=intLadjcmp(Exp(expN).Dexp(DexpN).mutSpotIndx.woRFs,jj);
intLadjwoRFs{jj}(2,:)= Exp(expN).Dexp(DexpN).mutSpotIndx.woRFs; %intLadjcmp(385:(mpN-1)*384,jj); %intLadjcmp(Exp(expN).Dexp(DexpN).mutSpotIndx.woRFs,jj);
intLadjwoRFs100{jj}(1,:)= intLadjwoRFs{jj}(1,(intLadjwoRFs{jj}(1,:)~= 100)) ; %intLcmp(Exp(1).mutSpotIndx.woRFs,jj);
intLadjwoRFs100{jj}(2,:)= intLadjwoRFs{jj}(2,(intLadjwoRFs{jj}(1,:)~= 100)) ; % Remove Index where spots are infinite (=100);
intLadjwoRFs0{jj}(1,:)= intLadjwoRFs100{jj}(1,(intLadjwoRFs100{jj}(1,:)~= 0)); % Remove Index where spots are indeterminely within the range of Ref STD
intLadjwoRFs0{jj}(2,:)= intLadjwoRFs100{jj}(2,(intLadjwoRFs100{jj}(1,:)~= 0)); % Remove Index where spots are indeterminely within the range of Ref STD
clear intLadjwoRFs
intLadjwoRFs{jj}(1,:)= intLadjwoRFs0{jj}(1,:); %Put filtered results back into intLadjwoRFs
intLadjwoRFs{jj}(2,:)= intLadjwoRFs0{jj}(2,:); %Put filtered results back into intLadjwoRFs
end
intLwoRFsortedAdj{jj}= sortrows(intLadjwoRFs{jj}',1);
clear intLadjSortGT0 intLadjSortLT0
tempIntLadj= intLwoRFsortedAdj{jj}(:,1);
intLadjSortLT0= tempIntLadj((tempIntLadj) <0);
intLadjSort0s= tempIntLadj(tempIntLadj ==0)
intLadjSortGT0= tempIntLadj(tempIntLadj >0); %=0);
if ~isempty(intLadjSortGT0)&& ~isempty(intLadjSortLT0)
centPosCntAdj= round(posPercent/100 * length(intLadjSortGT0));
intLposSelAdj{jj}=intLwoRFsortedAdj{jj}((length(intLadjSortLT0)+ length(intLadjSort0s) + centPosCntAdj): end,:);
posIntboundryCentralValAdj(jj)= intLadjSortGT0(centPosCntAdj,:);
else
posIntboundryCentralValAdj(jj)= 0;
end
if ~isempty(intLadjSortLT0)
try
centNegCntAdj= round(negPercent/100 * length(intLadjSortLT0));
intLnegSelAdj{jj}=intLwoRFsortedAdj{jj}((1:(length(intLadjSortLT0)-centNegCntAdj)),:);
negIntboundryCentralValAdj(jj)= intLadjSortLT0(((length(intLadjSortLT0))-(centNegCntAdj)),:);
catch,negIntboundryCentralValAdj(jj)= 1;
end
else
negIntboundryCentralValAdj(jj)= 1;
end
if jj== daysSel(1) %Intc1,
InterslstPosAdj{1}= intLposSelAdj{daysSel(1)}(:,2) %intLcmpposInd{Intc1}
InterslstNegAdj{1}= intLnegSelAdj{daysSel(1)}(:,2) %intLcmpnegInd{Intc1}
elseif sum(ismember(daysSel,jj))==1 % jj>Intc1 && jj<=IntcLst
InterslstPosAdj{1}=(intersect(InterslstPosAdj{1},intLposSelAdj{jj}(:,2))); %,intLcmpposInd{jj}))
InterslstNegAdj{1}=(intersect(InterslstNegAdj{1},intLnegSelAdj{jj}(:,2))); %,intLcmpnegInd{jj}))
end
%Convolute experiment spot index to get scan#, MP# and plateIndx needed
%later to obtain genename and other descriptors and correlate data
try
intLposDIndxAdj{jj}(:,2)= ceil((intLposSelAdj{jj}(:,2))/(384)); %mp plate numb column
intLposDIndxAdj{jj}(:,4)= jj;
intLposDIndxAdj{jj}(:,3)=(rem(intLposSelAdj{jj}(:,2),(384)));
tmp=(intLposDIndxAdj{jj}(:,3)==0);
intLposDIndx{jj}(tmp,3)= 384;
intLposDIndxAdj{jj}(:,1)= pertSel + (dmN*((intLposDIndxAdj{jj}(:,2))-1)); %scan numb column
catch
end
try
intLnegDIndxAdj{jj}(:,2)= m; %ceil((intLnegSelAdj{jj}(:,2))/384); %mp plate numb column
intLnegDIndxAdj{jj}(:,4)= jj;
intLnegDIndxAdj{jj}(:,3)=(rem(intLnegSelAdj{jj}(:,2),(384)));
tmp=(intLnegDIndxAdj{jj}(:,3)==0);
intLnegDIndxAdj{jj}(tmp,3)= 384;
intLnegDIndxAdj{jj}(:,1)= pertSel + (dmN*((intLnegDIndxAdj{jj}(:,2))-1)); %scan numb
catch
end
%end %for Perts2use jj= DMs2use
end % for j= 1:DexpLen
%****************************************************************************************
%******END OF Big Loop*******************************************************************
%****************************************************************************************
%get interaction values for each DM drugmedia agar type
IntersValsPos= intLcmp(InterslstPos{1},daysSel);
IntersValsNeg= intLcmp(InterslstNeg{1},daysSel);
IntersValsPosAdj= intLadjcmp(InterslstPosAdj{1},daysSel);
IntersValsNegAdj= intLadjcmp(InterslstNegAdj{1},daysSel);
%*********************************************************
%Build 'genelist' data sheet for interactors
if ~isempty(InterslstPos{1})
selIntPx{1}(:,6)=InterslstPos{1};
selIntPx{1}(:,2)=ceil((InterslstPos{1})/(384)); %mp plate numb column
selIntPx{1}(:,3)= rem(InterslstPos{1},(384));
tmpMovV1=(selIntPx{1}(:,3)==0);
selIntPx{1}(tmpMovV1,3)= 384;
selIntPx{1}(:,4)= ceil(selIntPx{1}(:,3)/24); %row numb
selIntPx{1}(:,5)= rem(selIntPx{1}(:,3),24);
tmp2=(selIntPx{1}(:,5)==0);
selIntPx{1}(tmp2,5)= 24;
selIntPx{1}(:,1)= pertSel + (dmN*((selIntPx{1}(:,2))-1)); %scan numb column %intLposDIndx(:,2)* intLposDIndx(:,3);
selIntP= cell2mat(selIntPx);
end
if ~isempty(InterslstNeg{1})
selIntNx{1}(:,6)=InterslstNeg{1};
selIntNx{1}(:,2)=ceil((InterslstNeg{1})/(384)); %mp plate numb column
selIntNx{1}(:,3)=(rem(InterslstNeg{1},(384)));
tmp1=(selIntNx{1}(:,3)==0);
selIntNx{1}(tmp1,3)= 384;
selIntNx{1}(:,4)= ceil(selIntNx{1}(:,3)/24); %row numb
selIntNx{1}(:,5)= rem(selIntNx{1}(:,3),24);
tmp2=(selIntNx{1}(:,5)==0);
selIntNx{1}(tmp2,5)= 24;
selIntNx{1}(:,1)= pertSel + (dmN*((selIntNx{1}(:,2))-1)); %jj + (maxNperts*((selIntNx{1}(:,2))-1)); %scan numb
selIntN= cell2mat(selIntNx);
end
if strcmp(Exp(expN).DexpType, 'single') || strcmp(Exp(expN).DexpType,'multi')
d1= DexpN;
elseif strcmp(Exp(expN).DexpType, 'chrono')
d1= daysSel(1); %Dexps2use(1);
end
if ~isempty(InterslstPos{1})
for i=1:size(selIntP,1)
IPgene(i)=Exp(expN).Dexp(d1).MP(selIntP(i,2)).genename{1}(selIntP(i,3));
IPorf(i)= Exp(expN).Dexp(d1).MP(selIntP(i,2)).orf{1}(selIntP(i,3));
IPstrain(i)= Exp(expN).Dexp(d1).MP(selIntP(i,2)).strain{1}(selIntP(i,3));
IPspecifics(i)=Exp(expN).Dexp(d1).MP(selIntP(i,2)).specifics{1}(selIntP(i,3));
IPorfRep(i)=Exp(expN).Dexp(d1).MP(selIntP(i,2)).orfRep{1}(selIntP(i,3));
%Bad this is the L data for only the last selected DM perturbation
%Would need to calculate each scan# for each perts2use value
ipL(i)= Exp(expN).Dexp(d1).scan(selIntP(i,1)).plate(1).CFout(selIntP(i,3),5);
ipLlower(i)= Exp(expN).Dexp(d1).scan(selIntP(i,1)).plate(1).CFout(selIntP(i,3),11);
ipLupper(i)= Exp(expN).Dexp(d1).scan(selIntP(i,1)).plate(1).CFout(selIntP(i,3),12);
%*************************************************************************
end
end
if ~isempty(InterslstNeg{1})
for i=1:size(selIntN,1)
i
INgene(i)=Exp(expN).Dexp(d1).MP(selIntN(i,2)).genename{1}(selIntN(i,3));
INorf(i)= Exp(expN).Dexp(d1).MP(selIntN(i,2)).orf{1}(selIntN(i,3));
INstrain(i)= Exp(expN).Dexp(d1).MP(selIntN(i,2)).strain{1}(selIntN(i,3));
INspecifics(i)=Exp(expN).Dexp(d1).MP(selIntN(i,2)).specifics{1}(selIntN(i,3));
INorfRep(i)=Exp(expN).Dexp(d1).MP(selIntN(i,2)).orfRep{1}(selIntN(i,3));
%Bad this is the L data for only the last selected DM perturbation
%Would need to calculate each scan# for each perts2use value
inL(i)= Exp(expN).Dexp(d1).scan(selIntN(i,1)).plate(1).CFout(selIntN(i,3),5);
inLlower(i)= Exp(expN).Dexp(d1).scan(selIntN(i,1)).plate(1).CFout(selIntN(i,3),11);
inLupper(i)= Exp(expN).Dexp(d1).scan(selIntN(i,1)).plate(1).CFout(selIntN(i,3),12);
%*************************************************************************
end
end
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%**************************************************************************************
%ADJUSTED with STD and curve fit boundaries to produce more conservative interaction values
%Build 'genelist' data sheet for interactors
selIntPxAdj{1}(:,2)=ceil((InterslstPosAdj{1})/(384)); %mp plate numb column
selIntPxAdj{1}(:,3)=(rem(InterslstPosAdj{1},(384)));
tmpMovV1=(selIntPxAdj{1}(:,3)==0);
selIntPxAdj{1}(tmpMovV1,3)= 384;
selIntPxAdj{1}(:,4)= ceil(selIntPxAdj{1}(:,3)/24); %row numb
selIntPxAdj{1}(:,5)= rem(selIntPxAdj{1}(:,3),24);
tmpMovV2=(selIntPxAdj{1}(:,5)==0);
selIntPxAdj{1}(tmpMovV2,5)= 24;
selIntPxAdj{1}(:,1)= pertSel + (dmN*((selIntPxAdj{1}(:,2))-1)); %scan numb column %intLposDIndx(:,2)* intLposDIndx(:,3);
selIntPAdj= cell2mat(selIntPxAdj);
if ~isempty(InterslstNegAdj{1})
selIntNxAdj{1}(:,2)=ceil((InterslstNegAdj{1})/(384)); %mp plate numb column
selIntNxAdj{1}(:,3)= rem(InterslstNegAdj{1},(384));
tmpMovV1=(selIntNxAdj{1}(:,3)==0);
selIntNxAdj{1}(tmpMovV1,3)= 384;
selIntNxAdj{1}(:,4)= ceil(selIntNxAdj{1}(:,3)/24); %row numb
selIntNxAdj{1}(:,5)= rem(selIntNxAdj{1}(:,3),24);
tmpMovV2=(selIntNxAdj{1}(:,5)==0);
selIntNxAdj{1}(tmpMovV2,5)= 24;
selIntNxAdj{1}(:,1)= pertSel + (dmN*((selIntNxAdj{1}(:,2))-1)); %scan numb
selIntNAdj= cell2mat(selIntNxAdj);
end
for i=1:size(selIntPAdj,1)
IPgeneAdj(i)=Exp(expN).Dexp(d1).MP(selIntPAdj(i,2)).genename{1}(selIntPAdj(i,3));
IPorfAdj(i)= Exp(expN).Dexp(d1).MP(selIntPAdj(i,2)).orf{1}(selIntPAdj(i,3));
IPstrainAdj(i)= Exp(expN).Dexp(d1).MP(selIntPAdj(i,2)).strain{1}(selIntPAdj(i,3));
IPspecificsAdj(i)=Exp(expN).Dexp(d1).MP(selIntPAdj(i,2)).specifics{1}(selIntPAdj(i,3));
IPorfRepAdj(i)=Exp(expN).Dexp(d1).MP(selIntPAdj(i,2)).orfRep{1}(selIntPAdj(i,3));
%Bad this is the L data for only the last selected DM perturbation
%Would need to calculate each scan# for each perts2use value
ipLAdj(i)= Exp(expN).Dexp(d1).scan(selIntPAdj(i,1)).plate(1).CFout(selIntPAdj(i,3),5);
ipLlowerAdj(i)= Exp(expN).Dexp(d1).scan(selIntPAdj(i,1)).plate(1).CFout(selIntPAdj(i,3),11);
ipLupperAdj(i)= Exp(expN).Dexp(d1).scan(selIntPAdj(i,1)).plate(1).CFout(selIntPAdj(i,3),12);
%************************************************************************************
end
if ~isempty(InterslstNegAdj{1})
for i=1:size(selIntNAdj,1)
INgeneAdj(i)=Exp(expN).Dexp(d1).MP(selIntNAdj(i,2)).genename{1}(selIntNAdj(i,3));
INorfAdj(i)= Exp(expN).Dexp(d1).MP(selIntNAdj(i,2)).orf{1}(selIntNAdj(i,3));
INstrainAdj(i)= Exp(expN).Dexp(d1).MP(selIntNAdj(i,2)).strain{1}(selIntNAdj(i,3));
INspecificsAdj(i)=Exp(expN).Dexp(d1).MP(selIntNAdj(i,2)).specifics{1}(selIntNAdj(i,3));
INorfRepAdj(i)=Exp(expN).Dexp(d1).MP(selIntNAdj(i,2)).orfRep{1}(selIntNAdj(i,3));
%Bad this is the L data for only the last selected DM perturbation
%Would need to calculate each scan# for each perts2use value
inLAdj(i)= Exp(expN).Dexp(d1).scan(selIntNAdj(i,1)).plate(1).CFout(selIntNAdj(i,3),5);
inLlowerAdj(i)= Exp(expN).Dexp(d1).scan(selIntNAdj(i,1)).plate(1).CFout(selIntNAdj(i,3),11);
inLupperAdj(i)= Exp(expN).Dexp(d1).scan(selIntNAdj(i,1)).plate(1).CFout(selIntNAdj(i,3),12);
%*************************************************************************************
end
end
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%Plot Histogram******************************************************
%subplotX=1;
figure
RFstds=', ';
for jj=1:DexpLen,
RFstds=strcat(RFstds,'Rs',num2str(jj),'_',num2str(Rs(jj)));
if jj~=DexpLen, strcat(RFstds,', ');end
end
histName= strcat('ExpZone ',num2str(expN),'-',Exp(expN).Dexp(DexpN).ExpFoldr,', Interaction Values ', ...
', LfFilter-',num2str(negPercent),', RtFilter-',num2str(posPercent),', RemoveNoGrowth-',char(removInfinL), ...
RFstds)
histAdjName= strcat('ExpZone ',num2str(expN),'-',Exp(expN).Dexp(DexpN).ExpFoldr,', Interaction Compensated by Reference Standard Deviation @',num2str(percentRs),'%', '& Upper/Lower Curvefit Boundaries', ...
', LfFilter-',num2str(negPercent),', RtFilter-',num2str(posPercent),', RemoveNoGrowth-',char(removInfinL), ...
RFstds)
if strcmpi(subplotX,'Y')
for jj=1:DexpLen
histLdata= intLwoRFsorted{jj}(:,1); %intLcmp(385:(mpN-1)*384,jj);
%histLadjData= intLadjcmp(385:(mpN-1)*384,jj);
hgLdat{jj}=histfitJR(histLdata,numBins,'kernel');
x{jj}= get(hgLdat{jj}(2),'xdata');
y{jj}= get(hgLdat{jj}(2),'ydata');
xb{jj}=get(hgLdat{jj}(1),'xdata');
yb{jj}=get(hgLdat{jj}(1),'ydata');
ybpostot{jj}=sum(yb{jj}(2,(xb{jj}(1,:)>=0)));
ybnegtot{jj}=sum(yb{jj}(2,(xb{jj}(1,:) <0)));
xbb(jj,:)=xb{jj}(2,:);
ybb(jj,:)=yb{jj}(2,:);
clf
end
% figure
if strcmpi(removInfinL,'N')
histLadjData= intLwoRFsortedAdj{jj}(:,1); %intLadjcmp(385:(mpN-1)*384,jj);
else
intLwoRFsortedAdj4HisW0{jj}= sortrows(intLadjwoRFs100{jj}',1); %Data including with 0's indeterminate within STD
histLadjData= intLwoRFsortedAdj4HisW0{jj}(:,1)
end
for jj=1:DexpLen
histLdata= intLwoRFsorted{jj}(:,1); %intLcmp(385:(mpN-1)*384,jj);
hgL{jj}=subplot(2, 4, jj), histfitJR(histLdata,numBins,'kernel') ; hold %hgL{jj}=histfit(intLcmp(:,jj),31,'kernel')
subplot(2, 4, jj),plot(posIntboundryCentralVal(jj), 1:3000,'--r')
subplot(2, 4, jj),plot(negIntboundryCentralVal(jj), 1:3000,'--g')
hold off
end
scnsize=get(0,'screensize')
pos1= [round(scnsize(3)/40), round(scnsize(4)/2 +(scnsize(3)/80)),...
round(scnsize(3) -round(scnsize(3)/80)),round(scnsize(4)/2 -round(scnsize(4)/80))]
set(gcf,'outerposition',pos1)
set(gcf,'Name', histName);
figure
for jj=1:DexpLen
if strcmpi(removInfinL,'N')
histLadjData= intLwoRFsortedAdj{jj}(:,1); %intLadjcmp(385:(mpN-1)*384,jj);
else
intLwoRFsortedAdj4HisW0{jj}= sortrows(intLadjwoRFs100{jj}',1); %Data including with 0's indeterminate within STD
histLadjData= intLwoRFsortedAdj4HisW0{jj}(:,1)
end
hgLadj{jj}=subplot(2, 4, jj),histfitJR(histLadjData,numBins,'kernel') ; hold %hgLadj{jj}=histfit(intLadjcmp(:,jj),31,'kernel')
subplot(2, 4, jj),plot(posIntboundryCentralValAdj(jj), 1:3000,'--r')
subplot(2, 4, jj),plot(negIntboundryCentralValAdj(jj), 1:3000,'--g')
hold off
end
pos2= [round(scnsize(3)/40), round(scnsize(4)/30),...
round(scnsize(3) -scnsize(3)/80),round(scnsize(4)/2 -scnsize(4)/80)]
set(gcf,'outerposition',pos2)
set(gcf,'Name', histAdjName)
%set(gcf,'Name', 'Interaction Compensated by Standard Deviation and Upper/Lower Curvefit boundaries')
elseif strcmpi(subplotX,'N')
for jj=1:DexpLen
histLdata= intLwoRFsorted{jj}(:,1); %intLcmp(385:(mpN-1)*384,jj);
%intLwoRFsortedAdj4HisW0{jj}= sortrows(intLadjwoRFs100{jj}',1); %Data including with 0's indeterminate within STD
%histLadjData= intLwoRFsortedAdj4HisW0{jj}(:,1);
%histLadjData= intLwoRFsortedAdj{jj}(:,1); %intLadjcmp(385:(mpN-1)*384,jj);%intLadjcmp(385:(mpN-1)*384,jj); %intLcmp(:,jj); %intLadjcmp(:,jj);
if strcmpi(removInfinL,'N')
histLadjData= intLwoRFsortedAdj{jj}(:,1); %intLadjcmp(385:(mpN-1)*384,jj);
else
intLwoRFsortedAdj4HisW0{jj}= sortrows(intLadjwoRFs100{jj}',1); %Data including with 0's indeterminate within STD
histLadjData= intLwoRFsortedAdj4HisW0{jj}(:,1)
end
figure
hgL{jj}=histfitJR(histLdata,numBins,'kernel') ; hold %hgL{jj}=histfit(intLcmp(:,jj),31,'kernel')
plot(posIntboundryCentralVal(jj), 1:3000,'--r')
plot(negIntboundryCentralVal(jj), 1:3000,'--g')
set(gcf,'Name', strcat('DM-',num2str(jj),'-',histName));
hold off
figure
hgLadj{jj}=histfitJR(histLadjData,numBins,'kernel') ; hold %hgLadj{jj}=histfit(intLadjcmp(:,jj),31,'kernel')
plot(posIntboundryCentralValAdj(jj), 1:3000,'--r')
plot(negIntboundryCentralValAdj(jj), 1:3000,'--g')
set(gcf,'Name', strcat('DM-',num2str(jj),'-',histAdjName));
hold off
x{jj}= get(hgL{jj}(2),'xdata')
y{jj}= get(hgL{jj}(2),'ydata');
xb{jj}=get(hgL{jj}(1),'xdata')
yb{jj}=get(hgL{jj}(1),'ydata')
ybpostot{jj}=sum(yb{jj}(2,(xb{jj}(1,:)>=0)))
ybnegtot{jj}=sum(yb{jj}(2,(xb{jj}(1,:) <0)))
xbb(jj,:)=xb{jj}(2,:);
ybb(jj,:)=yb{jj}(2,:);
end % for jj= when subplotX~=1 standard one plot per figure
end %if subplotX==1 histograms placed in subplot figure else multiple histogram plots
if strcmpi(subplotX,'Y')
%{
figure
bar3(ybb);
set(gcf,'Name', 'Unfiltered Interaction Histogram for all DrugMedias; NoGrowth Interactors set to 100hr (highest bin)')
%}
%xxbb=yb{1}(2,:);
%figure
end
EZintPrint
a=1
%{
if methCalc==0
deltaXR{m,j}= zeros(1,384);
deltaXR{m,j}(Xn{m,j} >=(Rn(j)+Rs(j)))= ( Xln{m,j}(Xn{m,j} >=(Rn(j)+Rs(j))))- (Rn(j)+Rs(j));
deltaXR{m,j}(Xn{m,j} < (Rn(j)-Rs(j)))= ( Xhn{m,j}(Xn{m,j} < (Rn(j)-Rs(j))))- (Rn(j)-Rs(j));
Xneg= Xhn{m,j}- (Rn(j)-Rs(j));
Xpos= Xln{m,j}- (Rn(j)+Rs(j));
for i=1:length(Xpos(:)),
%deltaXR{m,j}(i)= Xpos(i);
if deltaXR{m,j}(i)==0
try
if abs(Xpos(i))<abs(Xneg(i)), deltaXR{m,j}(i)= Xpos(i);end
catch, end
end
end
for i=1:length(Xneg(:)),
if deltaXR{m,j}(i)==0, deltaXR{m,j}(i)= Xneg(i); end
try
if abs(Xpos(i))>abs(Xneg(i)), deltaXR{m,j}(i)= Xneg(i); end
catch
end
end
%else else else else
else %if methCalc~=0
%percentRs= 100;
RsReduced(j)= percentRs/100* Rs(j)
%{
Yn{m,j}= Xn{m,j}-Xn{m,1}; %Yn is deltaXn
Yn{m,j}(Yn{m,j}==0)=-0.5;
Yln{m,j}= Xln{m,j}-Xln{m,1};
Yln{m,j}(Yln{m,j}==0)=-0.5;
Yhn{m,j}= Xhn{m,j}-Xhn{m,1};
Yhn{m,j}(Yhn{m,j}==0)=-0.5;
%}
%deltaRp(j)= (Rn(j)+RsReduced(j))-Rn(1); %
deltaRp(j)= (Rn(j)+RsReduced(j))-(Rn(1)+RsReduced(1));
%deltaRn(j)= (Rn(j)-RsReduced(j))-Rn(1); %
deltaRn(j)=(Rn(j)-RsReduced(j))-(Rn(1)-RsReduced(1));
if deltaRp(j)==0, deltaRp(j)=0.2; end
if deltaRn(j)==0, deltaRn(j)=0.2; end
deltaYp= zeros(1,384); deltaYn= zeros(1,384);
deltaXRp= zeros(1,384); deltaXRn= zeros(1,384);
deltaXR{m,j}= zeros(1,384);
for i=1:384
%Select lower or upper boundary value based on Yn(1)
if Xn{m,j}(i) >= (Rn(j)+RsReduced(j));
deltaYp(i)= Xln{m,j}(i)-Xln{m,1}(i);
elseif Xn{m,j}(i) < (Rn(j)-RsReduced(j));
deltaYn(i)= Xhn{m,j}(i)-Xhn{m,1}(i);
% Insert else
end
%Calculate deltaXRp and deltaXRn for each plate based on growth relative to deltaRp or deltaRn
if deltaYp(i)>= deltaRp(j)
deltaXRp(i)= deltaYp(i)-deltaRp(j);
deltaXR{m,j}(i)= deltaXRp(i); %Consoludate into deltaXR{m,j}(i) cell array
elseif deltaYn(i) < deltaRn(j)
deltaXRn(i)= deltaYn(i)-deltaRn(j);
deltaXR{m,j}(i)= deltaXRn(i); %Consoludate into deltaXR{m,j}(i) cell array
if deltaYn(i)==0, deltaXR{m,j}(i)=0; end
end
%Ambiguous results that have delta gene values that are less than the variance of Reference+/-std
end %for i=1:384
%**************************************************************************
end %if methCalc==0
%}

View File

@@ -0,0 +1,590 @@
%EZvDatatip
%Calls to EZdestComp.m EZmDayTrend.m
global ghandles
global Exp
RFcmpGFlg=0; %Test 180105 as it goes to EZmDayTrend.m
lstBoxCmpFlg=0;
%datacursormode(gcf)
%{
[output_txt]=datatipp(obj,event_obj);
clkPos=getCursorInfo(datacursormode(gcf));
cpos=clkPos.Position;
htargetAxes= clkPos.Target;
%}
%pause(1)
curKey=get(gcf,'currentkey')
htMapFg=0;
if ghandles.Iaxes1==get(htargetAxes,'Parent'),expN=1;
elseif ghandles.Iaxes2==get(htargetAxes,'Parent'),expN=2;
elseif ghandles.Iaxes3==get(htargetAxes,'Parent'),expN=3;
elseif ghandles.OLaxes1==get(htargetAxes,'Parent'),OLay=1; expN=1; %zone=1; datacursormode off;
elseif ghandles.OLaxes2==get(htargetAxes,'Parent'),OLay=2; expN=2; %zone=2; datacursormode off;
elseif ghandles.OLaxes3==get(htargetAxes,'Parent'),OLay=3; expN=3; %zone=3; datacursormode off;
elseif ghandles.HtMap1==get(htargetAxes,'Parent'),expN=1; htMapFg=1;
elseif ghandles.HtMap2==get(htargetAxes,'Parent'),expN=2; htMapFg=1;
elseif ghandles.HtMap3==get(htargetAxes,'Parent'),expN=3; htMapFg=1;
else
return
end
if expN==1,DexpN= (get(ghandles.DN1,'value')); end
if expN==2,DexpN= (get(ghandles.DN2,'value')); end
if expN==3,DexpN= (get(ghandles.DN3,'value')); end
% 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
destPerMP= Exp(expN).Dexp(DexpN).destPerMP; %length(gS.DM1.drug);
MPsel=Exp(expN).Dexp(DexpN).MPsel; %floor(get(handles.MPsldr1,'value'));
pertSel=Exp(expN).Dexp(DexpN).pertSel; %floor(get(handles.DMsldr1,'value'));
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;
%x2ypos= [1400-cpos(2) cpos(1)] %for HorzRotatedImage
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];
%indx=(picLoc1(1)-1)*24+picLoc1(2)
%spotFrm= Exp(expN).Dexp(DexpN).FexpScanSpots{1}{m,n,tPtSel};
spotFrm= Exp(expN).Dexp(DexpN).FexpScanSpots{plateNum}{m,n,tPtSel}; %20160108
end
end
end %for n=1:16
end %for m=1:24
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
plateLoc= ptrPos;
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);
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 expN==1, plotAxes=ghandles.Paxes1; OLaxes=ghandles.OLaxes1;
Exp(1).traceN=Exp(1).traceN+1;
traceN=Exp(1).traceN;
end
if expN==2, plotAxes=ghandles.Paxes2; OLaxes=ghandles.OLaxes2;
Exp(2).traceN=Exp(2).traceN+1;
traceN=Exp(2).traceN;
end
if expN==3, plotAxes=ghandles.Paxes3; OLaxes=ghandles.OLaxes3;
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');
try for i=1:length(Exp(expN).hOL(:)),set(Exp(expN).hOL(i),'color',[0 0 1]); end, catch, end %ZoneRelated
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;
%************************************************
catch
%{
g = K ./ (1 + exp(-r.* (t - l )));
if K==0||r==0||l==0, g(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);
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
%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
if expN==3,DMstr=char(get(ghandles.DM3,'string'));end
gene=MP(1,MPsel).genename{1,1}(indx); orf=MP(1,MPsel).orf{1,1}(indx);
spec=MP(1,MPsel).specifics{1,1}(indx); %orfrep=MP(1,plateNum).orfRep{1,1}(indx);
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=',num2str(l),'_','r=',num2str(r),'_','K=',num2str(K));
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),'\');
else
slashPos=strfind(char(Exp(expN).Dexp(DexpN).resDir),'/');
end
startPos=slashPos(length(slashPos)-2) +1;
endPos=(slashPos(length(slashPos)) -1);
expStr= {xp(startPos:endPos)};
Exp(expN).hOLname(traceN)= spotDescrip; %ZoneRelated %graphStr; %ghandles.Exp(expN).hOLname(traceN)= graphStr;
Exp(expN).hOLexpNm(traceN)= expStr; %ghandles.Exp(expN).hOLexpNm(traceN)= expStr;
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
set(ghandles.OLay1,'string', Exp(expN).hOLname(traceN));
try if length(char(Exp(expN).hOLexpNm(traceN)))>40,set(ghandles.OLexp1,'FontSize',8);end, catch end
set(ghandles.OLexp1,'string',Exp(expN).hOLexpNm(traceN));
end
if expN==2 %&& get(ghandles.rotPB2,'value') ~=1
try if length(char(Exp(expN).hOLname(traceN)))>40,set(ghandles.OLay2,'FontSize',8);end, catch end
set(ghandles.OLay2,'string', Exp(expN).hOLname(traceN));
try if length(char(Exp(expN).hOLexpNm(traceN)))>40,set(ghandles.OLexp2,'FontSize',8);end, catch end
set(ghandles.OLexp2,'string',Exp(expN).hOLexpNm(traceN));
end
if expN==3 %&& get(ghandles.rotPB3,'value') ~=1
try if length(char(Exp(expN).hOLname(traceN)))>40,set(ghandles.OLay3,'FontSize',8);end, catch end
set(ghandles.OLay3,'string', Exp(expN).hOLname(traceN));
try if length(char(Exp(expN).hOLexpNm(traceN)))>40,set(ghandles.OLexp3,'FontSize',8);end, catch end
set(ghandles.OLexp3,'string',Exp(expN).hOLexpNm(traceN));
end
catch
end
%*******************************************************
if expN==1
zonesel=1;
set(ghandles.zoneRad1,'value',1)
set(ghandles.zoneRad2,'value',0)
set(ghandles.zoneRad3,'value',0)
orfLstSel=get(ghandles.GeneOrfTog,'value');
if orfLstSel==1
set(ghandles.listboxGnOrf,'string',Exp(1).Dexp(DexpN).srtOrfLst)
else
set(ghandles.listboxGnOrf,'string',Exp(1).Dexp(DexpN).srtGnLst)
end
end
if expN==2
zonesel=2;
set(ghandles.zoneRad2,'value',1)
set(ghandles.zoneRad1,'value',0)
set(ghandles.zoneRad3,'value',0)
orfLstSel=get(ghandles.GeneOrfTog,'value');
if orfLstSel==1
set(ghandles.listboxGnOrf,'string',Exp(2).Dexp(DexpN).srtOrfLst)
else
set(ghandles.listboxGnOrf,'string',Exp(2).Dexp(DexpN).srtGnLst)
end
end
if expN==3
zonesel=3;
set(ghandles.zoneRad3,'value',1)
set(ghandles.zoneRad2,'value',0)
set(ghandles.zoneRad1,'value',0)
orfLstSel=get(ghandles.GeneOrfTog,'value');
if orfLstSel==1
set(ghandles.listboxGnOrf,'string',Exp(3).Dexp(DexpN).srtOrfLst)
else
set(ghandles.listboxGnOrf,'string',Exp(3).Dexp(DexpN).srtGnLst)
end
end
Exp(expN).Trace(traceN).UsrGLB= geneOrfstr;
Exp(expN).Trace(traceN).dmSel= pertSel;
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********************+++++++++++++++++*************
try
OLayTest=OLay<4
msg='OLay'
%make all traces blue
for i=1:length(Exp(OLay).hOL(:))
try set(Exp(OLay).hOL(i),'color',[0 0 1]), catch end
end
%if get(ghandles.rotPB1,'value')~=1,
for i=1:length(Exp(OLay).hOL(:))
htargetAxes
Exp(OLay).hOL(i)
if htargetAxes==Exp(OLay).hOL(i)
if OLay==1 && get(ghandles.rotPB1,'value')~=1,
set(htargetAxes,'color',[1 0 0])
try if length(char(Exp(OLay).hOLname(i)))>40,set(ghandles.OLay1,'FontSize',8);end, catch, end
set(ghandles.OLay1,'string', Exp(OLay).hOLname(i));
traceLab= char(Exp(OLay).hOLname(i));
try if length(char(Exp(OLay).hOLexpNm(i)))>40,set(ghandles.OLexp1,'FontSize',8);end, catch, end
set(ghandles.OLexp1,'string',Exp(OLay).hOLexpNm(i));
OLresDir= Exp(OLay).hOLresDir(i);
Exp(OLay).hOLplateNum(i)= Exp(expN).Dexp(DexpN).plateNum %bug fix for OLay "chrono' RF_cmp( ) trend
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])
try if length(char(Exp(OLay).hOLname(i)))>40,set(ghandles.OLay2,'FontSize',8);end, catch, end
set(ghandles.OLay2,'string', Exp(OLay).hOLname(i));
traceLab= char(Exp(OLay).hOLname(i));
try if length(char(Exp(OLay).hOLexpNm(i)))>40,set(ghandles.OLexp2,'FontSize',8);end, catch, end
set(ghandles.OLexp2,'string',Exp(OLay).hOLexpNm(i));
OLresDir= Exp(OLay).hOLresDir(i);
Exp(OLay).hOLplateNum(i)= Exp(expN).Dexp(DexpN).plateNum %bug fix for OLay "chrono' RF_cmp( ) trend
plateNum= Exp(expN).Dexp(DexpN).plateNum
OLplateNum= Exp(OLay).hOLplateNum(i);
seltraceN=i;
end
if OLay==3 && get(ghandles.rotPB3,'value') ~=1
set(htargetAxes,'color',[1 0 0])
try if length(char(Exp(OLay).hOLname(i)))>40,set(ghandles.OLay3,'FontSize',8);end, catch, end
set(ghandles.OLay3,'string', Exp(OLay).hOLname(i));
traceLab= char(Exp(OLay).hOLname(i));
try if length(char(Exp(OLay).hOLexpNm(i)))>40,set(ghandles.OLexp3,'FontSize',8);end, catch, end
set(ghandles.OLexp3,'string',Exp(OLay).hOLexpNm(i));
OLresDir= Exp(OLay).hOLresDir(i);
Exp(OLay).hOLplateNum(i)= Exp(expN).Dexp(DexpN).plateNum %bug fix for OLay "chrono' RF_cmp( ) trend
plateNum= Exp(expN).Dexp(DexpN).plateNum
OLplateNum= Exp(OLay).hOLplateNum(i);
seltraceN=i;
end
Exp(OLay).seltraceN=seltraceN;
else
msg='Cant Find trace'
end
end % => for i=1:length(Exp(OLay).hOL(:))
%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')
rindx= strfind(rxcy,'r')
LBr= str2num(rxcy((rindx+1):cindx-1))
LBc= str2num(tracename((pos_(2)+cindx): pos_(3)-1))
indx=((LBr-1)*24) +LBc
grfgenestr= tracename(1:pos_(3)-1)
scan= Exp(OLay).Dexp(DexpN).scan;
EZdatatip=2;
try
tracename=char(Exp(OLay).hOLname(seltraceN))
EZdatatip=2;
catch
end
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'****************
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
set(Exp(OLay).hOL(i),'Visible','off')
set(Exp(OLay).hOLb(i),'Visible','off')
for j=1:length(Exp(OLay).hOL(:))
if isequal(get(Exp(OLay).hOL(j),'Visible'),'on'), maxhN= j; end
end
end
if htargetAxes==Exp(OLay).hOL(i), break;end
end
set(Exp(OLay).hOL(maxhN),'color',[1 0 0]) %Set latest trace red
set(Exp(OLay).hOLb(maxhN),'color',[0 1 0])
if OLay==1
try if length(char(Exp(OLay).hOLname(maxhN)))>40,set(ghandles.OLay1,'FontSize',8);end, catch, end
set(ghandles.OLay1,'string', Exp(OLay).hOLname(maxhN));
traceLab= char(Exp(OLay).hOLname(maxhN));
try if length(char(Exp(OLay).hOLexpNm(maxhN)))>40,set(ghandles.OLexp1,'FontSize',8);end, catch, end
set(ghandles.OLexp1,'string',Exp(OLay).hOLexpNm(maxhN));
OLresDir= Exp(OLay).hOLresDir(maxhN);
OLplateNum= Exp(OLay).hOLplateNum(maxhN);
end
end
%------HIDE 22222222222222222-----
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
end
for i=1:length(Exp(OLay).hOL(:))
if htargetAxes==Exp(OLay).hOL(i)
hidAx2traceN=i
set(Exp(OLay).hOL(i),'Visible','off')
set(Exp(OLay).hOLb(i),'Visible','off')
for j=1:length(Exp(OLay).hOL(:))
try if isequal(get(Exp(OLay).hOL(j),'Visible'),'on'), maxhN= j; end, catch end
end
end
if htargetAxes==Exp(OLay).hOL(i), break;end
end
set(Exp(OLay).hOL(maxhN),'color',[1 0 0]) %Set latest trace red
set(Exp(OLay).hOLb(maxhN),'color',[0 1 0])
if OLay==2
try if length(char(Exp(OLay).hOLname(maxhN)))>40,set(ghandles.OLay2,'FontSize',8);end, catch, end
set(ghandles.OLay2,'string', Exp(OLay).hOLname(maxhN));
traceLab= char(Exp(OLay).hOLname(maxhN));
try if length(char(Exp(OLay).hOLexpNm(maxhN)))>40,set(ghandles.OLexp2,'FontSize',8);end, catch, end
set(ghandles.OLexp2,'string',Exp(OLay).hOLexpNm(maxhN));
OLresDir= Exp(OLay).hOLresDir(maxhN);
OLplateNum= Exp(OLay).hOLplateNum(maxhN);
end
end %if rotPB2 ....==1
%------HIDE 33333333333333-----
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
set(Exp(OLay).hOL(i),'Visible','off')
set(Exp(OLay).hOLb(i),'Visible','off')
for j=1:length(Exp(OLay).hOL(:))
try if isequal(get(Exp(OLay).hOL(j),'Visible'),'on'), maxhN= j; end, catch, end
end
end
if htargetAxes==Exp(OLay).hOL(i), break;end
end
set(Exp(OLay).hOL(maxhN),'color',[1 0 0]) %Set latest trace red
set(Exp(OLay).hOLb(maxhN),'color',[0 1 0])
if OLay==3
try if length(char(Exp(OLay).hOLname(maxhN)))>40,set(ghandles.OLay3,'FontSize',8);end, catch, end
set(ghandles.OLay3,'string', Exp(OLay).hOLname(maxhN));
traceLab= char(Exp(OLay).hOLname(maxhN));
try if length(char(Exp(OLay).hOLexpNm(maxhN)))>40,set(ghandles.OLexp3,'FontSize',8);end, catch, end
set(ghandles.OLexp3,'string',Exp(OLay).hOLexpNm(maxhN));
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
expN=OLay
EZdatatip= 2
catch
NoOLay=1;
EZdatatip=1;
end
if get(ghandles.spotTog,'value')==1 && NoOLay
OLresDir= Exp(expN).Dexp(DexpN).resDir;
OLplateNum=plateNum;
imLoc= [picLoc1(2), picLoc1(1)];
EZspotview(expN,DexpN, imLoc,OLresDir,OLplateNum,NoOLay)
end
%*****GraphicPertibationComparison**15_821*OR Chrono Day Comparison******************
%EZdatatip=1;
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
if exist('OLay') %User clicked on an Overlay
if get(ghandles.spotTog,'value')==1 && get(ghandles.rotPB1,'value') ~=1 && OLay<4
msg='OLay with SpotTog On and Hide off'
pos_=strfind(traceLab,'_')
rcStr=traceLab(pos_(2)+1:pos_(3)-1)
cPos=findstr(rcStr,'c');
rUsr=str2num(rcStr(2:cPos-1));
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) %*
%********************************************************
end
end
catch
end
[output_txt]=datatipp(obj,event_obj);
%*********************HeatMap Text Field*********************************
try
ll=num2str(l);
if length(ll)>5,htl= ll(1:5);else htl=ll;end
catch
htl=' ';
end
try
kk=num2str(K);
if length(kk)>5,htk= kk(1:5);else htk=kk;end
catch
htk=' ';
end
try
rr=num2str(r);
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
htN1=strcat('_N1=',N1);
catch
htN1=' ';
end
try
n2= num2str(Exp(expN).HtMpIntN2(indx)); %num2str(Exp(expN).Dexp(DexpN).HtMpIntN2(indx));
if length(n2)>5,N2= n2(1:5);else N2=n2; end
htN2=strcat('_N2=',N2);
catch
htN2=' ';
end
if Exp(expN).htmapPBsel==1, htmapStr= strcat('K= ',htk); end
if Exp(expN).htmapPBsel==2, htmapStr= strcat('r= ',htr); end
try
if Exp(expN).htmapPBsel==0 || Exp(expN).htmapPBsel>2
htmapStr=strcat('L= ',htl, htN1,htN2)
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
end
catch
end
try
if Exp(expN).htmapPBsel==1 || Exp(expN).htmapPBsel==2
%htmapStr=strcat('L= ',htl, htN1,htN2)
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
end
catch
end
%datacursormode(gcf)
%**********************************************Test Area
%Added 18_0105 to define RFcmpGFlg for EZmDayTrend.m when an Image spot
%is clicked
%try
%listboxGnOrf=get(handles.listboxGnOrf,'string');
%selGnOrf=listboxGnOrf(usrInxSel);
tempLB= str2mat(selGnOrf)
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
end
%catch
%end

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,144 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Migration Report for EZviewGui</title>
<style type="text/css">
html body {
height: 100%;
padding: 0; margin: 0;
color: #474747;
font: 13px/1.384 Arial, Helvetica, sans-serif;
}
/*Report Title Header*/
h1 {
font-family: Futura, Arial, Helvetica, sans-serif;
font-size: 28px;
font-weight: 400;
color: #fff;
margin: 0;
padding: 15px;
}
/*Report Section Headers*/
h2 {
padding-bottom: 2px;
margin: 20px 0 17px 0;
border-bottom: 1px solid #cbcbcb;
color: #c45400;
font: normal normal 22px/1.136 Arial,Helvetica,sans-serif;
}
/*Report Subsection Headers*/
h3 {
margin: 20px 0 20px 0;
font: normal bold 17px/1.35 Arial, Helvetica, sans-serif;
}
ul.childHasIcon {
padding-left: 20px;
}
ul > li.success {
list-style: none;
/*Check-mark image*/
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAK2SURBVHjaVJNPaFRXFMZ/b96MmUZGURMyHaoTa0QrRReD4KIlwriRRhPpoi1ddeNG4krFRbAbceOf0qJuSoWWWlooIiKlCSkp1ARksEmpi8GSQjKJUSYk/p1J5r17vi7ee609cFf3+33n3HvO8SgdJYn+oZFODw4DBxB7hYoSMzJVZBo12a2fzr9X55XwEoOBoZGyYNCDfgEyIQkMzIRkBKupYXN89svVg8OJgU+hxMDQSBk45+GVJSJQQk5IYGbIhIfrcSF78ttrC3P336wC+ANXlzqBs0A5EgtkSMJMMRxXFN11mSm/pr05sTSXX0qBDkvqj0Qx6MBC/QuVt77Pp/uvkV9bxJzhZ5r7cx2LHwGZtMQBGUhRmSaB/Zd9rb+OD98+zub1Paxbs5FjNw9GJm2NXuDLtMz2RuUC8VsVG2T9di4fGqaQ6+ZubZTvJ69goWEy/PTKTmBDykxFc0LOOLHvMu+8cQjnjDRtXDsyTiHXTaU2xpmfP6EyO4Y5Q6EgFXQBubRMM+a0zcx4t9hHb3c/j5/Ncbr3Cpva80w9HOfU7Q8IwhbmonaagQv8x0A25ZxVzAxz4tupS0jG5323eT1XZHL+DoM3+mgFLZwzEp2c0WpmqsBKypxGLb785vcLfH3vAgCT878xeKMvAp1FM5Ecg5Wn6+8Bz1Pm3K1W0xu2UFhofDf5BX8t/snFsZPxDMSZzaLOSKw2suOPHuyaAJb9v+c+bmze/aBuTnuE6wrCgJt/fMVyox6NcNwRCTARtjLV5fkt1+vTb1WAmk+hxOzUjumOrTMLkuVTXtCdgMmHJTux2nxt/Ml88Xptat+vwCzw0qdQAmCh2lPNZBsTJluU8ySsDazdhf6j1sts5cVS548P75d+qE/vrMTw8v+28ZXIAB3ABiAHZIEV4HkMLQJBIv5nAPq180UQOlmCAAAAAElFTkSuQmCC') no-repeat;
padding-left: 20px;
margin-bottom: 5px;
}
ul.verifications > li {
margin: 7px 0 7px 0;
}
table {
width: 100%;
border-collapse: collapse;
}
table,th,tr,td {
border: 1px solid #ccc;
text-align: left;
vertical-align: top;
padding: 8px 15px;
}
tr:nth-child(odd) {
background-color: #fafafa;
}
a { color: #187dbb; text-decoration: none; }
a:visited { color: #004b87; text-decoration: none; }
a:hover { color: #004b87; text-decoration: underline;}
code {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}
.reportTitle {
min-height: 52px;
background: #2f7eb2;
}
.reportBody {
padding: 0 15px 0 15px;
}
/*Classes that are used by HTML that is added dynamically by the report generator */
.detailsWorkaround {
padding: 10px 0px;
}
.detailsWorkaroundHeader {
padding-right: 5px;
font-weight: bold;
}
.hidden {
display: none;
}
.visible {
display: block;
}
.showMore {
margin-top: 5px;
}
</style>
</head>
<body>
<div class="reportTitle">
<h1>Migration Report for <code>EZviewGui</code></h1>
</div>
<div class="reportBody">
<section>
<h3>Your GUIDE app was migrated to App Designer and is ready for validation.</h3>
<h2>Migration Results</h2>
<ul class="childHasIcon">
<li class="success"><b>EZviewGui_App_1.mlapp</b> file created</li>
<li class="success"><b>2069</b> lines of code analyzed in EZviewGui.m</li>
<li class="success"><b>151</b> components created and initialized</li>
<li class="success"><b>76</b> callbacks and utility functions configured and enabled to function in App Designer</li>
</ul>
</section>
<section>
<h2>Validate Your Migrated App</h2>
<p>The migration tool enables most of your app code to execute. Now, you need to fully validate your migrated app to make sure it behaves as expected. Consider doing the following verifications:</p>
<ul>
<li>Verify Layout
<ul class="verifications">
<li>Run your app and verify the initial layout of all components is as expected.</li>
<li>If your app dynamically shows, hides, or enables additional components or options in response to selections made within the app, confirm these behave as expected.</li>
</ul>
</li>
<li>Verify Callbacks
<ul class="verifications">
<li>Run and close your app to confirm there are no startup or termination errors.</li>
<li>Exercise the workflows specific to your app, starting with the most basic, and gradually proceeding to the more complex ones.</li>
</ul>
</li>
</ul>
<p>If unexpected errors occur, either within the app or at the MATLAB command line, address those issues before continuing with the validation. For troubleshooting assistance and additional information, see <a href="matlab:helpview(fullfile(docroot,'matlab', 'creating_guis', 'differences-between-app-designer-and-guide.html#mw_7f306e19-74d0-4c0b-989d-74ed63e32ddd'));">GUIDE Migration Strategies</a>.</p>
</section>
</div>
<script type="text/javascript">
// Toggles showing the "Show More (10)" hyperlink with the "Show less" hyperlink
function toggleShowMore(selectedHyperlink) {
// Find the parent td for the selected hyperlink ("Show more" or "Show less")
var td = selectedHyperlink.parentElement.parentElement;
// Toggle the "hidden" class on all of the elements but the first 3. The first 3 we want to always be
// visible.
var tags = td.children;
for (var i=3; i<tags.length; i++) {
tags[i].classList.toggle("hidden");
}
}
</script>
</body>
</html>

View File

@@ -0,0 +1,144 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Migration Report for EZviewGui</title>
<style type="text/css">
html body {
height: 100%;
padding: 0; margin: 0;
color: #474747;
font: 13px/1.384 Arial, Helvetica, sans-serif;
}
/*Report Title Header*/
h1 {
font-family: Futura, Arial, Helvetica, sans-serif;
font-size: 28px;
font-weight: 400;
color: #fff;
margin: 0;
padding: 15px;
}
/*Report Section Headers*/
h2 {
padding-bottom: 2px;
margin: 20px 0 17px 0;
border-bottom: 1px solid #cbcbcb;
color: #c45400;
font: normal normal 22px/1.136 Arial,Helvetica,sans-serif;
}
/*Report Subsection Headers*/
h3 {
margin: 20px 0 20px 0;
font: normal bold 17px/1.35 Arial, Helvetica, sans-serif;
}
ul.childHasIcon {
padding-left: 20px;
}
ul > li.success {
list-style: none;
/*Check-mark image*/
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAK2SURBVHjaVJNPaFRXFMZ/b96MmUZGURMyHaoTa0QrRReD4KIlwriRRhPpoi1ddeNG4krFRbAbceOf0qJuSoWWWlooIiKlCSkp1ARksEmpi8GSQjKJUSYk/p1J5r17vi7ee609cFf3+33n3HvO8SgdJYn+oZFODw4DBxB7hYoSMzJVZBo12a2fzr9X55XwEoOBoZGyYNCDfgEyIQkMzIRkBKupYXN89svVg8OJgU+hxMDQSBk45+GVJSJQQk5IYGbIhIfrcSF78ttrC3P336wC+ANXlzqBs0A5EgtkSMJMMRxXFN11mSm/pr05sTSXX0qBDkvqj0Qx6MBC/QuVt77Pp/uvkV9bxJzhZ5r7cx2LHwGZtMQBGUhRmSaB/Zd9rb+OD98+zub1Paxbs5FjNw9GJm2NXuDLtMz2RuUC8VsVG2T9di4fGqaQ6+ZubZTvJ69goWEy/PTKTmBDykxFc0LOOLHvMu+8cQjnjDRtXDsyTiHXTaU2xpmfP6EyO4Y5Q6EgFXQBubRMM+a0zcx4t9hHb3c/j5/Ncbr3Cpva80w9HOfU7Q8IwhbmonaagQv8x0A25ZxVzAxz4tupS0jG5323eT1XZHL+DoM3+mgFLZwzEp2c0WpmqsBKypxGLb785vcLfH3vAgCT878xeKMvAp1FM5Ecg5Wn6+8Bz1Pm3K1W0xu2UFhofDf5BX8t/snFsZPxDMSZzaLOSKw2suOPHuyaAJb9v+c+bmze/aBuTnuE6wrCgJt/fMVyox6NcNwRCTARtjLV5fkt1+vTb1WAmk+hxOzUjumOrTMLkuVTXtCdgMmHJTux2nxt/Ml88Xptat+vwCzw0qdQAmCh2lPNZBsTJluU8ySsDazdhf6j1sts5cVS548P75d+qE/vrMTw8v+28ZXIAB3ABiAHZIEV4HkMLQJBIv5nAPq180UQOlmCAAAAAElFTkSuQmCC') no-repeat;
padding-left: 20px;
margin-bottom: 5px;
}
ul.verifications > li {
margin: 7px 0 7px 0;
}
table {
width: 100%;
border-collapse: collapse;
}
table,th,tr,td {
border: 1px solid #ccc;
text-align: left;
vertical-align: top;
padding: 8px 15px;
}
tr:nth-child(odd) {
background-color: #fafafa;
}
a { color: #187dbb; text-decoration: none; }
a:visited { color: #004b87; text-decoration: none; }
a:hover { color: #004b87; text-decoration: underline;}
code {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}
.reportTitle {
min-height: 52px;
background: #2f7eb2;
}
.reportBody {
padding: 0 15px 0 15px;
}
/*Classes that are used by HTML that is added dynamically by the report generator */
.detailsWorkaround {
padding: 10px 0px;
}
.detailsWorkaroundHeader {
padding-right: 5px;
font-weight: bold;
}
.hidden {
display: none;
}
.visible {
display: block;
}
.showMore {
margin-top: 5px;
}
</style>
</head>
<body>
<div class="reportTitle">
<h1>Migration Report for <code>EZviewGui</code></h1>
</div>
<div class="reportBody">
<section>
<h3>Your GUIDE app was migrated to App Designer and is ready for validation.</h3>
<h2>Migration Results</h2>
<ul class="childHasIcon">
<li class="success"><b>EZviewGui_App_2.mlapp</b> file created</li>
<li class="success"><b>2105</b> lines of code analyzed in EZviewGui.m</li>
<li class="success"><b>160</b> components created and initialized</li>
<li class="success"><b>75</b> callbacks and utility functions configured and enabled to function in App Designer</li>
</ul>
</section>
<section>
<h2>Validate Your Migrated App</h2>
<p>The migration tool enables most of your app code to execute. Now, you need to fully validate your migrated app to make sure it behaves as expected. Consider doing the following verifications:</p>
<ul>
<li>Verify Layout
<ul class="verifications">
<li>Run your app and verify the initial layout of all components is as expected.</li>
<li>If your app dynamically shows, hides, or enables additional components or options in response to selections made within the app, confirm these behave as expected.</li>
</ul>
</li>
<li>Verify Callbacks
<ul class="verifications">
<li>Run and close your app to confirm there are no startup or termination errors.</li>
<li>Exercise the workflows specific to your app, starting with the most basic, and gradually proceeding to the more complex ones.</li>
</ul>
</li>
</ul>
<p>If unexpected errors occur, either within the app or at the MATLAB command line, address those issues before continuing with the validation. For troubleshooting assistance and additional information, see <a href="matlab:helpview(fullfile(docroot,'matlab', 'creating_guis', 'differences-between-app-designer-and-guide.html#mw_7f306e19-74d0-4c0b-989d-74ed63e32ddd'));">GUIDE Migration Strategies</a>.</p>
</section>
</div>
<script type="text/javascript">
// Toggles showing the "Show More (10)" hyperlink with the "Show less" hyperlink
function toggleShowMore(selectedHyperlink) {
// Find the parent td for the selected hyperlink ("Show more" or "Show less")
var td = selectedHyperlink.parentElement.parentElement;
// Toggle the "hidden" class on all of the elements but the first 3. The first 3 we want to always be
// visible.
var tags = td.children;
for (var i=3; i<tags.length; i++) {
tags[i].classList.toggle("hidden");
}
}
</script>
</body>
</html>

View File

@@ -0,0 +1,144 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Migration Report for EZviewGui</title>
<style type="text/css">
html body {
height: 100%;
padding: 0; margin: 0;
color: #474747;
font: 13px/1.384 Arial, Helvetica, sans-serif;
}
/*Report Title Header*/
h1 {
font-family: Futura, Arial, Helvetica, sans-serif;
font-size: 28px;
font-weight: 400;
color: #fff;
margin: 0;
padding: 15px;
}
/*Report Section Headers*/
h2 {
padding-bottom: 2px;
margin: 20px 0 17px 0;
border-bottom: 1px solid #cbcbcb;
color: #c45400;
font: normal normal 22px/1.136 Arial,Helvetica,sans-serif;
}
/*Report Subsection Headers*/
h3 {
margin: 20px 0 20px 0;
font: normal bold 17px/1.35 Arial, Helvetica, sans-serif;
}
ul.childHasIcon {
padding-left: 20px;
}
ul > li.success {
list-style: none;
/*Check-mark image*/
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAK2SURBVHjaVJNPaFRXFMZ/b96MmUZGURMyHaoTa0QrRReD4KIlwriRRhPpoi1ddeNG4krFRbAbceOf0qJuSoWWWlooIiKlCSkp1ARksEmpi8GSQjKJUSYk/p1J5r17vi7ee609cFf3+33n3HvO8SgdJYn+oZFODw4DBxB7hYoSMzJVZBo12a2fzr9X55XwEoOBoZGyYNCDfgEyIQkMzIRkBKupYXN89svVg8OJgU+hxMDQSBk45+GVJSJQQk5IYGbIhIfrcSF78ttrC3P336wC+ANXlzqBs0A5EgtkSMJMMRxXFN11mSm/pr05sTSXX0qBDkvqj0Qx6MBC/QuVt77Pp/uvkV9bxJzhZ5r7cx2LHwGZtMQBGUhRmSaB/Zd9rb+OD98+zub1Paxbs5FjNw9GJm2NXuDLtMz2RuUC8VsVG2T9di4fGqaQ6+ZubZTvJ69goWEy/PTKTmBDykxFc0LOOLHvMu+8cQjnjDRtXDsyTiHXTaU2xpmfP6EyO4Y5Q6EgFXQBubRMM+a0zcx4t9hHb3c/j5/Ncbr3Cpva80w9HOfU7Q8IwhbmonaagQv8x0A25ZxVzAxz4tupS0jG5323eT1XZHL+DoM3+mgFLZwzEp2c0WpmqsBKypxGLb785vcLfH3vAgCT878xeKMvAp1FM5Ecg5Wn6+8Bz1Pm3K1W0xu2UFhofDf5BX8t/snFsZPxDMSZzaLOSKw2suOPHuyaAJb9v+c+bmze/aBuTnuE6wrCgJt/fMVyox6NcNwRCTARtjLV5fkt1+vTb1WAmk+hxOzUjumOrTMLkuVTXtCdgMmHJTux2nxt/Ml88Xptat+vwCzw0qdQAmCh2lPNZBsTJluU8ySsDazdhf6j1sts5cVS548P75d+qE/vrMTw8v+28ZXIAB3ABiAHZIEV4HkMLQJBIv5nAPq180UQOlmCAAAAAElFTkSuQmCC') no-repeat;
padding-left: 20px;
margin-bottom: 5px;
}
ul.verifications > li {
margin: 7px 0 7px 0;
}
table {
width: 100%;
border-collapse: collapse;
}
table,th,tr,td {
border: 1px solid #ccc;
text-align: left;
vertical-align: top;
padding: 8px 15px;
}
tr:nth-child(odd) {
background-color: #fafafa;
}
a { color: #187dbb; text-decoration: none; }
a:visited { color: #004b87; text-decoration: none; }
a:hover { color: #004b87; text-decoration: underline;}
code {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}
.reportTitle {
min-height: 52px;
background: #2f7eb2;
}
.reportBody {
padding: 0 15px 0 15px;
}
/*Classes that are used by HTML that is added dynamically by the report generator */
.detailsWorkaround {
padding: 10px 0px;
}
.detailsWorkaroundHeader {
padding-right: 5px;
font-weight: bold;
}
.hidden {
display: none;
}
.visible {
display: block;
}
.showMore {
margin-top: 5px;
}
</style>
</head>
<body>
<div class="reportTitle">
<h1>Migration Report for <code>EZviewGui</code></h1>
</div>
<div class="reportBody">
<section>
<h3>Your GUIDE app was migrated to App Designer and is ready for validation.</h3>
<h2>Migration Results</h2>
<ul class="childHasIcon">
<li class="success"><b>EZviewGui_App_4.mlapp</b> file created</li>
<li class="success"><b>2105</b> lines of code analyzed in EZviewGui.m</li>
<li class="success"><b>160</b> components created and initialized</li>
<li class="success"><b>75</b> callbacks and utility functions configured and enabled to function in App Designer</li>
</ul>
</section>
<section>
<h2>Validate Your Migrated App</h2>
<p>The migration tool enables most of your app code to execute. Now, you need to fully validate your migrated app to make sure it behaves as expected. Consider doing the following verifications:</p>
<ul>
<li>Verify Layout
<ul class="verifications">
<li>Run your app and verify the initial layout of all components is as expected.</li>
<li>If your app dynamically shows, hides, or enables additional components or options in response to selections made within the app, confirm these behave as expected.</li>
</ul>
</li>
<li>Verify Callbacks
<ul class="verifications">
<li>Run and close your app to confirm there are no startup or termination errors.</li>
<li>Exercise the workflows specific to your app, starting with the most basic, and gradually proceeding to the more complex ones.</li>
</ul>
</li>
</ul>
<p>If unexpected errors occur, either within the app or at the MATLAB command line, address those issues before continuing with the validation. For troubleshooting assistance and additional information, see <a href="matlab:helpview(fullfile(docroot,'matlab', 'creating_guis', 'differences-between-app-designer-and-guide.html#mw_7f306e19-74d0-4c0b-989d-74ed63e32ddd'));">GUIDE Migration Strategies</a>.</p>
</section>
</div>
<script type="text/javascript">
// Toggles showing the "Show More (10)" hyperlink with the "Show less" hyperlink
function toggleShowMore(selectedHyperlink) {
// Find the parent td for the selected hyperlink ("Show more" or "Show less")
var td = selectedHyperlink.parentElement.parentElement;
// Toggle the "hidden" class on all of the elements but the first 3. The first 3 we want to always be
// visible.
var tags = td.children;
for (var i=3; i<tags.length; i++) {
tags[i].classList.toggle("hidden");
}
}
</script>
</body>
</html>

View File

@@ -0,0 +1,144 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Migration Report for EZviewGui</title>
<style type="text/css">
html body {
height: 100%;
padding: 0; margin: 0;
color: #474747;
font: 13px/1.384 Arial, Helvetica, sans-serif;
}
/*Report Title Header*/
h1 {
font-family: Futura, Arial, Helvetica, sans-serif;
font-size: 28px;
font-weight: 400;
color: #fff;
margin: 0;
padding: 15px;
}
/*Report Section Headers*/
h2 {
padding-bottom: 2px;
margin: 20px 0 17px 0;
border-bottom: 1px solid #cbcbcb;
color: #c45400;
font: normal normal 22px/1.136 Arial,Helvetica,sans-serif;
}
/*Report Subsection Headers*/
h3 {
margin: 20px 0 20px 0;
font: normal bold 17px/1.35 Arial, Helvetica, sans-serif;
}
ul.childHasIcon {
padding-left: 20px;
}
ul > li.success {
list-style: none;
/*Check-mark image*/
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAK2SURBVHjaVJNPaFRXFMZ/b96MmUZGURMyHaoTa0QrRReD4KIlwriRRhPpoi1ddeNG4krFRbAbceOf0qJuSoWWWlooIiKlCSkp1ARksEmpi8GSQjKJUSYk/p1J5r17vi7ee609cFf3+33n3HvO8SgdJYn+oZFODw4DBxB7hYoSMzJVZBo12a2fzr9X55XwEoOBoZGyYNCDfgEyIQkMzIRkBKupYXN89svVg8OJgU+hxMDQSBk45+GVJSJQQk5IYGbIhIfrcSF78ttrC3P336wC+ANXlzqBs0A5EgtkSMJMMRxXFN11mSm/pr05sTSXX0qBDkvqj0Qx6MBC/QuVt77Pp/uvkV9bxJzhZ5r7cx2LHwGZtMQBGUhRmSaB/Zd9rb+OD98+zub1Paxbs5FjNw9GJm2NXuDLtMz2RuUC8VsVG2T9di4fGqaQ6+ZubZTvJ69goWEy/PTKTmBDykxFc0LOOLHvMu+8cQjnjDRtXDsyTiHXTaU2xpmfP6EyO4Y5Q6EgFXQBubRMM+a0zcx4t9hHb3c/j5/Ncbr3Cpva80w9HOfU7Q8IwhbmonaagQv8x0A25ZxVzAxz4tupS0jG5323eT1XZHL+DoM3+mgFLZwzEp2c0WpmqsBKypxGLb785vcLfH3vAgCT878xeKMvAp1FM5Ecg5Wn6+8Bz1Pm3K1W0xu2UFhofDf5BX8t/snFsZPxDMSZzaLOSKw2suOPHuyaAJb9v+c+bmze/aBuTnuE6wrCgJt/fMVyox6NcNwRCTARtjLV5fkt1+vTb1WAmk+hxOzUjumOrTMLkuVTXtCdgMmHJTux2nxt/Ml88Xptat+vwCzw0qdQAmCh2lPNZBsTJluU8ySsDazdhf6j1sts5cVS548P75d+qE/vrMTw8v+28ZXIAB3ABiAHZIEV4HkMLQJBIv5nAPq180UQOlmCAAAAAElFTkSuQmCC') no-repeat;
padding-left: 20px;
margin-bottom: 5px;
}
ul.verifications > li {
margin: 7px 0 7px 0;
}
table {
width: 100%;
border-collapse: collapse;
}
table,th,tr,td {
border: 1px solid #ccc;
text-align: left;
vertical-align: top;
padding: 8px 15px;
}
tr:nth-child(odd) {
background-color: #fafafa;
}
a { color: #187dbb; text-decoration: none; }
a:visited { color: #004b87; text-decoration: none; }
a:hover { color: #004b87; text-decoration: underline;}
code {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}
.reportTitle {
min-height: 52px;
background: #2f7eb2;
}
.reportBody {
padding: 0 15px 0 15px;
}
/*Classes that are used by HTML that is added dynamically by the report generator */
.detailsWorkaround {
padding: 10px 0px;
}
.detailsWorkaroundHeader {
padding-right: 5px;
font-weight: bold;
}
.hidden {
display: none;
}
.visible {
display: block;
}
.showMore {
margin-top: 5px;
}
</style>
</head>
<body>
<div class="reportTitle">
<h1>Migration Report for <code>EZviewGui</code></h1>
</div>
<div class="reportBody">
<section>
<h3>Your GUIDE app was migrated to App Designer and is ready for validation.</h3>
<h2>Migration Results</h2>
<ul class="childHasIcon">
<li class="success"><b>EZviewGui_App_5.mlapp</b> file created</li>
<li class="success"><b>2105</b> lines of code analyzed in EZviewGui.m</li>
<li class="success"><b>160</b> components created and initialized</li>
<li class="success"><b>75</b> callbacks and utility functions configured and enabled to function in App Designer</li>
</ul>
</section>
<section>
<h2>Validate Your Migrated App</h2>
<p>The migration tool enables most of your app code to execute. Now, you need to fully validate your migrated app to make sure it behaves as expected. Consider doing the following verifications:</p>
<ul>
<li>Verify Layout
<ul class="verifications">
<li>Run your app and verify the initial layout of all components is as expected.</li>
<li>If your app dynamically shows, hides, or enables additional components or options in response to selections made within the app, confirm these behave as expected.</li>
</ul>
</li>
<li>Verify Callbacks
<ul class="verifications">
<li>Run and close your app to confirm there are no startup or termination errors.</li>
<li>Exercise the workflows specific to your app, starting with the most basic, and gradually proceeding to the more complex ones.</li>
</ul>
</li>
</ul>
<p>If unexpected errors occur, either within the app or at the MATLAB command line, address those issues before continuing with the validation. For troubleshooting assistance and additional information, see <a href="matlab:helpview(fullfile(docroot,'matlab', 'creating_guis', 'differences-between-app-designer-and-guide.html#mw_7f306e19-74d0-4c0b-989d-74ed63e32ddd'));">GUIDE Migration Strategies</a>.</p>
</section>
</div>
<script type="text/javascript">
// Toggles showing the "Show More (10)" hyperlink with the "Show less" hyperlink
function toggleShowMore(selectedHyperlink) {
// Find the parent td for the selected hyperlink ("Show more" or "Show less")
var td = selectedHyperlink.parentElement.parentElement;
// Toggle the "hidden" class on all of the elements but the first 3. The first 3 we want to always be
// visible.
var tags = td.children;
for (var i=3; i<tags.length; i++) {
tags[i].classList.toggle("hidden");
}
}
</script>
</body>
</html>

View File

@@ -0,0 +1,144 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Migration Report for EZviewGui</title>
<style type="text/css">
html body {
height: 100%;
padding: 0; margin: 0;
color: #474747;
font: 13px/1.384 Arial, Helvetica, sans-serif;
}
/*Report Title Header*/
h1 {
font-family: Futura, Arial, Helvetica, sans-serif;
font-size: 28px;
font-weight: 400;
color: #fff;
margin: 0;
padding: 15px;
}
/*Report Section Headers*/
h2 {
padding-bottom: 2px;
margin: 20px 0 17px 0;
border-bottom: 1px solid #cbcbcb;
color: #c45400;
font: normal normal 22px/1.136 Arial,Helvetica,sans-serif;
}
/*Report Subsection Headers*/
h3 {
margin: 20px 0 20px 0;
font: normal bold 17px/1.35 Arial, Helvetica, sans-serif;
}
ul.childHasIcon {
padding-left: 20px;
}
ul > li.success {
list-style: none;
/*Check-mark image*/
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAK2SURBVHjaVJNPaFRXFMZ/b96MmUZGURMyHaoTa0QrRReD4KIlwriRRhPpoi1ddeNG4krFRbAbceOf0qJuSoWWWlooIiKlCSkp1ARksEmpi8GSQjKJUSYk/p1J5r17vi7ee609cFf3+33n3HvO8SgdJYn+oZFODw4DBxB7hYoSMzJVZBo12a2fzr9X55XwEoOBoZGyYNCDfgEyIQkMzIRkBKupYXN89svVg8OJgU+hxMDQSBk45+GVJSJQQk5IYGbIhIfrcSF78ttrC3P336wC+ANXlzqBs0A5EgtkSMJMMRxXFN11mSm/pr05sTSXX0qBDkvqj0Qx6MBC/QuVt77Pp/uvkV9bxJzhZ5r7cx2LHwGZtMQBGUhRmSaB/Zd9rb+OD98+zub1Paxbs5FjNw9GJm2NXuDLtMz2RuUC8VsVG2T9di4fGqaQ6+ZubZTvJ69goWEy/PTKTmBDykxFc0LOOLHvMu+8cQjnjDRtXDsyTiHXTaU2xpmfP6EyO4Y5Q6EgFXQBubRMM+a0zcx4t9hHb3c/j5/Ncbr3Cpva80w9HOfU7Q8IwhbmonaagQv8x0A25ZxVzAxz4tupS0jG5323eT1XZHL+DoM3+mgFLZwzEp2c0WpmqsBKypxGLb785vcLfH3vAgCT878xeKMvAp1FM5Ecg5Wn6+8Bz1Pm3K1W0xu2UFhofDf5BX8t/snFsZPxDMSZzaLOSKw2suOPHuyaAJb9v+c+bmze/aBuTnuE6wrCgJt/fMVyox6NcNwRCTARtjLV5fkt1+vTb1WAmk+hxOzUjumOrTMLkuVTXtCdgMmHJTux2nxt/Ml88Xptat+vwCzw0qdQAmCh2lPNZBsTJluU8ySsDazdhf6j1sts5cVS548P75d+qE/vrMTw8v+28ZXIAB3ABiAHZIEV4HkMLQJBIv5nAPq180UQOlmCAAAAAElFTkSuQmCC') no-repeat;
padding-left: 20px;
margin-bottom: 5px;
}
ul.verifications > li {
margin: 7px 0 7px 0;
}
table {
width: 100%;
border-collapse: collapse;
}
table,th,tr,td {
border: 1px solid #ccc;
text-align: left;
vertical-align: top;
padding: 8px 15px;
}
tr:nth-child(odd) {
background-color: #fafafa;
}
a { color: #187dbb; text-decoration: none; }
a:visited { color: #004b87; text-decoration: none; }
a:hover { color: #004b87; text-decoration: underline;}
code {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}
.reportTitle {
min-height: 52px;
background: #2f7eb2;
}
.reportBody {
padding: 0 15px 0 15px;
}
/*Classes that are used by HTML that is added dynamically by the report generator */
.detailsWorkaround {
padding: 10px 0px;
}
.detailsWorkaroundHeader {
padding-right: 5px;
font-weight: bold;
}
.hidden {
display: none;
}
.visible {
display: block;
}
.showMore {
margin-top: 5px;
}
</style>
</head>
<body>
<div class="reportTitle">
<h1>Migration Report for <code>EZviewGui</code></h1>
</div>
<div class="reportBody">
<section>
<h3>Your GUIDE app was migrated to App Designer and is ready for validation.</h3>
<h2>Migration Results</h2>
<ul class="childHasIcon">
<li class="success"><b>EZviewGui_App_6.mlapp</b> file created</li>
<li class="success"><b>2105</b> lines of code analyzed in EZviewGui.m</li>
<li class="success"><b>160</b> components created and initialized</li>
<li class="success"><b>75</b> callbacks and utility functions configured and enabled to function in App Designer</li>
</ul>
</section>
<section>
<h2>Validate Your Migrated App</h2>
<p>The migration tool enables most of your app code to execute. Now, you need to fully validate your migrated app to make sure it behaves as expected. Consider doing the following verifications:</p>
<ul>
<li>Verify Layout
<ul class="verifications">
<li>Run your app and verify the initial layout of all components is as expected.</li>
<li>If your app dynamically shows, hides, or enables additional components or options in response to selections made within the app, confirm these behave as expected.</li>
</ul>
</li>
<li>Verify Callbacks
<ul class="verifications">
<li>Run and close your app to confirm there are no startup or termination errors.</li>
<li>Exercise the workflows specific to your app, starting with the most basic, and gradually proceeding to the more complex ones.</li>
</ul>
</li>
</ul>
<p>If unexpected errors occur, either within the app or at the MATLAB command line, address those issues before continuing with the validation. For troubleshooting assistance and additional information, see <a href="matlab:helpview(fullfile(docroot,'matlab', 'creating_guis', 'differences-between-app-designer-and-guide.html#mw_7f306e19-74d0-4c0b-989d-74ed63e32ddd'));">GUIDE Migration Strategies</a>.</p>
</section>
</div>
<script type="text/javascript">
// Toggles showing the "Show More (10)" hyperlink with the "Show less" hyperlink
function toggleShowMore(selectedHyperlink) {
// Find the parent td for the selected hyperlink ("Show more" or "Show less")
var td = selectedHyperlink.parentElement.parentElement;
// Toggle the "hidden" class on all of the elements but the first 3. The first 3 we want to always be
// visible.
var tags = td.children;
for (var i=3; i<tags.length; i++) {
tags[i].classList.toggle("hidden");
}
}
</script>
</body>
</html>

View File

@@ -0,0 +1,144 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Migration Report for EZviewGui</title>
<style type="text/css">
html body {
height: 100%;
padding: 0; margin: 0;
color: #474747;
font: 13px/1.384 Arial, Helvetica, sans-serif;
}
/*Report Title Header*/
h1 {
font-family: Futura, Arial, Helvetica, sans-serif;
font-size: 28px;
font-weight: 400;
color: #fff;
margin: 0;
padding: 15px;
}
/*Report Section Headers*/
h2 {
padding-bottom: 2px;
margin: 20px 0 17px 0;
border-bottom: 1px solid #cbcbcb;
color: #c45400;
font: normal normal 22px/1.136 Arial,Helvetica,sans-serif;
}
/*Report Subsection Headers*/
h3 {
margin: 20px 0 20px 0;
font: normal bold 17px/1.35 Arial, Helvetica, sans-serif;
}
ul.childHasIcon {
padding-left: 20px;
}
ul > li.success {
list-style: none;
/*Check-mark image*/
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAK2SURBVHjaVJNPaFRXFMZ/b96MmUZGURMyHaoTa0QrRReD4KIlwriRRhPpoi1ddeNG4krFRbAbceOf0qJuSoWWWlooIiKlCSkp1ARksEmpi8GSQjKJUSYk/p1J5r17vi7ee609cFf3+33n3HvO8SgdJYn+oZFODw4DBxB7hYoSMzJVZBo12a2fzr9X55XwEoOBoZGyYNCDfgEyIQkMzIRkBKupYXN89svVg8OJgU+hxMDQSBk45+GVJSJQQk5IYGbIhIfrcSF78ttrC3P336wC+ANXlzqBs0A5EgtkSMJMMRxXFN11mSm/pr05sTSXX0qBDkvqj0Qx6MBC/QuVt77Pp/uvkV9bxJzhZ5r7cx2LHwGZtMQBGUhRmSaB/Zd9rb+OD98+zub1Paxbs5FjNw9GJm2NXuDLtMz2RuUC8VsVG2T9di4fGqaQ6+ZubZTvJ69goWEy/PTKTmBDykxFc0LOOLHvMu+8cQjnjDRtXDsyTiHXTaU2xpmfP6EyO4Y5Q6EgFXQBubRMM+a0zcx4t9hHb3c/j5/Ncbr3Cpva80w9HOfU7Q8IwhbmonaagQv8x0A25ZxVzAxz4tupS0jG5323eT1XZHL+DoM3+mgFLZwzEp2c0WpmqsBKypxGLb785vcLfH3vAgCT878xeKMvAp1FM5Ecg5Wn6+8Bz1Pm3K1W0xu2UFhofDf5BX8t/snFsZPxDMSZzaLOSKw2suOPHuyaAJb9v+c+bmze/aBuTnuE6wrCgJt/fMVyox6NcNwRCTARtjLV5fkt1+vTb1WAmk+hxOzUjumOrTMLkuVTXtCdgMmHJTux2nxt/Ml88Xptat+vwCzw0qdQAmCh2lPNZBsTJluU8ySsDazdhf6j1sts5cVS548P75d+qE/vrMTw8v+28ZXIAB3ABiAHZIEV4HkMLQJBIv5nAPq180UQOlmCAAAAAElFTkSuQmCC') no-repeat;
padding-left: 20px;
margin-bottom: 5px;
}
ul.verifications > li {
margin: 7px 0 7px 0;
}
table {
width: 100%;
border-collapse: collapse;
}
table,th,tr,td {
border: 1px solid #ccc;
text-align: left;
vertical-align: top;
padding: 8px 15px;
}
tr:nth-child(odd) {
background-color: #fafafa;
}
a { color: #187dbb; text-decoration: none; }
a:visited { color: #004b87; text-decoration: none; }
a:hover { color: #004b87; text-decoration: underline;}
code {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}
.reportTitle {
min-height: 52px;
background: #2f7eb2;
}
.reportBody {
padding: 0 15px 0 15px;
}
/*Classes that are used by HTML that is added dynamically by the report generator */
.detailsWorkaround {
padding: 10px 0px;
}
.detailsWorkaroundHeader {
padding-right: 5px;
font-weight: bold;
}
.hidden {
display: none;
}
.visible {
display: block;
}
.showMore {
margin-top: 5px;
}
</style>
</head>
<body>
<div class="reportTitle">
<h1>Migration Report for <code>EZviewGui</code></h1>
</div>
<div class="reportBody">
<section>
<h3>Your GUIDE app was migrated to App Designer and is ready for validation.</h3>
<h2>Migration Results</h2>
<ul class="childHasIcon">
<li class="success"><b>EZviewGui_App_7.mlapp</b> file created</li>
<li class="success"><b>2105</b> lines of code analyzed in EZviewGui.m</li>
<li class="success"><b>160</b> components created and initialized</li>
<li class="success"><b>75</b> callbacks and utility functions configured and enabled to function in App Designer</li>
</ul>
</section>
<section>
<h2>Validate Your Migrated App</h2>
<p>The migration tool enables most of your app code to execute. Now, you need to fully validate your migrated app to make sure it behaves as expected. Consider doing the following verifications:</p>
<ul>
<li>Verify Layout
<ul class="verifications">
<li>Run your app and verify the initial layout of all components is as expected.</li>
<li>If your app dynamically shows, hides, or enables additional components or options in response to selections made within the app, confirm these behave as expected.</li>
</ul>
</li>
<li>Verify Callbacks
<ul class="verifications">
<li>Run and close your app to confirm there are no startup or termination errors.</li>
<li>Exercise the workflows specific to your app, starting with the most basic, and gradually proceeding to the more complex ones.</li>
</ul>
</li>
</ul>
<p>If unexpected errors occur, either within the app or at the MATLAB command line, address those issues before continuing with the validation. For troubleshooting assistance and additional information, see <a href="matlab:helpview(fullfile(docroot,'matlab', 'creating_guis', 'differences-between-app-designer-and-guide.html#mw_7f306e19-74d0-4c0b-989d-74ed63e32ddd'));">GUIDE Migration Strategies</a>.</p>
</section>
</div>
<script type="text/javascript">
// Toggles showing the "Show More (10)" hyperlink with the "Show less" hyperlink
function toggleShowMore(selectedHyperlink) {
// Find the parent td for the selected hyperlink ("Show more" or "Show less")
var td = selectedHyperlink.parentElement.parentElement;
// Toggle the "hidden" class on all of the elements but the first 3. The first 3 we want to always be
// visible.
var tags = td.children;
for (var i=3; i<tags.length; i++) {
tags[i].classList.toggle("hidden");
}
}
</script>
</body>
</html>

View File

@@ -0,0 +1,144 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Migration Report for EZviewGui</title>
<style type="text/css">
html body {
height: 100%;
padding: 0; margin: 0;
color: #474747;
font: 13px/1.384 Arial, Helvetica, sans-serif;
}
/*Report Title Header*/
h1 {
font-family: Futura, Arial, Helvetica, sans-serif;
font-size: 28px;
font-weight: 400;
color: #fff;
margin: 0;
padding: 15px;
}
/*Report Section Headers*/
h2 {
padding-bottom: 2px;
margin: 20px 0 17px 0;
border-bottom: 1px solid #cbcbcb;
color: #c45400;
font: normal normal 22px/1.136 Arial,Helvetica,sans-serif;
}
/*Report Subsection Headers*/
h3 {
margin: 20px 0 20px 0;
font: normal bold 17px/1.35 Arial, Helvetica, sans-serif;
}
ul.childHasIcon {
padding-left: 20px;
}
ul > li.success {
list-style: none;
/*Check-mark image*/
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAK2SURBVHjaVJNPaFRXFMZ/b96MmUZGURMyHaoTa0QrRReD4KIlwriRRhPpoi1ddeNG4krFRbAbceOf0qJuSoWWWlooIiKlCSkp1ARksEmpi8GSQjKJUSYk/p1J5r17vi7ee609cFf3+33n3HvO8SgdJYn+oZFODw4DBxB7hYoSMzJVZBo12a2fzr9X55XwEoOBoZGyYNCDfgEyIQkMzIRkBKupYXN89svVg8OJgU+hxMDQSBk45+GVJSJQQk5IYGbIhIfrcSF78ttrC3P336wC+ANXlzqBs0A5EgtkSMJMMRxXFN11mSm/pr05sTSXX0qBDkvqj0Qx6MBC/QuVt77Pp/uvkV9bxJzhZ5r7cx2LHwGZtMQBGUhRmSaB/Zd9rb+OD98+zub1Paxbs5FjNw9GJm2NXuDLtMz2RuUC8VsVG2T9di4fGqaQ6+ZubZTvJ69goWEy/PTKTmBDykxFc0LOOLHvMu+8cQjnjDRtXDsyTiHXTaU2xpmfP6EyO4Y5Q6EgFXQBubRMM+a0zcx4t9hHb3c/j5/Ncbr3Cpva80w9HOfU7Q8IwhbmonaagQv8x0A25ZxVzAxz4tupS0jG5323eT1XZHL+DoM3+mgFLZwzEp2c0WpmqsBKypxGLb785vcLfH3vAgCT878xeKMvAp1FM5Ecg5Wn6+8Bz1Pm3K1W0xu2UFhofDf5BX8t/snFsZPxDMSZzaLOSKw2suOPHuyaAJb9v+c+bmze/aBuTnuE6wrCgJt/fMVyox6NcNwRCTARtjLV5fkt1+vTb1WAmk+hxOzUjumOrTMLkuVTXtCdgMmHJTux2nxt/Ml88Xptat+vwCzw0qdQAmCh2lPNZBsTJluU8ySsDazdhf6j1sts5cVS548P75d+qE/vrMTw8v+28ZXIAB3ABiAHZIEV4HkMLQJBIv5nAPq180UQOlmCAAAAAElFTkSuQmCC') no-repeat;
padding-left: 20px;
margin-bottom: 5px;
}
ul.verifications > li {
margin: 7px 0 7px 0;
}
table {
width: 100%;
border-collapse: collapse;
}
table,th,tr,td {
border: 1px solid #ccc;
text-align: left;
vertical-align: top;
padding: 8px 15px;
}
tr:nth-child(odd) {
background-color: #fafafa;
}
a { color: #187dbb; text-decoration: none; }
a:visited { color: #004b87; text-decoration: none; }
a:hover { color: #004b87; text-decoration: underline;}
code {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}
.reportTitle {
min-height: 52px;
background: #2f7eb2;
}
.reportBody {
padding: 0 15px 0 15px;
}
/*Classes that are used by HTML that is added dynamically by the report generator */
.detailsWorkaround {
padding: 10px 0px;
}
.detailsWorkaroundHeader {
padding-right: 5px;
font-weight: bold;
}
.hidden {
display: none;
}
.visible {
display: block;
}
.showMore {
margin-top: 5px;
}
</style>
</head>
<body>
<div class="reportTitle">
<h1>Migration Report for <code>EZviewGui</code></h1>
</div>
<div class="reportBody">
<section>
<h3>Your GUIDE app was migrated to App Designer and is ready for validation.</h3>
<h2>Migration Results</h2>
<ul class="childHasIcon">
<li class="success"><b>EZviewGui_App.mlapp</b> file created</li>
<li class="success"><b>2105</b> lines of code analyzed in EZviewGui.m</li>
<li class="success"><b>161</b> components created and initialized</li>
<li class="success"><b>75</b> callbacks and utility functions configured and enabled to function in App Designer</li>
</ul>
</section>
<section>
<h2>Validate Your Migrated App</h2>
<p>The migration tool enables most of your app code to execute. Now, you need to fully validate your migrated app to make sure it behaves as expected. Consider doing the following verifications:</p>
<ul>
<li>Verify Layout
<ul class="verifications">
<li>Run your app and verify the initial layout of all components is as expected.</li>
<li>If your app dynamically shows, hides, or enables additional components or options in response to selections made within the app, confirm these behave as expected.</li>
</ul>
</li>
<li>Verify Callbacks
<ul class="verifications">
<li>Run and close your app to confirm there are no startup or termination errors.</li>
<li>Exercise the workflows specific to your app, starting with the most basic, and gradually proceeding to the more complex ones.</li>
</ul>
</li>
</ul>
<p>If unexpected errors occur, either within the app or at the MATLAB command line, address those issues before continuing with the validation. For troubleshooting assistance and additional information, see <a href="matlab:helpview(fullfile(docroot,'matlab', 'creating_guis', 'differences-between-app-designer-and-guide.html#mw_7f306e19-74d0-4c0b-989d-74ed63e32ddd'));">GUIDE Migration Strategies</a>.</p>
</section>
</div>
<script type="text/javascript">
// Toggles showing the "Show More (10)" hyperlink with the "Show less" hyperlink
function toggleShowMore(selectedHyperlink) {
// Find the parent td for the selected hyperlink ("Show more" or "Show less")
var td = selectedHyperlink.parentElement.parentElement;
// Toggle the "hidden" class on all of the elements but the first 3. The first 3 we want to always be
// visible.
var tags = td.children;
for (var i=3; i<tags.length; i++) {
tags[i].classList.toggle("hidden");
}
}
</script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,240 @@
%Quickview of Exp Images one from each folder at selected timept
function QkVexps %QkviewImages
w=pwd;
[Selfile, pathname]=uigetfile({'*.bmp';'*.tif';'*.*'},'Select timepoint file','MultiSelect','off');
cd(pathname)
flist=dir
cd ..
ExpFdr=pwd
cd ..
EstudyDir=pwd
ExpList= dir;
cd(w)
day=[];
Dpos=[];
%Determine if Exps grouped into Day folders
studyNum=1;
dayIndx=0;
studyIndx=0;
for i=1:size(ExpList,1)
if ~isequal(ExpList(i).name,'.DS_Store') %|| ~strfind(ExpList(i),'DS')
Dpos=max(strfind(ExpList(i).name,'D'));
if ~isempty(Dpos)
tmpExpName=ExpList(i).name;
if isempty(day)
if isnumeric(str2double(tmpExpName((Dpos+1):end)))
dayIndx=dayIndx+1;
day(dayIndx)= str2double(tmpExpName((Dpos+1):end));
daytx{dayIndx}= strcat('D',(tmpExpName((Dpos+1):end)));
studyIndx=studyIndx+1;
dayLst(dayIndx).study{studyIndx}= tmpExpName;
end
elseif sum(day==(str2double(tmpExpName((Dpos+1):end))))>0 %capture the experimentNames into studyLst sets
studyIndx=studyIndx+1;
dayLst(dayIndx).study{studyIndx}= tmpExpName;
elseif sum(day==(str2double(tmpExpName((Dpos+1):end))))==0 %capture the daynumber as a number
dayIndx=dayIndx+1;
day(dayIndx)= str2num(tmpExpName((Dpos+1):end)); %if the daynumber is unique store in day vector
daytx{dayIndx}= strcat('D',(tmpExpName((Dpos+1):end)));
studyIndx=1;
dayLst(dayIndx).study{studyIndx}= tmpExpName;
end %if isempty(day)
end %if ~isempty(Dpos)
end %if ~isequal(ExpList(i),'.DS_Store')
end %for i=1:size(ExpList,1)
nonstdDdirFlg=0
if length(day)==1
nonstdDirFlg=1;
else
nonstdDirFlg=0;
end
if nonstdDirFlg==0
cd(EstudyDir)
%for i=1:size(ExpList,1)
for i=1:length(dayLst)
for j=1:length(dayLst(i).study)
curDay= daytx(i)
curExp= char(dayLst(i).study(j))
curExpNumName= strcat('StudyExp',num2str(j));
cd (fullfile(EstudyDir,curExp))
curExpDir=pwd;
plateDir=dir;
for k=1:length(plateDir)
if ~isequal(plateDir(k).name,'.DS_Store') %if .DS_Store Apple indiosyncratic fix
if isnumeric(str2double(plateDir(k).name)) && ~isnan(str2double(plateDir(k).name)),
curPlate= plateDir(k).name;
cd (fullfile(curExpDir,curPlate))
curPlateDir=pwd;
%end
try
dotPos= strfind(Selfile,'.')
tptx= (Selfile(1:dotPos-1));
dstFileName= char(strcat('T',tptx,curDay,'_',curExp,'P',curPlate,'_',Selfile))
curPlateName=strcat('Plate',curPlate)
mkdir(fullfile(EstudyDir,'QkVstudySets',curExpNumName,curPlateName))
copyfile(fullfile(curPlateDir,Selfile),fullfile(EstudyDir,'QkVstudySets',curExpNumName,curPlateName,dstFileName))
catch
end
end %if isnumeric(str2double(plateDirNonstd(k).name)),
end %if .DS_Store Apple indiosyncratic fix
end %for k=1:length(plateDir)
end %j=1:length(dayLst(i).study) for i=1:length(dayDirLst)
end %i=1:length(dayLst) for i=1:size(ExpList,1)
end %if nonstdDirFlg==0
%****************************************************************************
% Begin nonstandard Directory structure code
%****************************************************************************
if nonstdDirFlg==1
cd(EstudyDir)
cd ..
studyDirNonstd=pwd;
%mkdir(fullfile(studyDirNonstd,'QuikView'))
dayDirLst=dir;
for i=1:length(dayDirLst)
if ~isequal(dayDirLst(i).name,'.DS_Store') %if .DS_Store Apple indiosyncratic fix
if (strfind(dayDirLst(i).name,'Day')),
curDay= dayDirLst(i).name;
cd (fullfile(studyDirNonstd,curDay))
%curStudyDaynonStd=pwd
expDirNonstd=dir
expNum=0;
for j=1:length(expDirNonstd)
if ~isequal(expDirNonstd(j).name,'.DS_Store') %if .DS_Store Apple indiosyncratic fix
if (strfind(expDirNonstd(j).name,'D')),
curExp= expDirNonstd(j).name;
expNum=expNum+1;
curExpNumName= strcat('StudyExp',num2str(expNum));
cd (fullfile(studyDirNonstd,curDay,curExp))
curExpDir=pwd;
%end
plateDirNonstd=dir;
for k=1:length(plateDirNonstd)
if ~isequal(plateDirNonstd(k).name,'.DS_Store') %if .DS_Store Apple indiosyncratic fix
if isnumeric(str2double(plateDirNonstd(k).name)) && ~isnan(str2double(plateDirNonstd(k).name)),
curPlate= plateDirNonstd(k).name;
cd (fullfile(curExpDir,curPlate))
curPlateDir=pwd;
try
dotPos= strfind(Selfile,'.')
tptx= (Selfile(1:dotPos-1));
dstFileName= strcat('T',tptx,curDay,'_',curExp,'P',curPlate,'_',Selfile)
curPlateName=strcat('Plate',curPlate)
mkdir(fullfile(studyDirNonstd,'QkVstudySets',curExpNumName,curPlateName))
copyfile(fullfile(curPlateDir,Selfile),fullfile(studyDirNonstd,'QkVstudySets',curExpNumName,curPlateName,dstFileName))
catch
end
end %if isnumeric(str2double(plateDirNonstd(k).name)),
end %if (k) .DS_Store Apple indiosyncratic fix
end %for k=1:length(plateDirNonstd)
end%if (strfind(expDirNonstd(j).name,'D'))
end %if (j).DS_Store Apple indiosyncratic fix
end %for j=1:length(expDirNonstd)
end %if (strfind(dayDirLst(i).name,'Day')),
end %if (i).DS_Store Apple indiosyncratic fix
end %for i=1:length(dayDirLst)
end %if nonstdFlg
cd(w)
end
%{
nonstdDdirFlg=0
if length(day)==1
nonstdDirFlg=1;
%mkdir(fullfile(ExpFdr,'QkVstudySets'))
%Experiments are grouped together in subfolders by the day
%What if experiment are run on approximately the same day
%but differ by say a day or two???
else
nonstdDirFlg=0;
%Experiments are all together in the standard way
%What if experiment are run on approximately the same day
%but differ by say a day or two???
%The user will have to label experiments the same which are
%to be grouped together even if not on the same day.
end
%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
cd(w)
m=1;
for i=1:size(flist,1)
if isequal(Selfile,flist(i).name)
fnum=m
break
end
m=m+1
end
%Select Image folders ++++++++++++++++++++++++
d = dir(ExpFdr);
Scname={};
n=1;
for i=1:size(d,1)
if ~isempty(str2num(d(i).name))...
||~isempty(strfind(d(i).name,'Scan'))
Scname{n}=d(i).name
n=n+1
end
end
Srtnum=sort(str2double(Scname))
clear Srtname
for i=1:length(Srtnum)
Srtname{i}=num2str(Srtnum(i));
end
%str = {Scname};
[s,v] = listdlg('PromptString','Select a file:',...
'SelectionMode','multiple',...
'ListString',Srtname)
%*********************************************************************
%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%++++++++++++++++++++++++++++++
%Copy selected files to \QuikView Dir
mkdir(fullfile(ExpFdr,'QuikView'))
for j=1:size(s,2)
srcDir= fullfile(ExpFdr,num2str(s(j)))
%if Scan dir then must do something else to select '002' etc.
try
dstFileName= strcat(num2str(s(j)),'_',Selfile)
copyfile(fullfile(srcDir,Selfile),fullfile(ExpFdr,'QuikView',dstFileName))
catch
sFileLst= dir(srcDir)
selNumFile=sFileLst(fnum).name
dstFileName= strcat(num2str(s(j)),'_',selNumFile)
copyfile(fullfile(srcDir,selNumFile),fullfile(ExpFdr,'QuikView',dstFileName))
end
end
cd(w)
end
%}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,20 @@
[0114/114914.583:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0115/114914.592:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0117/124905.500:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0118/124910.053:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0119/124908.617:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0120/124908.618:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0121/124908.623:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0122/124908.625:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0123/124908.633:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0124/124911.115:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0125/124911.117:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0126/124909.914:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0127/124909.914:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0128/124909.916:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0129/124909.917:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0130/124906.192:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0131/124911.061:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0201/124909.461:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0202/124909.461:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0203/124909.461:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)

View File

@@ -0,0 +1,22 @@
%tif2jpeg converter
[Scanfiles, pathname]=uigetfile('*', 'Select a Folder File');
path=pathname;
dirLst=dir(path);
for i=1:size(dirLst,1)
if ~isempty(str2num(dirLst(i).name))
selDir=fullfile(path,dirLst(i).name);
filelst=dir(selDir);
for n=1:size(filelst,1)
try
if ~isempty(strfind(filelst(n).name,'bmp'))
inFile=filelst(n).name;
a=imread(fullfile(selDir,inFile)); %(inFile{1});
outFile= strrep(inFile,'.bmp','.jpg');
imwrite(a,fullfile(selDir,outFile), 'quality',95)
end
catch
end
end
end %if ~isempty(str2num(dirLst(i).name))
end %for all numeric folders

View File

@@ -0,0 +1,310 @@
function varargout = gui_mainfcn(gui_State, varargin)
% GUI_MAINFCN Support function for creation and callback dispatch of GUIDE GUIs.
% GUI_MAINFCN is called from inside M-files generated by GUIDE to handle
% GUI creation, layout, and callback dispatch.
%
% See also: GUIDE.
% GUI_MAINFCN provides these command line APIs for dealing with GUIs
%
% UNTITLED, by itself, creates a new UNTITLED or raises the existing
% singleton*.
%
% H = UNTITLED returns the handle to a new UNTITLED or the handle to
% the existing singleton*.
%
% UNTITLED('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in UNTITLED.M with the given input arguments.
%
% UNTITLED('Property','Value',...) creates a new UNTITLED or raises the
% existing singleton*. Starting from the left, property value pairs
% are
% applied to the GUI before untitled_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to untitled_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
% Copyright 1984-2006 The MathWorks, Inc.
% $Revision: 1.1.6.9 $ $Date: 2010/07/27 21:08:12 $
global ghandles
gui_StateFields = {'gui_Name'
'gui_Singleton'
'gui_OpeningFcn'
'gui_OutputFcn'
'gui_LayoutFcn'
'gui_Callback'};
gui_Mfile = '';
for i=1:length(gui_StateFields)
if ~isfield(gui_State, gui_StateFields{i})
error('MATLAB:gui_mainfcn:FieldNotFound', 'Could not find field %s in the gui_State struct in GUI M-file %s', gui_StateFields{i}, gui_Mfile);
elseif isequal(gui_StateFields{i}, 'gui_Name')
gui_Mfile = [gui_State.(gui_StateFields{i}), '.m'];
end
end
numargin = length(varargin);
if numargin == 0
% UNTITLED
% create the GUI only if we are not in the process of loading it
% already
gui_Create = true;
elseif local_isInvokeActiveXCallback(gui_State, varargin{:})
% UNTITLED(ACTIVEX,...)
vin{1} = gui_State.gui_Name;
vin{2} = [get(varargin{1}.Peer, 'Tag'), '_', varargin{end}];
vin{3} = varargin{1};
vin{4} = varargin{end-1};
vin{5} = guidata(varargin{1}.Peer);
feval(vin{:});
return;
elseif local_isInvokeHGCallback(gui_State, varargin{:})
% UNTITLED('CALLBACK',hObject,eventData,handles,...)
gui_Create = false;
else
% UNTITLED(...)
% create the GUI and hand varargin to the openingfcn
gui_Create = true;
end
if ~gui_Create
% In design time, we need to mark all components possibly created in
% the coming callback evaluation as non-serializable. This way, they
% will not be brought into GUIDE and not be saved in the figure file
% when running/saving the GUI from GUIDE.
designEval = false;
if (numargin>1 && ishghandle(varargin{2}))
fig = varargin{2};
while ~isempty(fig) && ~ishghandle(fig,'figure')
fig = get(fig,'parent');
end
designEval = isappdata(0,'CreatingGUIDEFigure') || isprop(fig,'__GUIDEFigure');
end
if designEval
beforeChildren = findall(fig);
end
% evaluate the callback now
varargin{1} = gui_State.gui_Callback;
if nargout
[varargout{1:nargout}] = feval(varargin{:});
else
feval(varargin{:});
end
% Set serializable of objects created in the above callback to off in
% design time. Need to check whether figure handle is still valid in
% case the figure is deleted during the callback dispatching.
if designEval && ishghandle(fig)
set(setdiff(findall(fig),beforeChildren), 'Serializable','off');
end
else
if gui_State.gui_Singleton
gui_SingletonOpt = 'reuse';
else
gui_SingletonOpt = 'new';
end
% Check user passing 'visible' P/V pair first so that its value can be
% used by oepnfig to prevent flickering
gui_Visible = 'auto';
gui_VisibleInput = '';
for index=1:2:length(varargin)
if length(varargin) == index || ~ischar(varargin{index})
break;
end
% Recognize 'visible' P/V pair
len1 = min(length('visible'),length(varargin{index}));
len2 = min(length('off'),length(varargin{index+1}));
if ischar(varargin{index+1}) && strncmpi(varargin{index},'visible',len1) && len2 > 1
if strncmpi(varargin{index+1},'off',len2)
gui_Visible = 'invisible';
gui_VisibleInput = 'off';
elseif strncmpi(varargin{index+1},'on',len2)
gui_Visible = 'visible';
gui_VisibleInput = 'on';
end
end
end
% Open fig file with stored settings. Note: This executes all component
% specific CreateFunctions with an empty HANDLES structure.
% Do feval on layout code in m-file if it exists
gui_Exported = ~isempty(gui_State.gui_LayoutFcn);
% this application data is used to indicate the running mode of a GUIDE
% GUI to distinguish it from the design mode of the GUI in GUIDE. it is
% only used by actxproxy at this time.
setappdata(0,genvarname(['OpenGuiWhenRunning_', gui_State.gui_Name]),1);
if gui_Exported
gui_hFigure = feval(gui_State.gui_LayoutFcn, gui_SingletonOpt);
% make figure invisible here so that the visibility of figure is
% consistent in OpeningFcn in the exported GUI case
if isempty(gui_VisibleInput)
gui_VisibleInput = get(gui_hFigure,'Visible');
end
set(gui_hFigure,'Visible','off')
% openfig (called by local_openfig below) does this for guis without
% the LayoutFcn. Be sure to do it here so guis show up on screen.
movegui(gui_hFigure,'onscreen');
else
gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt, gui_Visible);
% If the figure has InGUIInitialization it was not completely created
% on the last pass. Delete this handle and try again.
if isappdata(gui_hFigure, 'InGUIInitialization')
delete(gui_hFigure);
gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt, gui_Visible);
end
end
if isappdata(0, genvarname(['OpenGuiWhenRunning_', gui_State.gui_Name]))
rmappdata(0,genvarname(['OpenGuiWhenRunning_', gui_State.gui_Name]));
end
% Set flag to indicate starting GUI initialization
setappdata(gui_hFigure,'InGUIInitialization',1);
% Fetch GUIDE Application options
gui_Options = getappdata(gui_hFigure,'GUIDEOptions');
% Singleton setting in the GUI M-file takes priority if different
gui_Options.singleton = gui_State.gui_Singleton;
if ~isappdata(gui_hFigure,'GUIOnScreen')
% Adjust background color
if gui_Options.syscolorfig
set(gui_hFigure,'Color', get(0,'DefaultUicontrolBackgroundColor'));
end
% Generate HANDLES structure and store with GUIDATA. If there is
% user set GUI data already, keep that also.
data = guidata(gui_hFigure);
handles = guihandles(gui_hFigure);
if ~isempty(handles)
if isempty(data)
data = handles;
else
names = fieldnames(handles);
for k=1:length(names)
data.(char(names(k)))=handles.(char(names(k)));
end
end
end
guidata(gui_hFigure, data);
end
% Apply input P/V pairs other than 'visible'
for index=1:2:length(varargin)
if length(varargin) == index || ~ischar(varargin{index})
break;
end
len1 = min(length('visible'),length(varargin{index}));
if ~strncmpi(varargin{index},'visible',len1)
try set(gui_hFigure, varargin{index}, varargin{index+1}), catch break, end
end
end
% If handle visibility is set to 'callback', turn it on until finished
% with OpeningFcn
gui_HandleVisibility = get(gui_hFigure,'HandleVisibility');
if strcmp(gui_HandleVisibility, 'callback')
set(gui_hFigure,'HandleVisibility', 'on');
end
feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});
if isscalar(gui_hFigure) && ishghandle(gui_hFigure)
% Handle the default callbacks of predefined toolbar tools in this
% GUI, if any
guidemfile('restoreToolbarToolPredefinedCallback',gui_hFigure);
% Update handle visibility
set(gui_hFigure,'HandleVisibility', gui_HandleVisibility);
% Call openfig again to pick up the saved visibility or apply the
% one passed in from the P/V pairs
if ~gui_Exported
gui_hFigure = local_openfig(gui_State.gui_Name, 'reuse',gui_Visible);
elseif ~isempty(gui_VisibleInput)
set(gui_hFigure,'Visible',gui_VisibleInput);
end
if strcmpi(get(gui_hFigure, 'Visible'), 'on')
figure(gui_hFigure);
if gui_Options.singleton
setappdata(gui_hFigure,'GUIOnScreen', 1);
end
end
% Done with GUI initialization
if isappdata(gui_hFigure,'InGUIInitialization')
rmappdata(gui_hFigure,'InGUIInitialization');
end
% If handle visibility is set to 'callback', turn it on until
% finished with OutputFcn
gui_HandleVisibility = get(gui_hFigure,'HandleVisibility');
if strcmp(gui_HandleVisibility, 'callback')
set(gui_hFigure,'HandleVisibility', 'on');
end
gui_Handles = guidata(gui_hFigure);
else
gui_Handles = [];
end
if nargout
[varargout{1:nargout}] = feval(gui_State.gui_OutputFcn, gui_hFigure, [], gui_Handles);
else
feval(gui_State.gui_OutputFcn, gui_hFigure, [], gui_Handles);
end
if isscalar(gui_hFigure) && ishghandle(gui_hFigure)
set(gui_hFigure,'HandleVisibility', gui_HandleVisibility);
end
end
function gui_hFigure = local_openfig(name, singleton, visible)
% openfig with three arguments was new from R13. Try to call that first, if
% failed, try the old openfig.
if nargin('openfig') == 2
% OPENFIG did not accept 3rd input argument until R13,
% toggle default figure visible to prevent the figure
% from showing up too soon.
gui_OldDefaultVisible = get(0,'defaultFigureVisible');
set(0,'defaultFigureVisible','off');
gui_hFigure = openfig(name, singleton);
set(0,'defaultFigureVisible',gui_OldDefaultVisible);
else
gui_hFigure = openfig(name, singleton, visible);
end
function result = local_isInvokeActiveXCallback(gui_State, varargin)
try
result = ispc && iscom(varargin{1}) ...
&& isequal(varargin{1},gcbo);
catch
result = false;
end
function result = local_isInvokeHGCallback(gui_State, varargin)
try
fhandle = functions(gui_State.gui_Callback);
result = ~isempty(findstr(gui_State.gui_Name,fhandle.file)) || ...
(ischar(varargin{1}) ...
&& isequal(ishghandle(varargin{2}), 1) ...
&& (~isempty(strfind(varargin{1},[get(varargin{2}, 'Tag'), '_'])) || ...
~isempty(strfind(varargin{1}, '_CreateFcn'))) );
catch
result = false;
end

View File

@@ -0,0 +1,105 @@
function h = histfitJR(data,nbins,dist)
%HISTFIT Histogram with superimposed fitted normal density.
% HISTFIT(DATA,NBINS) plots a histogram of the values in the vector DATA,
% along with a normal density function with parameters estimated from the
% data. NBINS is the number of bars in the histogram. With one input
% argument, NBINS is set to the square root of the number of elements in
% DATA.
%
% HISTFIT(DATA,NBINS,DIST) plots a histogram with a density from the DIST
% distribution. DIST can take the following values:
%
% 'beta' Beta
% 'birnbaumsaunders' Birnbaum-Saunders
% 'exponential' Exponential
% 'extreme value' or 'ev' Extreme value
% 'gamma' Gamma
% 'generalized extreme value' 'gev' Generalized extreme value
% 'generalized pareto' or 'gp' Generalized Pareto (threshold 0)
% 'inverse gaussian' Inverse Gaussian
% 'logistic' Logistic
% 'loglogistic' Log logistic
% 'lognormal' Lognormal
% 'negative binomial' or 'nbin' Negative binomial
% 'nakagami' Nakagami
% 'normal' Normal
% 'poisson' Poisson
% 'rayleigh' Rayleigh
% 'rician' Rician
% 'tlocationscale' t location-scale
% 'weibull' or 'wbl' Weibull
%
% H = HISTFIT(...) returns a vector of handles to the plotted lines.
% H(1) is a handle to the histogram, H(2) is a handle to the density curve.
% Copyright 1993-2008 The MathWorks, Inc.
% $Revision: 1.1.8.2.2.1 $ $Date: 2010/12/13 15:00:40 $
if ~isvector(data)
error(message('stats:histfit:VectorRequired'));
end
data = data(:);
data(isnan(data)) = [];
n = numel(data);
if nargin<2 || isempty(nbins)
nbins = ceil(sqrt(n));
elseif ~isscalar(nbins) || ~isnumeric(nbins) || ~isfinite(nbins) ...
|| nbins~=round(nbins)
error(message('stats:histfit:BadNumBins'))
end
% Do histogram calculations
[bincounts,bincenters]=hist(data,nbins);
% Fit distribution to data
if nargin<3 || isempty(dist)
dist = 'normal';
end
try
pd = fitdist(data,dist);
catch myException
if isequal(myException.identifier,'stats:ProbDistUnivParam:fit:NRequired')
% Binomial is not allowed because we have no N parameter
error(message('stats:histfit:BadDistribution'))
else
% Pass along another other errors
throw(myException)
end
end
% Find range for plotting
q = icdf(pd,[0.0013499 0.99865]); % three-sigma range for normal distribution
x = linspace(q(1),q(2));
if ~pd.Support.iscontinuous
% For discrete distribution use only integers
x = round(x);
x(diff(x)==0) = [];
end
% Plot the histogram with no gap between bars.
%if min(data)==0, neglim=-50; else neglim= min(data); end
%hh = bar(bincenters,bincounts,[neglim,max(data)],'hist');
hh = bar(bincenters,bincounts,[min(data),max(data)],'hist');
% Normalize the density to match the total area of the histogram
xd = get(hh,'Xdata'); % Gets the x-data of the bins.
if min(xd(:))==0, neglim = -50; else neglim= min(xd(:)); end
%rangex = max(xd(:)) - min(xd(:)); % Finds the range of this data.
rangex = max(xd(:)) - (neglim); % Finds the range of this data.
binwidth = rangex/nbins; % Finds the width of each bin.
area = n * binwidth;
y = area * pdf(pd,x);
% Overlay the density
np = get(gca,'NextPlot');
set(gca,'NextPlot','add')
hh1 = plot(x,y,'r-','LineWidth',2);
set(hh1,'visible','off')
if nargout == 1
h = [hh; hh1];
end
set(gca,'NextPlot',np)

View File

@@ -0,0 +1,37 @@
%Determine ankle Inflection Point for S curve
K=132.9
r=.144
l=52.71
syms t;
ff= K / (1 + exp(-r* (t - l )));
f3= diff(diff(diff(ff)));
sInfPts= double(solve(f3))
%InflectPts=double(sInfPts)
InflectPt1= min(double(sInfPts))
f1=diff(ff)
f4= diff(diff(diff(diff(ff))))
sInfPts4= double(solve(f4))
InflectPt41= min(double(sInfPts4))
%{
f5= diff(diff(diff(diff(diff(ff)))));
sInfPts5= double(solve(f5))
InflectPt51= min(double(sInfPts5))
f6= diff(diff(diff(diff(diff(diff(ff))))));
sInfPts6= double(solve(f6))
InflectPt61= min(double(sInfPts6))
f7= diff(diff(diff(diff(diff(ff)))));
sInfPts7= double(solve(f7))
InflectPt71= min(double(sInfPts7))
%}

View File

@@ -0,0 +1,137 @@
function axReturn = newplot(hsave)
%NEWPLOT Prepares figure, axes for graphics according to NextPlot.
% H = NEWPLOT returns the handle of the prepared axes.
% H = NEWPLOT(HSAVE) prepares and returns an axes, but does not
% delete any objects whose handles appear in HSAVE. If HSAVE is
% specified, the figure and axes containing HSAVE are prepared
% instead of the current axes of the current figure. If HSAVE is
% empty, NEWPLOT behaves as if it were called without any inputs.
%
% NEWPLOT is a standard preamble command that is put at
% the beginning of graphics functions that draw graphs
% using only low-level object creation commands. NEWPLOT
% "does the right thing" in terms of determining which axes and/or
% figure to draw the plot in, based upon the setting of the
% NextPlot property of axes and figure objects, and returns a
% handle to the appropriate axes.
%
% The "right thing" is:
%
% First, prepare a figure for graphics:
% Clear and reset the current figure using CLF RESET if its NextPlot
% is 'replace', or clear the current figure using CLF if its
% NextPlot is 'replacechildren', or reuse the current figure as-is
% if its NextPlot is 'add', or if no figures exist, create a figure.
% When the figure is prepared, set its NextPlot to 'add', and then
% prepare an axes in that figure:
% Clear and reset the current axes using CLA RESET if its NextPlot
% is 'replace', or clear the current axes using CLA if its NextPlot
% is 'replacechildren', or reuse the current axes as-is if its
% NextPlot is 'add', or if no axes exist, create an axes.
%
% See also HOLD, ISHOLD, FIGURE, AXES, CLA, CLF.
% Copyright 1984-2010 The MathWorks, Inc.
% Built-in function.
if nargin == 0 || isempty(hsave)
hsave = [];
elseif ~isscalar(hsave) || ~ishghandle(hsave)
error(message('MATLAB:newplot:InvalidHandle'))
end
fig = [];
ax = [];
if ~isempty(hsave)
obj = hsave;
while ~isempty(obj)
if strcmp(get(obj,'type'),'figure')
fig = obj;
elseif strcmp(get(obj,'type'),'axes')
ax = obj;
end
obj = get(obj,'parent');
end
end
if isempty(fig)
fig = gcf;
end
fig = ObserveFigureNextPlot(fig, hsave);
% for clay
set(fig,'nextplot','add');
if isempty(ax)
ax = gca(fig);
elseif ~any(ishghandle(ax))
error(message('MATLAB:newplot:NoAxesParent'))
end
ax = ObserveAxesNextPlot(ax, hsave);
if nargout
axReturn = ax;
end
function fig = ObserveFigureNextPlot(fig, hsave)
%
% Helper fcn for preparing figure for nextplot, optionally
% preserving specific existing descendants.
% GUARANTEED to return a figure, even if some crazy combination
% of create / delete fcns deletes it.
%
switch get(fig,'nextplot')
case 'new'
% if someone calls plot(x,y,'parent',h) and h is an axes
% in a figure with NextPlot 'new', ignore the 'new' and
% treat it as 'add' - just add the axes to that figure.
if isempty(hsave)
fig = figure;
end
case 'replace'
clf(fig, 'reset', hsave);
case 'replacechildren'
clf(fig, hsave);
case 'add'
% nothing
end
if ~any(ishghandle(fig)) && isempty(hsave)
fig = figure;
end
function ax = ObserveAxesNextPlot(ax, hsave)
%
% Helper fcn for preparing axes for nextplot, optionally
% preserving specific existing descendants
% GUARANTEED to return an axes in the same figure as the passed-in
% axes, even if that axes gets deleted by an overzealous create or
% delete fcn anywhere in the figure.
%
% for performance only call ancestor when needed
fig = get(ax,'Parent');
if ~strcmp(get(fig,'Type'),'figure')
fig = ancestor(fig,'figure');
end
switch get(ax,'nextplot')
case 'replace'
cla(ax, 'reset',hsave);
case 'replacechildren'
cla(ax, hsave);
case 'add'
% nothing
end
if ~any(ishghandle(ax)) && isempty(hsave)
if ~any(ishghandle(fig))
ax = axes;
else
ax = axes('parent',fig);
end
end

View File

@@ -0,0 +1,20 @@
[0114/114914.583:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0115/114914.592:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0117/124905.500:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0118/124910.053:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0119/124908.617:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0120/124908.618:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0121/124908.623:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0122/124908.625:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0123/124908.633:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0124/124911.115:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0125/124911.117:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0126/124909.914:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0127/124909.914:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0128/124909.916:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0129/124909.917:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0130/124906.192:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0131/124911.061:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0201/124909.461:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0202/124909.461:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
[0203/124909.461:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,72 @@
#!/usr/bin/env python
# This code is to concatenate the batch GO Term Finder results (.tsv) generated from batch GTF perl code(Chris Johnson, U of Tulsa) into a list table
import sys, os, string, glob
# return the file list
def list_all_files(Path):
list_all_files = []
list_all_files = glob.glob(Path +'/*.txt.tsv')
return list_all_files
# Main function
try:
data_file_Path = sys.argv[1]
output_file_Path = sys.argv[2]
except:
print 'Usage: python Concatenate_GTF_results.py /datasetPath /outputFilePath_and_Name'
print 'Data file not found, error in given directory'
sys.exit(1)
# Open the output file
try:
output = open(output_file_Path, 'w')
except OSError:
print 'output file error'
# get all the GTF result files in given directory
File_list = []
File_list = list_all_files(data_file_Path)
File_list.sort()
i = 0
for file in File_list:
#parse the file names given in absolute path
file_name = file.strip().split('/')[-1]
file_name = file_name.rstrip('.txt.tsv')
# function to read tsv files from a given directory
#open the file
data = open(file,'r')
#reading the label line
labelLine = data.readline()
label = labelLine.strip().split('\t')
#write the label
#updates2010July26: update following label writing code
if i == 0:
# output.write('cluster origin')
for element in label:
output.write(element)
output.write('\t')
i = i + 1
#updates2010July26 End
#switch to the next line
output.write('\n')
#read the GO terms
GOTermLines = data.readlines()
for GOTerm in GOTermLines:
GOTerm = GOTerm.strip().strip('\t')
if GOTerm != '':
#updates2010July26: remove the code to write the first column 'REMc cluster ID'
#output.write(file_name)
#output.write('\t')
##updates2010July26 update end
output.write(GOTerm + '\n')
#output.write('\n')
output.close()
print("local Process copy of Concatenate_GTF_results.py")

View File

@@ -0,0 +1,71 @@
#!/usr/bin/env python
# This code is to concatenate the batch GO Term Finder results (.tsv) generated from batch GTF perl code(Chris Johnson, U of Tulsa) into a list table
import sys, os, string, glob
# return the file list
def list_all_files(Path):
list_all_files = []
list_all_files = glob.glob(Path +'/*.txt.tsv')
return list_all_files
# Main function
try:
data_file_Path = sys.argv[1]
output_file_Path = sys.argv[2]
except:
print 'Usage: python Concatenate_GTF_results.py /datasetPath /outputFilePath_and_Name'
print 'Data file not found, error in given directory'
sys.exit(1)
# Open the output file
try:
output = open(output_file_Path, 'w')
except OSError:
print 'output file error'
# get all the GTF result files in given directory
File_list = []
File_list = list_all_files(data_file_Path)
File_list.sort()
i = 0
for file in File_list:
#parse the file names given in absolute path
file_name = file.strip().split('/')[-1]
file_name = file_name.rstrip('.txt.tsv')
# function to read tsv files from a given directory
#open the file
data = open(file,'r')
#reading the label line
labelLine = data.readline()
label = labelLine.strip().split('\t')
#write the label
#updates2010July26: update following label writing code
if i == 0:
# output.write('cluster origin')
for element in label:
output.write(element)
output.write('\t')
i = i + 1
#updates2010July26 End
#switch to the next line
output.write('\n')
#read the GO terms
GOTermLines = data.readlines()
for GOTerm in GOTermLines:
GOTerm = GOTerm.strip().strip('\t')
if GOTerm != '':
#updates2010July26: remove the code to write the first column 'REMc cluster ID'
#output.write(file_name)
#output.write('\t')
##updates2010July26 update end
output.write(GOTerm + '\n')
#output.write('\n')
output.close()

View File

@@ -0,0 +1,188 @@
#GTA (GoTermAveraging) Starting (Working Directory is /Code) All paths relative to /Code
#Currently must run for each Experiment. _Future could loop thru the number of experiments involved in study. JWR
Wstudy= getwd()
if (file.exists('../Exp2/ZScores/ZScores_Interaction.csv')){
inputFile <- '../Exp1/ZScores/ZScores_Interaction.csv'
expName= "Exp1"
dir.create("../GTAresults/Exp1")
}
if (file.exists('../Exp2/ZScores/ZScores_Interaction.csv')){
inputFile[2] <- '../Exp2/ZScores/ZScores_Interaction.csv'
expName[2]= "Exp2"
dir.create("../GTAresults/Exp2")
}
if (file.exists('../Exp3/ZScores/ZScores_Interaction.csv')){
inputFile[3] <- '../Exp3/ZScores/ZScores_Interaction.csv'
expName[3]= "Exp3"
dir.create("../GTAresults/Exp3")
}
if (file.exists('../Exp4/ZScores/ZScores_Interaction.csv')){
inputFile[4] <- '../Exp4/ZScores/ZScores_Interaction.csv'
expName[4]= "Exp4"
dir.create("../GTAresults/Exp4")
}
outputPathGTA= "../GTAresults"
#dir.create(outPathGTA)
library("stringr")
library("org.Sc.sgd.db")
library("plyr")
#build in command args to apply this code to a given !!results sheet
SGD_Terms_file <- "../Code/go_terms.tab" #ArgsScore[2]
#https://downloads.yeastgenome.org/curation/chromosomal_feature/gene_association.sgd
SGD_features_file <- "../Code/gene_association.sgd" #ArgsScore[3]
#R and Rstudio have issues: The for loop(189) seemed to fail to evaluate the paste (or paste0) to build the inputFile inside the for loop and bail as the second loop began. This crude fix below, seems to have alleviated the failure to loop problem at least for now. Also for some annoying reason, the underscores between word are sometimes not shown when they exist. No ryme of reason!!!
#Begin for loop for experiments in this study-----------------ZScores_Interaction.csv
for(m in 1:length(inputFile)){
#inputFile <- paste(Wstudy,"/",expName[m],'/ZScores/ZScores_Interaction.csv',sep="") #ArgsScore[1]
X <- read.csv(file = inputFile[m],stringsAsFactors=FALSE,header = TRUE)
if(colnames(X)[1] == "OrfRep"){
colnames(X)[1] <- "ORF"
}
#Terms is the GO term list
Terms <- read.delim(file = SGD_Terms_file,header=FALSE,quote = "",col.names = c("GO_ID","GO_Term","GO_Aspect","GO_Term_Definition"))
#all ORFs associated with GO term
GO2ALLORFs <- as.list(org.Sc.sgdGO2ALLORFS)
#Gene_Association is the gene association to GO term file
Gene_Association <- read.delim(SGD_features_file,skip=8,header=FALSE,quote="",col.names = c("Database","Database_Object_ID","Database_Object_Symbol","NOT","GO_ID","Database_Reference","Evidence","With_or_From","Aspect","Database_Object_Name","Database_Object_Synonym","Database_Object_Type","taxon","Date","Assigned_By","OtherInfo","Empty"))
#Get the ORF names associated with each gene/GO term
Gene_Association$ORF <- str_split_fixed(as.character(Gene_Association$Database_Object_Synonym),"\\|",2)[,1]
#Get the numeric GO ID for matching
Gene_Association$GO_ID_Numeric <- as.integer(str_split_fixed(as.character(Gene_Association$GO_ID),"\\:",2)[,2])
#get all unique GO terms
GO_Terms <- unique(Gene_Association$GO_ID)
#create a character vector with just the ColNames of the input file to store the scores for each GO term
Col_Names_X <- colnames(X)
#create a data_frame with header from input_file
GO_Term_Averages <- X[0,]
#fill table with NAs same length as number of GO terms
GO_Term_Averages[1:length(GO_Terms),] <- NA
#change the first and second col names to GO_ID and Term
colnames(GO_Term_Averages)[1] <- "GO_ID"
colnames(GO_Term_Averages)[2] <- "Term"
#create new columns for Ontology, number genes (used to calculate the avg score), all possible genes in the GO term, and print genes/ORFs used
GO_Term_Averages$Ontology <- NA
GO_Term_Averages$NumGenes <- NA
GO_Term_Averages$AllPossibleGenes <- NA
GO_Term_Averages$Genes <- NA
GO_Term_Averages$ORFs <- NA
#create a data.frame for the standard deviation info
GO_Term_SD <- X[0,]
GO_Term_SD[1:length(GO_Terms),] <- NA
colnames(GO_Term_SD)[1] <- "GO_ID"
colnames(GO_Term_SD)[2] <- "Term"
#Loop for each GO term to get an average L and K Z score
for(i in 1:length(GO_Terms)){
#get the GO_Term
ID <- GO_Terms[i]
#Get data.frame for all genes associated to the GO Term
ID_AllGenes <- Gene_Association[Gene_Association$GO_ID == ID,]
#get a vector of just the gene names
ID_AllGenes_vector <- as.vector(GO2ALLORFs[as.character(ID)][[1]])
if(length(unique(ID_AllGenes_vector)) > 4000){
next()
}
#get the GO term character description where numeric Terms ID matches GO_Term's ID
GO_Description_Term <- as.character(Terms[Terms$GO_ID %in% ID_AllGenes$GO_ID_Numeric,]$GO_Term[1])
#get the Z scores for all genes in the GO_ID
Zscores_For_ID <- X[X$ORF %in% ID_AllGenes_vector,]
#get the Gene names and ORFs for the term
GO_Term_Averages$Genes[i] <- paste(unique(Zscores_For_ID$Gene),collapse=" | ")
GO_Term_Averages$ORFs[i] <- paste(unique(Zscores_For_ID$ORF),collapse=" | ")
#dataframe to report the averages for a GO term
#get the GO ID
GO_Term_Averages$GO_ID[i] <- as.character(ID)
#get the term name
GO_Term_Averages$Term[i] <- GO_Description_Term
#get total number of genes annotated to the Term that we have in our library
GO_Term_Averages$NumGenes[i] <- length(unique(Zscores_For_ID$ORF))
#get total number of genes annotated to the Term in SGD
GO_Term_Averages$AllPossibleGenes[i] <- length(unique(ID_AllGenes_vector))
#get the ontology of the term
GO_Term_Averages$Ontology[i] <- as.character(ID_AllGenes$Aspect[1])
#calculate the average score for every column
for(j in 3:length(X[1,])){
GO_Term_Averages[i,j] <- mean(Zscores_For_ID[,j],na.rm = TRUE)
#GO_Scores <- colMeans(Zscores_For_ID[,3:length(X[1,])])
}
#also calculate same values for the SD
GO_Term_SD$GO_ID[i] <- as.character(ID)
#get the term name
GO_Term_SD$Term[i] <- GO_Description_Term
#calculate column scores for SD
for(j in 3:length(X[1,])){
GO_Term_SD[i,j] <- sd(Zscores_For_ID[,j],na.rm = TRUE)
#GO_Scores <- colMeans(Zscores_For_ID[,3:length(X[1,])])
}
}
#add either _Avg or _SD depending on if the calculated score is an average or SD
colnames(GO_Term_Averages) <- paste(colnames(GO_Term_Averages),"Avg", sep = "_")
colnames(GO_Term_SD) <- paste(colnames(GO_Term_SD),"SD", sep = "_")
#combine the averages with the SDs to make one big data.frame
X2 <- cbind(GO_Term_Averages,GO_Term_SD)
#test[ , order(names(test))]
X2 <- X2[,order(names(X2))]
X2 <- X2[!is.na(X2$Z_lm_L_Avg),]
#create output file
write.csv(X2,file=paste(outputPathGTA,"/",expName[m],"/Average_GOTerms_All.csv",sep=""),row.names=FALSE)
#remove NAs
X3 <- X2[!is.na(X2$Z_lm_L_Avg),]
#identify redundant GO terms
for(i in 1:length(X3[,1])){
#loop through each GO term - get term
GO_term_ID <- as.character(X3$GO_ID_Avg[i])
#get term in the X3
X3_Temp <- X3[X3$GO_ID_Avg == GO_term_ID,]
#get anywhere that has the same number K_Avg value
X3_Temp2 <- X3[X3$Z_lm_K_Avg %in% X3_Temp,]
if(length(X3_Temp2[,1]) > 1){
if(length(unique(X3_Temp2$Genes_Avg)) == 1){
X3_Temp2 <- X3_Temp2[1,]
}
}
if(i == 1){
Y <- X3_Temp2
}
if(i > 1){
Y <- rbind(Y,X3_Temp2)
}
}
Y1 <- unique(Y)
write.csv(Y1,file=paste(outputPathGTA,"/",expName[m],"/Average_GOTerms_All_NonRedundantTerms.csv",sep=""),row.names = FALSE)
Y2 <- Y1[Y1$Z_lm_L_Avg >= 2 | Y1$Z_lm_L_Avg <= -2,]
Y2 <- Y2[!is.na(Y2$Z_lm_L_Avg),]
write.csv(Y2,file=paste(outputPathGTA,"/",expName[m],"/Average_GOTerms_NonRedundantTerms_Above2SD_L.csv",sep=""),row.names = FALSE)
Y3 <- Y2[Y2$NumGenes_Avg > 2,]
write.csv(Y3,file=paste(outputPathGTA,"/",expName[m],"/Average_GOTerms_NonRedundantTerms_Above2SD_L_Above2Genes.csv",sep=""),row.names = FALSE)
Y4 <- Y1[Y1$Z_lm_K_Avg >= 2 | Y1$Z_lm_K_Avg <= -2,]
Y4 <- Y4[!is.na(Y4$Z_lm_K_Avg),]
write.csv(Y4,file=paste(outputPathGTA,"/",expName[m],"/Average_GOTerms_NonRedundantTerms_Above2SD_K.csv",sep=""),row.names = FALSE)
Y5 <- Y4[Y4$NumGenes_Avg > 2,]
write.csv(Y5,file=paste(outputPathGTA,"/",expName[m],"/Average_GOTerms_NonRedundantTerms_Above2SD_K_Above2Genes.csv",sep=""),row.names = FALSE)
#End of 'for loop'
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,94 @@
#JoinCSVfilesREMc.R
#The input files should be entered in order from the greatest number of rows(Orfs) to least.
Args <- commandArgs(TRUE)
Wstudy= getwd()
dir.create("../JoinFiles") #(paste0(Wstudy,"/JoinFiles"))
outDir <- "../JoinFiles" #paste0(Wstudy,"/JoinFiles")
print(outDir)
#ArgsJoin= 'asdf'
#ArgsJoin[1]= "../JoinFiles"
#ArgsJoin[2]= "../Exp1/ZScores/ZScores_Interaction.csv" #paste0(Wstudy,"/Exp1/ZScores/ZScores_Interaction.csv")
#ArgsJoin[3]= "../Exp2/ZScores/ZScores_Interaction.csv" #paste0(Wstudy,"/Exp2/ZScores/ZScores_Interaction.csv")
#outDir <- ArgsJoin[1] #Output Directory
print(length(Args)) #display the number of arguments on terminal
#open required library for the join function (libraries must already be install on R)
library(plyr)
library(dplyr)
library(sos)
#read in the files for your experiment and
#join the two files at a time as a function of how many Args, list the larger file first ? in this example X2 has the larger number of genes.
#if X1 has a larger number of genes, switch the order of X1 and X2
if(length(Args)==2) {
X1 <- read.csv(file= Args[1],stringsAsFactors = FALSE)
X2 <- read.csv(file= Args[2],stringsAsFactors = FALSE)
X <- join(X1,X2,by="OrfRep")
OBH=X[,order(colnames(X))] #OrderByHeader
headSel= select(OBH, contains('OrfRep'), matches('Gene'), contains('Z_lm_K'), contains('Z_Shift_K'),contains('Z_lm_L'), contains('Z_Shift_L'))
headSel= select(headSel, -'Gene.1') #remove 'Gene.1 column
headSel2 = select(OBH, contains('OrfRep'), matches('Gene')) #Frame for interleaving Z_lm with Shift colums
headSel2 = select(headSel2, -'Gene.1') #remove 'Gene.1 column #Frame for interleaving Z_lm with Shift colums
}else if(length(Args)==3){
X1 <- read.csv(file= Args[1],stringsAsFactors = FALSE) #exp1File,stringsAsFactors = FALSE)
X2 <- read.csv(file= Args[2],stringsAsFactors = FALSE) #exp2File,stringsAsFactors = FALSE)
X3 <- read.csv(file= Args[3],stringsAsFactors = FALSE) #exp3File,stringsAsFactors = FALSE)
X <- join(X1,X2,by="OrfRep")
X <- join(X,X3,by="OrfRep")
OBH=X[,order(colnames(X))] #OrderByHeader
headSel= select(OBH, contains('OrfRep'), matches('Gene'), contains('Z_lm_K'), contains('Z_Shift_K'),contains('Z_lm_L'), contains('Z_Shift_L'))
headSel= select(headSel, -'Gene.1',-'Gene.2')
headSel2 = select(OBH, contains('OrfRep'), matches('Gene'))
headSel2 = select(headSel2, -'Gene.1',-'Gene.2')
}else if(length(Args==4)){
X1 <- read.csv(file= Args[1],stringsAsFactors = FALSE) #exp1File,stringsAsFactors = FALSE)
X2 <- read.csv(file= Args[2],stringsAsFactors = FALSE) #exp2File,stringsAsFactors = FALSE)
X3 <- read.csv(file= Args[3],stringsAsFactors = FALSE) #exp3File,stringsAsFactors = FALSE)
X4 <- read.csv(file= Args[4],stringsAsFactors = FALSE) #exp4File,stringsAsFactors = FALSE)
X <- join(X1,X2,by="OrfRep")
X <- join(X,X3,by="OrfRep")
X <- join(X,X4,by="OrfRep")
OBH=X[,order(colnames(X))] #OrderByHeader
headSel= select(OBH, contains('OrfRep'), matches('Gene'), contains('Z_lm_K'), contains('Z_Shift_K'),contains('Z_lm_L'), contains('Z_Shift_L'))
headSel= select(headSel, -'Gene.1',-'Gene.2',-'Gene.3')
headSel2 = select(OBH, contains('OrfRep'), matches('Gene'))
headSel2 = select(headSel2, -'Gene.1',-'Gene.2',-'Gene.3')
}
#headSel$contains('Z_Shift') %>% replace_na(0.001)
headers<-colnames(headSel)
i=0
for(i in 1:length(headers)){
if(grepl("Shift",headers[i])) {
headSel[headers[i]][is.na(headSel[headers[i]])] = 0.001
}
if(grepl("Z_lm_",headers[i])) {
headSel[headers[i]][is.na(headSel[headers[i]])] = 0.0001
}
}
REMcRdy= select(headSel, contains('OrfRep'), matches('Gene'), contains('Z_lm_'))
shiftOnly= select(headSel, contains('OrfRep'), matches('Gene'), contains('Z_Shift'))
combI= headSel2 #Starting Template orf, Genename columns
headersRemc<-colnames(REMcRdy)
#Reoder columns to produce an interleaved set of Z_lm and Shift data for all the cpps.
for(i in 3:length(headersRemc)){
combI=cbind.data.frame(combI, shiftOnly[i])
combI=cbind.data.frame(combI, REMcRdy[i])
}
write.csv(combI,file = file.path(outDir,"CombinedKLzscores.csv"))
write.csv(REMcRdy,file = file.path(outDir,"REMcRdy_lm_only.csv"))
write.csv(shiftOnly,file = file.path(outDir,"Shift_only.csv"))

View File

@@ -0,0 +1,287 @@
#JoinInteractExps3dev.R
#User prompt for std Value
cat("Enter a Standard Deviation value to filter data to be used by REMc ?\n")
inp <- readLines(file("stdin"), n = 1L)
cat(paste("Standard Deviation Value is", inp, "\n"))
#set std deviation multiplier default if no user entry
if(is.numeric(inp)){
std= inp
}else{std= 2}
#The input files should be entered in order from the greatest number of rows(Orfs) to least.
#Args <- commandArgs(TRUE)
#if(length(Args)==0){
# std=0
#}else{
# std=Args[1]
#}
print(paste("SD=",std))
#Wstudy= getwd()
#dir.create("../JoinFiles") #(paste0(Wstudy,"/JoinFiles"))
#outDir <- "../JoinFiles" #paste0(Wstudy,"/JoinFiles")
#dir.create("../REMc") #(paste0(Wstudy,"/JoinFiles"))
outDir <- "./" #../REMc" #paste0(Wstudy,"/JoinFiles")
print(outDir)
#Args= 'asdf'
#Args[1]= "../Exp1/ZScores/ZScores_Interaction.csv" #paste0(Wstudy,"/Exp1/ZScores/ZScores_Interaction.csv")
#Args[2]= "../Exp2/ZScores/ZScores_Interaction.csv" #paste0(Wstudy,"/Exp2/ZScores/ZScores_Interaction.csv")
#Args[3]= "../Exp3/ZScores/ZScores_Interaction.csv" #paste0(Wstudy,"/Exp1/ZScores/ZScores_Interaction.csv")
#Args[4]= "../Exp4/ZScores/ZScores_Interaction.csv" #paste0(Wstudy,"/Exp2/ZScores/ZScores_Interaction.csv")
#Args[3]= "../Exp3/ZScores/ZScores_Interaction.csv" #paste0(Wstudy,"/Exp3/ZScores/ZScores_Interaction.csv")
inputFile= 'asdf'
if (file.exists('../Exp1/ZScores/ZScores_Interaction.csv')){
inputFile <- '../Exp1/ZScores/ZScores_Interaction.csv'
}
if (file.exists('../Exp2/ZScores/ZScores_Interaction.csv')){
inputFile[2] <- '../Exp2/ZScores/ZScores_Interaction.csv'
}
if (file.exists('../Exp3/ZScores/ZScores_Interaction.csv')){
inputFile[3] <- '../Exp3/ZScores/ZScores_Interaction.csv'
}
if (file.exists('../Exp4/ZScores/ZScores_Interaction.csv')){
inputFile[4] <- '../Exp4/ZScores/ZScores_Interaction.csv'
}
#Args= inputFile
#outDir <- ArgsJoin[1] #Output Directory
print(length(inputFile)) #display the number of arguments on terminal
#open required library for the join function (libraries must already be install on R)
library(plyr)
library(dplyr)
library(sos)
#read in the files for your experiment and
#join the two files at a time as a function of how many inputFile, list the larger file first ? in this example X2 has the larger number of genes.
#if X1 has a larger number of genes, switch the order of X1 and X2
if(length(inputFile)==2) {
X1 <- read.csv(file= inputFile[1],stringsAsFactors = FALSE)
X2 <- read.csv(file= inputFile[2],stringsAsFactors = FALSE)
X <- join(X1,X2,by="OrfRep")
OBH=X[,order(colnames(X))] #OrderByHeader
headSel= select(OBH, contains('OrfRep'), matches('Gene'), contains('Z_lm_K'), contains('Z_Shift_K'),contains('Z_lm_L'), contains('Z_Shift_L'))
headSel= select(headSel, -'Gene.1') #remove 'Gene.1 column
headSel2 = select(OBH, contains('OrfRep'), matches('Gene')) #Frame for interleaving Z_lm with Shift colums
headSel2 = select(headSel2, -'Gene.1') #remove 'Gene.1 column #Frame for interleaving Z_lm with Shift colums
}else if(length(inputFile)==3){
X1 <- read.csv(file= inputFile[1],stringsAsFactors = FALSE) #exp1File,stringsAsFactors = FALSE)
X2 <- read.csv(file= inputFile[2],stringsAsFactors = FALSE) #exp2File,stringsAsFactors = FALSE)
X3 <- read.csv(file= inputFile[3],stringsAsFactors = FALSE) #exp3File,stringsAsFactors = FALSE)
X <- join(X1,X2,by="OrfRep")
X <- join(X,X3,by="OrfRep")
OBH=X[,order(colnames(X))] #OrderByHeader
headSel= select(OBH, contains('OrfRep'), matches('Gene'), contains('Z_lm_K'), contains('Z_Shift_K'),contains('Z_lm_L'), contains('Z_Shift_L'))
headSel= select(headSel, -'Gene.1',-'Gene.2')
headSel2 = select(OBH, contains('OrfRep'), matches('Gene'))
headSel2 = select(headSel2, -'Gene.1',-'Gene.2')
}else if(length(inputFile)==4){
X1 <- read.csv(file= inputFile[1],stringsAsFactors = FALSE) #exp1File,stringsAsFactors = FALSE)
X2 <- read.csv(file= inputFile[2],stringsAsFactors = FALSE) #exp2File,stringsAsFactors = FALSE)
X3 <- read.csv(file= inputFile[3],stringsAsFactors = FALSE) #exp3File,stringsAsFactors = FALSE)
X4 <- read.csv(file= inputFile[4],stringsAsFactors = FALSE) #exp4File,stringsAsFactors = FALSE)
X <- join(X1,X2,by="OrfRep")
X <- join(X,X3,by="OrfRep")
X <- join(X,X4,by="OrfRep")
OBH=X[,order(colnames(X))] #OrderByHeader
headSel= select(OBH, contains('OrfRep'), matches('Gene'), contains('Z_lm_K'), contains('Z_Shift_K'),contains('Z_lm_L'), contains('Z_Shift_L'))
headSel= select(headSel, -'Gene.1',-'Gene.2',-'Gene.3')
headSel2 = select(OBH, contains('OrfRep'), matches('Gene'))
headSel2 = select(headSel2, -'Gene.1',-'Gene.2',-'Gene.3')
}
#headSel$contains('Z_Shift') %>% replace_na(0.001)
headers<-colnames(headSel)
i=0
for(i in 1:length(headers)){
if(grepl("Shift",headers[i])) {
headSel[headers[i]][is.na(headSel[headers[i]])] = 0.001
}
if(grepl("Z_lm_",headers[i])) {
headSel[headers[i]][is.na(headSel[headers[i]])] = 0.0001
}
}
#2SD option code to exclude Z_lm values less than 2 standard Deviations
#+++++++++++++
REMcRdy= select(headSel, contains('OrfRep'), matches('Gene'), contains('Z_lm_'))
shiftOnly= select(headSel, contains('OrfRep'), matches('Gene'), contains('Z_Shift'))
#Code to replace the numeric (.1 .2 .3) headers with experiment names from StudyInfo.txt
Labels <- read.csv(file= "../Code/StudyInfo.csv",stringsAsFactors = FALSE,sep= ",")
#R can't do math reliably within a nested loop, Therefore requires a complex text based work around+++++++++++++++
#Do it with text search and replace or modify.
#R is just a badly designed or rather badly evolved mutant language!!! Full of problems and inconsistencies!!!
#R causes huge waste of time.
#R is not worth fixing. It needs to be discontinued both in use and development before it does more harm.
#Using Text search grepl to relabel headers+++++++++++++++++++++++++++++++++++++++++
REMcRdyHdr= colnames(REMcRdy)
REMcRdyLabels= 'asdf'
shftHdr= colnames(shiftOnly)
shiftLabels='asdf'
shiftLabels[1:2]<-shftHdr[1:2]
REMcRdyLabels[1:2]<-REMcRdyHdr[1:2]
for(i in 3:(length(shftHdr))){
if(i==3){
shiftLabels[3]<-paste0(Labels[1,2],".",shftHdr[3])
REMcRdyLabels[3]<-paste0(Labels[1,2],".",REMcRdyHdr[3]) }
if(i==5){
shiftLabels[5]<-paste0(Labels[1,2],".",shftHdr[5])
REMcRdyLabels[5]<-paste0(Labels[1,2],".",REMcRdyHdr[5])
}
if(i==7){
shiftLabels[7]<-paste0(Labels[1,2],".",shftHdr[7])
REMcRdyLabels[7]<-paste0(Labels[1,2],".",REMcRdyHdr[7])
}
if(grepl(".1",shftHdr[i],fixed=true)){
shiftLabels[i]<-paste0(Labels[2,2],".",shftHdr[i])
REMcRdyLabels[i]<-paste0(Labels[2,2],".",REMcRdyHdr[i])}
if (grepl(".2",shftHdr[i],fixed=true)){
shiftLabels[i]<-paste0(Labels[3,2],".",shftHdr[i])
REMcRdyLabels[i]<-paste0(Labels[3,2],".",REMcRdyHdr[i])}
if(grepl(".3",shftHdr[i],fixed=true)){
shiftLabels[i]<-paste0(Labels[4,2],".",shftHdr[i])
REMcRdyLabels[i]<-paste0(Labels[4,2],".",REMcRdyHdr[i])}
}
for(i in 3:(length(REMcRdyLabels))){
j=as.integer(i)
REMcRdyLabels[j]<- gsub("[.]", "_", REMcRdyLabels[j])
shiftLabels[j]<- gsub("[.]", "_", shiftLabels[j])
}
colnames(shiftOnly)<- shiftLabels
colnames(REMcRdy)<- REMcRdyLabels
#+++++++++++++++++++++++
combI= headSel2 #Starting Template orf, Genename columns
#headersRemc<-colnames(REMcRdy)
#Reoder columns to produce an interleaved set of Z_lm and Shift data for all the cpps.
for(i in 3:length(colnames(REMcRdy))){
combI=cbind.data.frame(combI, shiftOnly[i])
combI=cbind.data.frame(combI, REMcRdy[i])
}
#Effort to use R vectorization select data greater than 2 Standard deviations.
#R can't handle variables in the...$(varible). The column names must be explicit. Just another R issue of thoughtlessness.
#REMcGT2<- REMcRdy[abs(REMcRdy$(REMcRdyLabels[3]))>=2 |abs(REMcRdy$REMcRdyLabels[4])>=2 |abs(REMcRdy$REMcRdyLabels[5])>=2 |abs(REMcRdy$REMcRdyLabels[6])>=2]
#another failed R work-around
#REMcGT2<- REMcRdy[abs(REMcRdy[,3])>=2 | abs(REMcRdy[,4])>=2 | abs(REMcRdy[,5])>=2 | abs(REMcRdy[,6])>=2]
#A simple task made difficult by R
#Well R doesn't handle loops well but I may have to try some extreme measures.
#a Fundamental reason RisFuckedUp StackOverflow ...$ and everything else (for, if, +,^,...) that is treated as a function can not accept argument which must be evaluated.
#Therefore just another reason R is shit! This alone should qualify the language to the garbage bin.
#Working in R is a constant battle to workaround its shortsighted deficits.
#REMcGT2<- REMcRdy[abs(REMcRdy$(REMcRdyLabels[3]))>=2 |abs(REMcRdy$REMcRdyLabels[4])>=2 |abs(REMcRdy$REMcRdyLabels[5])>=2 |abs(REMcRdy$REMcRdyLabels[6])>=2,]
#Vectorization with variable adaptation of Sean's string explicit code will not work because R cannot accept variables. Piss poor language.
#So what the hell to do???
#Basically we just need to 'OR' all the column vectors that are >=2 'True' and let that be a binary vector to apply across the data.frame REMcRdy
#R doesn't allow a vector of vectors!
#I guess the only way to do this simple task in R is to create a set of explicit variables,
#then fill each variable with the binary results, next 'OR those results and use that vector of bolean results to select values from data.frame.
#This is totally stupid crazy. But this is R.
#R violates all the fundamental rules of automation. R Requires specific explicit parameters.
#Since the largest REMc is four experiments make eight discrete vectors(K and L for each of the experiments).
#The totally stupid work-around for R
Vec1= NA
Vec2= NA
Vec3= NA
Vec4= NA
Vec5= NA
Vec6= NA
Vec7= NA
Vec8= NA
if(length(REMcRdy)== 6){
Vec1= abs(REMcRdy[,3])>=std
Vec2= abs(REMcRdy[,4])>=std
Vec3= abs(REMcRdy[,5])>=std
Vec4= abs(REMcRdy[,6])>=std
bolVec= Vec1 | Vec2
REMcRdyGT2= REMcRdy[bolVec,1:2]
REMcRdyGT2[ ,3:6]= REMcRdy[bolVec,3:6]
shiftOnlyGT2= shiftOnly[bolVec,1:2]
shiftOnlyGT2[ ,3:6]= shiftOnly[bolVec,3:6]
}
if(length(REMcRdy)== 8){
Vec1= abs(REMcRdy[,3])>=std
Vec2= abs(REMcRdy[,4])>=std
Vec3= abs(REMcRdy[,5])>=std
Vec4= abs(REMcRdy[,6])>=std
Vec5= abs(REMcRdy[,7])>=std
Vec6= abs(REMcRdy[,8])>=std
bolVec= Vec1 | Vec2 |Vec3
REMcRdyGT2= REMcRdy[bolVec,1:2]
REMcRdyGT2[ ,3:8]= REMcRdy[bolVec,3:8]
shiftOnlyGT2= shiftOnly[bolVec,1:2]
shiftOnlyGT2[ ,3:8]= shiftOnly[bolVec,3:8]
}
if(length(REMcRdy)== 10){
Vec1= abs(REMcRdy[,3])>=std
Vec2= abs(REMcRdy[,4])>=std
Vec3= abs(REMcRdy[,5])>=std
Vec4= abs(REMcRdy[,6])>=std
Vec5= abs(REMcRdy[,7])>=std
Vec6= abs(REMcRdy[,8])>=std
Vec7= abs(REMcRdy[,9])>=std
Vec8= abs(REMcRdy[,10])>=std
bolVec= Vec1 | Vec2 |Vec3 |Vec4|Vec5|Vec6|Vec7|Vec8
REMcRdyGT2= REMcRdy[bolVec,1:2]
REMcRdyGT2[ ,3:10]= REMcRdy[bolVec,3:10]
shiftOnlyGT2= shiftOnly[bolVec,1:2]
shiftOnlyGT2[ ,3:10]= shiftOnly[bolVec,3:10]
}
if(std!=0){
REMcRdy= REMcRdyGT2 #[,2:length(REMcRdyGT2)]
shiftOnly= shiftOnlyGT2 #[,2:length(shiftOnlyGT2)]
}
if(std==0){
REMcRdy= REMcRdy #[,2:length(REMcRdy)]
shiftOnly= shiftOnly #[,2:length(shiftOnly)]
}
#Yet again R creates a problem, placing hidden "" around the header names. The following
# is intended to remove those quote so that the "" donot blow up the Java REMc.
#Use ,quote=F in the write.csv statement to fix R output file.
print(paste("SD=",std))
print(getwd())
#write.csv(combI,file = file.path(outDir,"CombinedKLzscores.csv"),row.names = FALSE)
write.csv(REMcRdy,file = file.path(outDir,"REMcRdy_lm_only.csv"),row.names = FALSE, quote=F)
write.csv(shiftOnly,file = file.path(outDir,"Shift_only.csv"),row.names = FALSE, quote=F)
#LabelStd <- read.table(file= "./Parameters.csv",stringsAsFactors = FALSE,sep= ",")
pwd=getwd()
print(getwd)
LabelStd<- read.csv(file= "../Code/StudyInfo.csv",stringsAsFactors = FALSE)
print(std)
LabelStd[,4]= as.numeric(std)
write.csv(LabelStd,file="../Code/Parameters.csv",row.names = FALSE)
write.csv(LabelStd,file="../Code/StudyInfo.csv",row.names = FALSE)
cat(paste("Standard Deviation Value was set as", std, "\n"))

View File

@@ -0,0 +1,340 @@
#4. GTA K Pairwise Compare
#Sean's Arg convention for info only
#use this Rscript to compare two results sheets from GTF analysis "Average_GOTerms_All.csv"
#Arg1 is Average_GOTerms_All_1.csv
#Arg2 is the name to give GTA results 1
#Arg3 is Average_GOTerms_All2.csv
#Arg4 is the name to give GTA results 2
#Arg5 is the directory to put the files into
#Arg 1 is the GTA results 1
#Arg 2 is the name of GTA results 1 to print in the results
#Arg 3 is GTA results 3
#Arg 4 is the name of GTA results 2 to print in the results
#Arg 4 is the name of GTA results 2 to print in the results
#arg 5 is the directory to put the results into (and create that directory if needed)
library(ggplot2)
library(plotly)
library(htmlwidgets)
library(extrafont)
library(grid)
library(ggthemes)
Args <- commandArgs(TRUE)
expNm= Args[1] #"Exp3"
expNm[2]= Args[2] #"Exp4"
expNumber1<- as.numeric(sub("^.*?(\\d+)$", "\\1", expNm[1]))
expNumber2<- as.numeric(sub("^.*?(\\d+)$", "\\1", expNm[2]))
#labels <- read.delim("ExpLabels.txt",skip=0,as.is=T,row.names=1,strip.white=TRUE)
labels <- read.delim("StudyInfo.txt",skip=0,as.is=T,row.names=1,strip.white=TRUE)
Name1 <- labels[expNumber1,1] #ssArg2 These are now supplied by Code/ExpLabels.txt which is user edited
Name2 <- labels[expNumber2,1] #ssArg4
Wstudy= getwd()
input_file1 <- paste0("../GTAresults/",expNm[1],"/Average_GOTerms_All.csv" ) #Args[1]
input_file2 <- paste0("../GTAresults/",expNm[2],"/Average_GOTerms_All.csv" ) #Args[3]
pairDirL= paste0("../GTAresults/","PairwiseCompareL_",expNm[1],"-",expNm[2])
pairDirK= paste0("../GTAresults/","PairwiseCompareK_",expNm[1],"-",expNm[2])
outPathGTAcompare= "../GTAresults/PairwiseCompareL" #paste0(Wstudy,"/GTAresults/PairwiseCompareL)
outPathGTAcompare[2]= "../GTAresults/PairwiseCompareK" #paste0(Wstudy,"/GTAresults/PairwiseCompareK")
#dir.create(outPathGTAcompare[1])
dir.create(pairDirL) #(outPathGTAcompare[1])
dir.create(pairDirK) #(outPathGTAcompare[2])
#define the output path (as fourth argument from Rscript)
outputpath <- pairDirK #outPathGTAcompare[2] #Args[5]
#theme elements for plots
theme_Publication <- function(base_size=14, base_family="sans") {
(theme_foundation(base_size=base_size, base_family=base_family)
+ theme(plot.title = element_text(face = "bold",
size = rel(1.2), hjust = 0.5),
text = element_text(),
panel.background = element_rect(colour = NA),
plot.background = element_rect(colour = NA),
panel.border = element_rect(colour = NA),
axis.title = element_text(face = "bold",size = rel(1)),
axis.title.y = element_text(angle=90,vjust =2),
axis.title.x = element_text(vjust = -0.2),
axis.text = element_text(),
axis.line = element_line(colour="black"),
axis.ticks = element_line(),
panel.grid.major = element_line(colour="#f0f0f0"),
panel.grid.minor = element_blank(),
legend.key = element_rect(colour = NA),
legend.position = "bottom",
legend.direction = "horizontal",
legend.key.size= unit(0.2, "cm"),
legend.spacing = unit(0, "cm"),
legend.title = element_text(face="italic"),
plot.margin=unit(c(10,5,5,5),"mm"),
strip.background=element_rect(colour="#f0f0f0",fill="#f0f0f0"),
strip.text = element_text(face="bold")
))
}
scale_fill_Publication <- function(...){
library(scales)
discrete_scale("fill","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
}
scale_colour_Publication <- function(...){
discrete_scale("colour","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
}
theme_Publication_legend_right <- function(base_size=14, base_family="sans") {
(theme_foundation(base_size=base_size, base_family=base_family)
+ theme(plot.title = element_text(face = "bold",
size = rel(1.2), hjust = 0.5),
text = element_text(),
panel.background = element_rect(colour = NA),
plot.background = element_rect(colour = NA),
panel.border = element_rect(colour = NA),
axis.title = element_text(face = "bold",size = rel(1)),
axis.title.y = element_text(angle=90,vjust =2),
axis.title.x = element_text(vjust = -0.2),
axis.text = element_text(),
axis.line = element_line(colour="black"),
axis.ticks = element_line(),
panel.grid.major = element_line(colour="#f0f0f0"),
panel.grid.minor = element_blank(),
legend.key = element_rect(colour = NA),
legend.position = "right",
legend.direction = "vertical",
legend.key.size= unit(0.5, "cm"),
legend.spacing = unit(0, "cm"),
legend.title = element_text(face="italic"),
plot.margin=unit(c(10,5,5,5),"mm"),
strip.background=element_rect(colour="#f0f0f0",fill="#f0f0f0"),
strip.text = element_text(face="bold")
))
}
scale_fill_Publication <- function(...){
discrete_scale("fill","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
}
scale_colour_Publication <- function(...){
discrete_scale("colour","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
}
X1 <- read.csv(file = input_file1,stringsAsFactors=FALSE,header = TRUE)
X2 <- read.csv(file = input_file2,stringsAsFactors=FALSE,header = TRUE)
#1
X <- merge(X1,X2,by ="Term_Avg",all=TRUE,suffixes = c("_X1","_X2"))
gg <- ggplot(data = X,aes(x=Z_lm_K_Avg_X1,y=Z_lm_K_Avg_X2,color=Ontology_Avg_X1,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_K_SD_X1,SD_2=Z_lm_K_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep = "")) +
theme_Publication_legend_right()
pdf(paste(getwd(),"/",outputpath,"/","Scatter_lm_GTF_Averages_",Name1,"_vs_",Name2,"_All_ByOntology.pdf",sep=""),width = 12,height = 8)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("127")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_byOntology.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirK,fname))
#2
#ID aggravators and alleviators, regardless of whether they meet 2SD threshold
X1_Specific_Aggravators <- X[which(X$Z_lm_K_Avg_X1 >= 2 & X$Z_lm_K_Avg_X2 < 2),]
X1_Specific_Alleviators <- X[which(X$Z_lm_K_Avg_X1 <= -2 & X$Z_lm_K_Avg_X2 > -2),]
X2_Specific_Aggravators <- X[which(X$Z_lm_K_Avg_X2 >= 2 & X$Z_lm_K_Avg_X1 < 2),]
X2_Specific_Alleviators <- X[which(X$Z_lm_K_Avg_X2 <= -2 & X$Z_lm_K_Avg_X1 > -2),]
Overlap_Aggravators <- X[which(X$Z_lm_K_Avg_X1 >= 2 & X$Z_lm_K_Avg_X2 >= 2),]
Overlap_Alleviators <- X[which(X$Z_lm_K_Avg_X1 <= -2 & X$Z_lm_K_Avg_X2 <= -2),]
X2_Specific_Aggravators_X1_Alleviatiors <- X[which(X$Z_lm_K_Avg_X2 >= 2 & X$Z_lm_K_Avg_X1 <= -2),]
X2_Specific_Alleviators_X1_Aggravators <- X[which(X$Z_lm_K_Avg_X2 <= -2 & X$Z_lm_K_Avg_X1 >= 2),]
X$Overlap_Avg <- NA
try(X[X$Term_Avg %in% X1_Specific_Aggravators$Term_Avg,]$Overlap_Avg <- paste(Name1,"Specific_Deletion_Suppressors",sep="_"))
try(X[X$Term_Avg %in% X1_Specific_Alleviators$Term_Avg,]$Overlap_Avg <- paste(Name1,"Specific_Deletion_Enhancers",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Aggravators$Term_Avg,]$Overlap_Avg <- paste(Name2,"Specific_Deletion_Suppressors",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Alleviators$Term_Avg,]$Overlap_Avg <- paste(Name2,"Specific_Deletion_Enhancers",sep="_"))
try(X[X$Term_Avg %in% Overlap_Aggravators$Term_Avg,]$Overlap_Avg <- "Overlapping_Deletion_Suppressors")
try(X[X$Term_Avg %in% Overlap_Alleviators$Term_Avg,]$Overlap_Avg <- "Overlapping_Deletion_Enhancers")
try(X[X$Term_Avg %in% X2_Specific_Aggravators_X1_Alleviatiors$Term_Avg,]$Overlap_Avg <- paste(Name2,"Deletion_Suppressors",Name1,"Deletion_Enhancers",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Alleviators_X1_Aggravators$Term_Avg,]$Overlap_Avg <- paste(Name2,"Deletion_Enhancers",Name1,"Deletion_Suppressors",sep="_"))
plotly_path <- paste(getwd(),"/",outputpath,"/","Scatter_lm_GTF_Averages_",Name1,"_vs_",Name2,"_All_byOverlap.html",sep="")
gg <- ggplot(data = X,aes(x=Z_lm_K_Avg_X1,y=Z_lm_K_Avg_X2,color=Overlap_Avg,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_K_SD_X1,SD_2=Z_lm_K_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(getwd(),"/",outputpath,"/","Scatter_lm_GTF_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap.pdf",sep=""),width = 12,height = 8)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#2-170")
#2
fname <- paste("/Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_byOverlap.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirK,fname))
#3
x_rem2_gene <- X[X$NumGenes_Avg_X1 >= 2 & X$NumGenes_Avg_X2 >= 2,]
plotly_path <- paste(getwd(),"/",outputpath,"/","Scatter_lm_GTF_Averages_",Name1,"_vs_",Name2,"_All_byOverlap_above2genes.html",sep="")
gg <- ggplot(data = x_rem2_gene,aes(x=Z_lm_K_Avg_X1,y=Z_lm_K_Avg_X2,color=Overlap_Avg,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_K_SD_X1,SD_2=Z_lm_K_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(getwd(),"/",outputpath,"/","Scatter_lm_GTF_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_above2genes.pdf",sep=""),width = 12,height = 8)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#3")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_byOverlap_above2genes.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirK,fname))
#4
X_overlap_nothresold <- X[!(is.na(X$Overlap_Avg)),]
gg <- ggplot(data = X_overlap_nothresold,aes(x=Z_lm_K_Avg_X1,y=Z_lm_K_Avg_X2,color=Overlap_Avg,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_K_SD_X1,SD_2=Z_lm_K_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep = "")) +
theme_Publication_legend_right()
pdf(paste(getwd(),"/",outputpath,"/","Scatter_lm_GTF_Averages_",Name1,"_vs_",Name2,"_Above2SD_ByOverlap.pdf",sep=""),width = 12,height = 8)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#4")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_Above2SD_ByOverlap.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirK,fname))
#5
#only output GTA terms where average score is still above 2 after subtracting the SD
#Z1 will ID aggravators, Z2 alleviators
Z1 <- X
Z1$L_Subtract_SD_X1 <- Z1$Z_lm_K_Avg_X1 - Z1$Z_lm_K_SD_X1
Z1$L_Subtract_SD_X2 <- Z1$Z_lm_K_Avg_X2 - Z1$Z_lm_K_SD_X2
Z2 <- X
Z2$L_Subtract_SD_X1 <- Z1$Z_lm_K_Avg_X1 + Z1$Z_lm_K_SD_X1
Z2$L_Subtract_SD_X2 <- Z1$Z_lm_K_Avg_X2 + Z1$Z_lm_K_SD_X2
X1_Specific_Aggravators2 <- Z1[which(Z1$L_Subtract_SD_X1 >= 2 & Z1$L_Subtract_SD_X2 < 2),]
X1_Specific_Alleviators2 <- Z2[which(Z2$L_Subtract_SD_X1 <= -2 & Z2$L_Subtract_SD_X2 > -2),]
X2_Specific_Aggravators2 <- Z1[which(Z1$L_Subtract_SD_X2 >= 2 & Z1$L_Subtract_SD_X1 < 2),]
X2_Specific_Alleviators2 <- Z2[which(Z2$L_Subtract_SD_X2 <= -2 & Z2$L_Subtract_SD_X1 > -2),]
Overlap_Aggravators2 <- Z1[which(Z1$L_Subtract_SD_X1 >= 2 & Z1$L_Subtract_SD_X2 >= 2),]
Overlap_Alleviators2 <- Z2[which(Z2$L_Subtract_SD_X2 <= -2 & Z2$L_Subtract_SD_X1 <= -2),]
X2_Specific_Aggravators2_X1_Alleviatiors2 <- Z1[which(Z1$L_Subtract_SD_X2 >= 2 & Z2$L_Subtract_SD_X1 <= -2),]
X2_Specific_Alleviators2_X1_Aggravators2 <- Z2[which(Z2$L_Subtract_SD_X2 <= -2 & Z1$L_Subtract_SD_X1 >= 2),]
X$Overlap <- NA
try(X[X$Term_Avg %in% X1_Specific_Aggravators2$Term_Avg,]$Overlap <- paste(Name1,"Specific_Deletion_Suppressors",sep="_"))
try(X[X$Term_Avg %in% X1_Specific_Alleviators2$Term_Avg,]$Overlap <- paste(Name1,"Specific_Deletion_Enhancers",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Aggravators2$Term_Avg,]$Overlap <- paste(Name2,"Specific_Deletion_Suppressors",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Alleviators2$Term_Avg,]$Overlap <- paste(Name2,"Specific_Deletion_Enhancers",sep="_"))
try(X[X$Term_Avg %in% Overlap_Aggravators2$Term_Avg,]$Overlap <- "Overlapping_Deletion_Suppressors")
try(X[X$Term_Avg %in% Overlap_Alleviators2$Term_Avg,]$Overlap <- "Overlapping_Deletion_Enhancers")
try(X[X$Term_Avg %in% X2_Specific_Aggravators2_X1_Alleviatiors2$Term_Avg,]$Overlap <- paste(Name2,"Deletion_Suppressors",Name1,"Deletion_Enhancers",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Alleviators2_X1_Aggravators2$Term_Avg,]$Overlap <- paste(Name2,"Deletion_Enhancers",Name1,"Deletion_Suppressors",sep="_"))
X_abovethreshold <- X[!(is.na(X$Overlap)),]
gg <- ggplot(data = X_abovethreshold,aes(x=Z_lm_K_Avg_X1,y=Z_lm_K_Avg_X2,color=Overlap,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_K_SD_X1,SD_2=Z_lm_K_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(getwd(),"/",outputpath,"/","Scatter_lm_GTF_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold.pdf",sep=""),width = 12,height = 8)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#5")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirK,fname))
#6
gg <- ggplot(data = X_abovethreshold,aes(x=Z_lm_K_Avg_X1,y=Z_lm_K_Avg_X2,color=Overlap,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_K_SD_X1,SD_2=Z_lm_K_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_text(aes(label=Term_Avg),nudge_y = 0.25,size=2) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3,size=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(getwd(),"/",outputpath,"/","Scatter_lm_GTF_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_names.pdf",sep=""),width = 20,height = 20)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#6")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_names.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirK,fname))
#7
X_abovethreshold$X1_Rank <- NA
X_abovethreshold$X1_Rank <- rank(-X_abovethreshold$Z_lm_K_Avg_X1,ties.method = "random")
X_abovethreshold$X2_Rank <- NA
X_abovethreshold$X2_Rank <- rank(-X_abovethreshold$Z_lm_K_Avg_X2,ties.method = "random")
gg <- ggplot(data = X_abovethreshold,aes(x=Z_lm_K_Avg_X1,y=Z_lm_K_Avg_X2,color=Overlap,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_K_SD_X1,SD_2=Z_lm_K_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_text(aes(label=X1_Rank),nudge_y = 0.25,size=4) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3,size=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(getwd(),"/",outputpath,"/","Scatter_lm_GTF_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_numberedX1.pdf",sep=""),width = 15,height = 15)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#7")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_numberedX1.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirK,fname))
#8
gg <- ggplot(data = X_abovethreshold,aes(x=Z_lm_K_Avg_X1,y=Z_lm_K_Avg_X2,color=Overlap,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_K_SD_X1,SD_2=Z_lm_K_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_text(aes(label=X2_Rank),nudge_y = 0.25,size=4) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3,size=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(getwd(),"/",outputpath,"/","Scatter_lm_GTF_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_numberedX2.pdf",sep=""),width = 15,height = 15)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#8")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_numberedX2.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirK,fname))
print("write csv files")
write.csv(x=X,file = paste(getwd(),"/",outputpath,"/","All_GTF_Avg_Scores_",Name1,"_vs_",Name2,".csv",sep=""),row.names = FALSE)
write.csv(x=X_abovethreshold,file = paste(getwd(),"/",outputpath,"/","AboveThreshold_GTF_Avg_Scores_",Name1,"_vs_",Name2,".csv",sep=""),row.names = FALSE)
#End of GTA Pairwise compare for K values

View File

@@ -0,0 +1,632 @@
#4.This R script performs GTA L and K Pairwise Compares for user specified pairs of Experiments
#Arg1 is the first Experiment or a user ordered pair (i.e., Exp3)
#Arg2 is the second Experiment or a user ordered pair (i.e., Exp4)
#Note user can put whatever names they wish for the Canonical Exp1..4 in the ../Code/ExpLabels.txt spread sheet
#which correlates the canonical Exp Name with the user stylized label for plots and output files.
library(ggplot2)
library(plotly)
library(htmlwidgets)
library(extrafont)
library(grid)
library(ggthemes)
Args <- commandArgs(TRUE)
expNm= Args[1] #i.e., "Exp3"
expNm[2]= Args[2] #i.e., "Exp4"
expNumber1<- as.numeric(sub("^.*?(\\d+)$", "\\1", expNm[1]))
expNumber2<- as.numeric(sub("^.*?(\\d+)$", "\\1", expNm[2]))
#labels <- read.delim("ExpLabels.txt",skip=0,as.is=T,row.names=1,strip.white=TRUE)
#labels <- read.delim("StudyInfo.csv",skip=0,as.is=T,row.names=1,strip.white=TRUE)
Labels<- read.csv(file= "StudyInfo.csv",stringsAsFactors = FALSE)
Name1 <- Labels[expNumber1,2] #ssArg2 These are now supplied by Code/ExpLabels.csv which is user edited
Name2 <- Labels[expNumber2,2] #ssArg4
Wstudy= getwd()
input_file1 <- paste0("../GTAresults/",expNm[1],"/Average_GOTerms_All.csv" ) #Args[1]
input_file2 <- paste0("../GTAresults/",expNm[2],"/Average_GOTerms_All.csv" ) #Args[3]
pairDirL= paste0("../GTAresults/","PairwiseCompareL_",expNm[1],"-",expNm[2])
pairDirK= paste0("../GTAresults/","PairwiseCompareK_",expNm[1],"-",expNm[2])
outPathGTAcompare= "../GTAresults/PairwiseCompareL" #paste0(Wstudy,"/GTAresults/PairwiseCompareL)
outPathGTAcompare[2]= "../GTAresults/PairwiseCompareK" #paste0(Wstudy,"/GTAresults/PairwiseCompareK")
#dir.create(outPathGTAcompare[1])
dir.create(pairDirL) #(outPathGTAcompare[1])
dir.create(pairDirK) #(outPathGTAcompare[2])
###########BEGIN PAIRWISE L-----LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
#define the output path (as fourth argument from Rscript)
outputpath <- pairDirL #outPathGTAcompare[1] #Args[5]
#outputPlotly <- "../GTAresults/PairwiseCompareL/" #"/GTAresults/PairwiseCompareL/"
print("39")
#theme elements for plots
theme_Publication <- function(base_size=14, base_family="sans") {
(theme_foundation(base_size=base_size, base_family=base_family)
+ theme(plot.title = element_text(face = "bold",
size = rel(1.2), hjust = 0.5),
text = element_text(),
panel.background = element_rect(colour = NA),
plot.background = element_rect(colour = NA),
panel.border = element_rect(colour = NA),
axis.title = element_text(face = "bold",size = rel(1)),
axis.title.y = element_text(angle=90,vjust =2),
axis.title.x = element_text(vjust = -0.2),
axis.text = element_text(),
axis.line = element_line(colour="black"),
axis.ticks = element_line(),
panel.grid.major = element_line(colour="#f0f0f0"),
panel.grid.minor = element_blank(),
legend.key = element_rect(colour = NA),
legend.position = "bottom",
legend.direction = "horizontal",
legend.key.size= unit(0.2, "cm"),
legend.spacing = unit(0, "cm"),
legend.title = element_text(face="italic"),
plot.margin=unit(c(10,5,5,5),"mm"),
strip.background=element_rect(colour="#f0f0f0",fill="#f0f0f0"),
strip.text = element_text(face="bold")
))
}
scale_fill_Publication <- function(...){
library(scales)
discrete_scale("fill","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
}
scale_colour_Publication <- function(...){
discrete_scale("colour","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
}
theme_Publication_legend_right <- function(base_size=14, base_family="sans") {
(theme_foundation(base_size=base_size, base_family=base_family)
+ theme(plot.title = element_text(face = "bold",
size = rel(1.2), hjust = 0.5),
text = element_text(),
panel.background = element_rect(colour = NA),
plot.background = element_rect(colour = NA),
panel.border = element_rect(colour = NA),
axis.title = element_text(face = "bold",size = rel(1)),
axis.title.y = element_text(angle=90,vjust =2),
axis.title.x = element_text(vjust = -0.2),
axis.text = element_text(),
axis.line = element_line(colour="black"),
axis.ticks = element_line(),
panel.grid.major = element_line(colour="#f0f0f0"),
panel.grid.minor = element_blank(),
legend.key = element_rect(colour = NA),
legend.position = "right",
legend.direction = "vertical",
legend.key.size= unit(0.5, "cm"),
legend.spacing = unit(0, "cm"),
legend.title = element_text(face="italic"),
plot.margin=unit(c(10,5,5,5),"mm"),
strip.background=element_rect(colour="#f0f0f0",fill="#f0f0f0"),
strip.text = element_text(face="bold")
))
}
scale_fill_Publication <- function(...){
discrete_scale("fill","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
}
scale_colour_Publication <- function(...){
discrete_scale("colour","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
}
X1 <- read.csv(file = input_file1,stringsAsFactors=FALSE,header = TRUE)
X2 <- read.csv(file = input_file2,stringsAsFactors=FALSE,header = TRUE)
print(117)
X <- merge(X1,X2,by ="Term_Avg",all=TRUE,suffixes = c("_X1","_X2"))
gg <- ggplot(data = X,aes(x=Z_lm_L_Avg_X1,y=Z_lm_L_Avg_X2,color=Ontology_Avg_X1,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_L_SD_X1,SD_2=Z_lm_L_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep = "")) +
theme_Publication_legend_right()
pdf(paste(outputpath,"/","Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOntology.pdf",sep=""),width = 12,height = 8)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("130")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_byOntology.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirL,fname))
#ID aggravators and alleviators, regardless of whether they meet 2SD threshold
X1_Specific_Aggravators <- X[which(X$Z_lm_L_Avg_X1 >= 2 & X$Z_lm_L_Avg_X2 < 2),]
X1_Specific_Alleviators <- X[which(X$Z_lm_L_Avg_X1 <= -2 & X$Z_lm_L_Avg_X2 > -2),]
X2_Specific_Aggravators <- X[which(X$Z_lm_L_Avg_X2 >= 2 & X$Z_lm_L_Avg_X1 < 2),]
X2_Specific_Alleviators <- X[which(X$Z_lm_L_Avg_X2 <= -2 & X$Z_lm_L_Avg_X1 > -2),]
Overlap_Aggravators <- X[which(X$Z_lm_L_Avg_X1 >= 2 & X$Z_lm_L_Avg_X2 >= 2),]
Overlap_Alleviators <- X[which(X$Z_lm_L_Avg_X1 <= -2 & X$Z_lm_L_Avg_X2 <= -2),]
X2_Specific_Aggravators_X1_Alleviatiors <- X[which(X$Z_lm_L_Avg_X2 >= 2 & X$Z_lm_L_Avg_X1 <= -2),]
X2_Specific_Alleviators_X1_Aggravators <- X[which(X$Z_lm_L_Avg_X2 <= -2 & X$Z_lm_L_Avg_X1 >= 2),]
print("155")
X$Overlap_Avg <- NA
try(X[X$Term_Avg %in% X1_Specific_Aggravators$Term_Avg,]$Overlap_Avg <- paste(Name1,"Specific_Deletion_Enhancers",sep="_"))
try(X[X$Term_Avg %in% X1_Specific_Alleviators$Term_Avg,]$Overlap_Avg <- paste(Name1,"Specific_Deletion_Suppresors",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Aggravators$Term_Avg,]$Overlap_Avg <- paste(Name2,"Specific_Deletion_Enhancers",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Alleviators$Term_Avg,]$Overlap_Avg <- paste(Name2,"Specific_Deletion_Suppressors",sep="_"))
try(X[X$Term_Avg %in% Overlap_Aggravators$Term_Avg,]$Overlap_Avg <- "Overlapping_Deletion_Enhancers")
try(X[X$Term_Avg %in% Overlap_Alleviators$Term_Avg,]$Overlap_Avg <- "Overlapping_Deletion_Suppressors")
try(X[X$Term_Avg %in% X2_Specific_Aggravators_X1_Alleviatiors$Term_Avg,]$Overlap_Avg <- paste(Name2,"Deletion_Enhancers",Name1,"Deletion_Suppressors",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Alleviators_X1_Aggravators$Term_Avg,]$Overlap_Avg <- paste(Name2,"Deletion_Suppressors",Name1,"Deletion_Enhancers",sep="_"))
gg <- ggplot(data = X,aes(x=Z_lm_L_Avg_X1,y=Z_lm_L_Avg_X2,color=Overlap_Avg,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_L_SD_X1,SD_2=Z_lm_L_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(outputpath,"/","Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap.pdf",sep=""),width = 12,height = 8)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#2-174")
#2
fname <- paste("/Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_byOverlap.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirL,fname))
x_rem2_gene <- X[X$NumGenes_Avg_X1 >= 2 & X$NumGenes_Avg_X2 >= 2,]
#3
gg <- ggplot(data = x_rem2_gene,aes(x=Z_lm_L_Avg_X1,y=Z_lm_L_Avg_X2,color=Overlap_Avg,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_L_SD_X1,SD_2=Z_lm_L_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(outputpath,"/","Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_above2genes.pdf",sep=""),width = 12,height = 8)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#3")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_byOverlap_above2genes.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirL,fname))
#4
X_overlap_nothresold <- X[!(is.na(X$Overlap_Avg)),]
gg <- ggplot(data = X_overlap_nothresold,aes(x=Z_lm_L_Avg_X1,y=Z_lm_L_Avg_X2,color=Overlap_Avg,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_L_SD_X1,SD_2=Z_lm_L_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep = "")) +
theme_Publication_legend_right()
pdf(paste(outputpath,"/","Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_Above2SD_ByOverlap.pdf",sep=""),width = 12,height = 8)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#4")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_Above2SD_ByOverlap.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirL,fname))
#only output GTA terms where average score is still above 2 after subtracting the SD
#Z1 will ID aggravators, Z2 alleviators
Z1 <- X
Z1$L_Subtract_SD_X1 <- Z1$Z_lm_L_Avg_X1 - Z1$Z_lm_L_SD_X1
Z1$L_Subtract_SD_X2 <- Z1$Z_lm_L_Avg_X2 - Z1$Z_lm_L_SD_X2
Z2 <- X
Z2$L_Subtract_SD_X1 <- Z1$Z_lm_L_Avg_X1 + Z1$Z_lm_L_SD_X1
Z2$L_Subtract_SD_X2 <- Z1$Z_lm_L_Avg_X2 + Z1$Z_lm_L_SD_X2
X1_Specific_Aggravators2 <- Z1[which(Z1$L_Subtract_SD_X1 >= 2 & Z1$L_Subtract_SD_X2 < 2),]
X1_Specific_Alleviators2 <- Z2[which(Z2$L_Subtract_SD_X1 <= -2 & Z2$L_Subtract_SD_X2 > -2),]
X2_Specific_Aggravators2 <- Z1[which(Z1$L_Subtract_SD_X2 >= 2 & Z1$L_Subtract_SD_X1 < 2),]
X2_Specific_Alleviators2 <- Z2[which(Z2$L_Subtract_SD_X2 <= -2 & Z2$L_Subtract_SD_X1 > -2),]
Overlap_Aggravators2 <- Z1[which(Z1$L_Subtract_SD_X1 >= 2 & Z1$L_Subtract_SD_X2 >= 2),]
Overlap_Alleviators2 <- Z2[which(Z2$L_Subtract_SD_X2 <= -2 & Z2$L_Subtract_SD_X1 <= -2),]
X2_Specific_Aggravators2_X1_Alleviatiors2 <- Z1[which(Z1$L_Subtract_SD_X2 >= 2 & Z2$L_Subtract_SD_X1 <= -2),]
X2_Specific_Alleviators2_X1_Aggravators2 <- Z2[which(Z2$L_Subtract_SD_X2 <= -2 & Z1$L_Subtract_SD_X1 >= 2),]
X$Overlap <- NA
try(X[X$Term_Avg %in% X1_Specific_Aggravators2$Term_Avg,]$Overlap <- paste(Name1,"Specific_Deletion_Enhancers",sep="_"))
try(X[X$Term_Avg %in% X1_Specific_Alleviators2$Term_Avg,]$Overlap <- paste(Name1,"Specific_Deletion_Suppresors",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Aggravators2$Term_Avg,]$Overlap <- paste(Name2,"Specific_Deletion_Enhancers",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Alleviators2$Term_Avg,]$Overlap <- paste(Name2,"Specific_Deletion_Suppressors",sep="_"))
try(X[X$Term_Avg %in% Overlap_Aggravators2$Term_Avg,]$Overlap <- "Overlapping_Deletion_Enhancers")
try(X[X$Term_Avg %in% Overlap_Alleviators2$Term_Avg,]$Overlap <- "Overlapping_Deletion_Suppressors")
try(X[X$Term_Avg %in% X2_Specific_Aggravators2_X1_Alleviatiors2$Term_Avg,]$Overlap <- paste(Name2,"Deletion_Enhancers",Name1,"Deletion_Suppressors",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Alleviators2_X1_Aggravators2$Term_Avg,]$Overlap <- paste(Name2,"Deletion_Suppressors",Name1,"Deletion_Enhancers",sep="_"))
#5
X_abovethreshold <- X[!(is.na(X$Overlap)),]
gg <- ggplot(data = X_abovethreshold,aes(x=Z_lm_L_Avg_X1,y=Z_lm_L_Avg_X2,color=Overlap,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_L_SD_X1,SD_2=Z_lm_L_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(outputpath,"/","Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold.pdf",sep=""),width = 12,height = 8)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#5")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirL,fname))
#6
gg <- ggplot(data = X_abovethreshold,aes(x=Z_lm_L_Avg_X1,y=Z_lm_L_Avg_X2,color=Overlap,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_L_SD_X1,SD_2=Z_lm_L_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_text(aes(label=Term_Avg),nudge_y = 0.25,size=2) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3,size=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(outputpath,"/","Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_names.pdf",sep=""),width = 20,height = 20)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#6")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_names.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirL,fname))
X_abovethreshold$X1_Rank <- NA
X_abovethreshold$X1_Rank <- rank(-X_abovethreshold$Z_lm_L_Avg_X1,ties.method = "random")
X_abovethreshold$X2_Rank <- NA
X_abovethreshold$X2_Rank <- rank(-X_abovethreshold$Z_lm_L_Avg_X2,ties.method = "random")
#7
gg <- ggplot(data = X_abovethreshold,aes(x=Z_lm_L_Avg_X1,y=Z_lm_L_Avg_X2,color=Overlap,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_L_SD_X1,SD_2=Z_lm_L_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_text(aes(label=X1_Rank),nudge_y = 0.25,size=4) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3,size=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(outputpath,"/","Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_numberedX1.pdf",sep=""),width = 15,height = 15)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#7")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_numberedX1.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirL,fname))
#8
gg <- ggplot(data = X_abovethreshold,aes(x=Z_lm_L_Avg_X1,y=Z_lm_L_Avg_X2,color=Overlap,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_L_SD_X1,SD_2=Z_lm_L_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_text(aes(label=X2_Rank),nudge_y = 0.25,size=4) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3,size=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(outputpath,"/","Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_numberedX2.pdf",sep=""),width = 15,height = 15)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#8")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_numberedX2.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirL,fname))
print("write csv files L")
write.csv(x=X,file = paste(outputpath,"/All_GTA_Avg_Scores_",Name1,"_vs_",Name2,".csv",sep=""),row.names = FALSE)
write.csv(x=X_abovethreshold,file = paste(getwd(),"/",outputpath,"/","AboveThreshold_GTA_Avg_Scores_",Name1,"_vs_",Name2,".csv",sep=""),row.names = FALSE)
#End of L GTA Pairwise Compare
###########BEGIN PAIRWISE K-----KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
#define the output path (as fourth argument from Rscript)
outputpath <- pairDirK #outPathGTAcompare[2] #Args[5]
#theme elements for plots
theme_Publication <- function(base_size=14, base_family="sans") {
(theme_foundation(base_size=base_size, base_family=base_family)
+ theme(plot.title = element_text(face = "bold",
size = rel(1.2), hjust = 0.5),
text = element_text(),
panel.background = element_rect(colour = NA),
plot.background = element_rect(colour = NA),
panel.border = element_rect(colour = NA),
axis.title = element_text(face = "bold",size = rel(1)),
axis.title.y = element_text(angle=90,vjust =2),
axis.title.x = element_text(vjust = -0.2),
axis.text = element_text(),
axis.line = element_line(colour="black"),
axis.ticks = element_line(),
panel.grid.major = element_line(colour="#f0f0f0"),
panel.grid.minor = element_blank(),
legend.key = element_rect(colour = NA),
legend.position = "bottom",
legend.direction = "horizontal",
legend.key.size= unit(0.2, "cm"),
legend.spacing = unit(0, "cm"),
legend.title = element_text(face="italic"),
plot.margin=unit(c(10,5,5,5),"mm"),
strip.background=element_rect(colour="#f0f0f0",fill="#f0f0f0"),
strip.text = element_text(face="bold")
))
}
scale_fill_Publication <- function(...){
library(scales)
discrete_scale("fill","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
}
scale_colour_Publication <- function(...){
discrete_scale("colour","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
}
theme_Publication_legend_right <- function(base_size=14, base_family="sans") {
(theme_foundation(base_size=base_size, base_family=base_family)
+ theme(plot.title = element_text(face = "bold",
size = rel(1.2), hjust = 0.5),
text = element_text(),
panel.background = element_rect(colour = NA),
plot.background = element_rect(colour = NA),
panel.border = element_rect(colour = NA),
axis.title = element_text(face = "bold",size = rel(1)),
axis.title.y = element_text(angle=90,vjust =2),
axis.title.x = element_text(vjust = -0.2),
axis.text = element_text(),
axis.line = element_line(colour="black"),
axis.ticks = element_line(),
panel.grid.major = element_line(colour="#f0f0f0"),
panel.grid.minor = element_blank(),
legend.key = element_rect(colour = NA),
legend.position = "right",
legend.direction = "vertical",
legend.key.size= unit(0.5, "cm"),
legend.spacing = unit(0, "cm"),
legend.title = element_text(face="italic"),
plot.margin=unit(c(10,5,5,5),"mm"),
strip.background=element_rect(colour="#f0f0f0",fill="#f0f0f0"),
strip.text = element_text(face="bold")
))
}
scale_fill_Publication <- function(...){
discrete_scale("fill","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
}
scale_colour_Publication <- function(...){
discrete_scale("colour","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
}
X1 <- read.csv(file = input_file1,stringsAsFactors=FALSE,header = TRUE)
X2 <- read.csv(file = input_file2,stringsAsFactors=FALSE,header = TRUE)
#1
X <- merge(X1,X2,by ="Term_Avg",all=TRUE,suffixes = c("_X1","_X2"))
gg <- ggplot(data = X,aes(x=Z_lm_K_Avg_X1,y=Z_lm_K_Avg_X2,color=Ontology_Avg_X1,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_K_SD_X1,SD_2=Z_lm_K_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep = "")) +
theme_Publication_legend_right()
pdf(paste(getwd(),"/",outputpath,"/","Scatter_lm_GTF_Averages_",Name1,"_vs_",Name2,"_All_ByOntology.pdf",sep=""),width = 12,height = 8)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("127")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_byOntology.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirK,fname))
#2
#ID aggravators and alleviators, regardless of whether they meet 2SD threshold
X1_Specific_Aggravators <- X[which(X$Z_lm_K_Avg_X1 >= 2 & X$Z_lm_K_Avg_X2 < 2),]
X1_Specific_Alleviators <- X[which(X$Z_lm_K_Avg_X1 <= -2 & X$Z_lm_K_Avg_X2 > -2),]
X2_Specific_Aggravators <- X[which(X$Z_lm_K_Avg_X2 >= 2 & X$Z_lm_K_Avg_X1 < 2),]
X2_Specific_Alleviators <- X[which(X$Z_lm_K_Avg_X2 <= -2 & X$Z_lm_K_Avg_X1 > -2),]
Overlap_Aggravators <- X[which(X$Z_lm_K_Avg_X1 >= 2 & X$Z_lm_K_Avg_X2 >= 2),]
Overlap_Alleviators <- X[which(X$Z_lm_K_Avg_X1 <= -2 & X$Z_lm_K_Avg_X2 <= -2),]
X2_Specific_Aggravators_X1_Alleviatiors <- X[which(X$Z_lm_K_Avg_X2 >= 2 & X$Z_lm_K_Avg_X1 <= -2),]
X2_Specific_Alleviators_X1_Aggravators <- X[which(X$Z_lm_K_Avg_X2 <= -2 & X$Z_lm_K_Avg_X1 >= 2),]
X$Overlap_Avg <- NA
try(X[X$Term_Avg %in% X1_Specific_Aggravators$Term_Avg,]$Overlap_Avg <- paste(Name1,"Specific_Deletion_Suppressors",sep="_"))
try(X[X$Term_Avg %in% X1_Specific_Alleviators$Term_Avg,]$Overlap_Avg <- paste(Name1,"Specific_Deletion_Enhancers",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Aggravators$Term_Avg,]$Overlap_Avg <- paste(Name2,"Specific_Deletion_Suppressors",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Alleviators$Term_Avg,]$Overlap_Avg <- paste(Name2,"Specific_Deletion_Enhancers",sep="_"))
try(X[X$Term_Avg %in% Overlap_Aggravators$Term_Avg,]$Overlap_Avg <- "Overlapping_Deletion_Suppressors")
try(X[X$Term_Avg %in% Overlap_Alleviators$Term_Avg,]$Overlap_Avg <- "Overlapping_Deletion_Enhancers")
try(X[X$Term_Avg %in% X2_Specific_Aggravators_X1_Alleviatiors$Term_Avg,]$Overlap_Avg <- paste(Name2,"Deletion_Suppressors",Name1,"Deletion_Enhancers",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Alleviators_X1_Aggravators$Term_Avg,]$Overlap_Avg <- paste(Name2,"Deletion_Enhancers",Name1,"Deletion_Suppressors",sep="_"))
plotly_path <- paste(getwd(),"/",outputpath,"/","Scatter_lm_GTF_Averages_",Name1,"_vs_",Name2,"_All_byOverlap.html",sep="")
gg <- ggplot(data = X,aes(x=Z_lm_K_Avg_X1,y=Z_lm_K_Avg_X2,color=Overlap_Avg,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_K_SD_X1,SD_2=Z_lm_K_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(getwd(),"/",outputpath,"/","Scatter_lm_GTF_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap.pdf",sep=""),width = 12,height = 8)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#2-170")
#2
fname <- paste("/Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_byOverlap.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirK,fname))
#3
x_rem2_gene <- X[X$NumGenes_Avg_X1 >= 2 & X$NumGenes_Avg_X2 >= 2,]
plotly_path <- paste(getwd(),"/",outputpath,"/","Scatter_lm_GTF_Averages_",Name1,"_vs_",Name2,"_All_byOverlap_above2genes.html",sep="")
gg <- ggplot(data = x_rem2_gene,aes(x=Z_lm_K_Avg_X1,y=Z_lm_K_Avg_X2,color=Overlap_Avg,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_K_SD_X1,SD_2=Z_lm_K_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(getwd(),"/",outputpath,"/","Scatter_lm_GTF_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_above2genes.pdf",sep=""),width = 12,height = 8)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#3")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_byOverlap_above2genes.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirK,fname))
#4
X_overlap_nothresold <- X[!(is.na(X$Overlap_Avg)),]
gg <- ggplot(data = X_overlap_nothresold,aes(x=Z_lm_K_Avg_X1,y=Z_lm_K_Avg_X2,color=Overlap_Avg,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_K_SD_X1,SD_2=Z_lm_K_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep = "")) +
theme_Publication_legend_right()
pdf(paste(getwd(),"/",outputpath,"/","Scatter_lm_GTF_Averages_",Name1,"_vs_",Name2,"_Above2SD_ByOverlap.pdf",sep=""),width = 12,height = 8)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#4")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_Above2SD_ByOverlap.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirK,fname))
#5
#only output GTA terms where average score is still above 2 after subtracting the SD
#Z1 will ID aggravators, Z2 alleviators
Z1 <- X
Z1$L_Subtract_SD_X1 <- Z1$Z_lm_K_Avg_X1 - Z1$Z_lm_K_SD_X1
Z1$L_Subtract_SD_X2 <- Z1$Z_lm_K_Avg_X2 - Z1$Z_lm_K_SD_X2
Z2 <- X
Z2$L_Subtract_SD_X1 <- Z1$Z_lm_K_Avg_X1 + Z1$Z_lm_K_SD_X1
Z2$L_Subtract_SD_X2 <- Z1$Z_lm_K_Avg_X2 + Z1$Z_lm_K_SD_X2
X1_Specific_Aggravators2 <- Z1[which(Z1$L_Subtract_SD_X1 >= 2 & Z1$L_Subtract_SD_X2 < 2),]
X1_Specific_Alleviators2 <- Z2[which(Z2$L_Subtract_SD_X1 <= -2 & Z2$L_Subtract_SD_X2 > -2),]
X2_Specific_Aggravators2 <- Z1[which(Z1$L_Subtract_SD_X2 >= 2 & Z1$L_Subtract_SD_X1 < 2),]
X2_Specific_Alleviators2 <- Z2[which(Z2$L_Subtract_SD_X2 <= -2 & Z2$L_Subtract_SD_X1 > -2),]
Overlap_Aggravators2 <- Z1[which(Z1$L_Subtract_SD_X1 >= 2 & Z1$L_Subtract_SD_X2 >= 2),]
Overlap_Alleviators2 <- Z2[which(Z2$L_Subtract_SD_X2 <= -2 & Z2$L_Subtract_SD_X1 <= -2),]
X2_Specific_Aggravators2_X1_Alleviatiors2 <- Z1[which(Z1$L_Subtract_SD_X2 >= 2 & Z2$L_Subtract_SD_X1 <= -2),]
X2_Specific_Alleviators2_X1_Aggravators2 <- Z2[which(Z2$L_Subtract_SD_X2 <= -2 & Z1$L_Subtract_SD_X1 >= 2),]
X$Overlap <- NA
try(X[X$Term_Avg %in% X1_Specific_Aggravators2$Term_Avg,]$Overlap <- paste(Name1,"Specific_Deletion_Suppressors",sep="_"))
try(X[X$Term_Avg %in% X1_Specific_Alleviators2$Term_Avg,]$Overlap <- paste(Name1,"Specific_Deletion_Enhancers",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Aggravators2$Term_Avg,]$Overlap <- paste(Name2,"Specific_Deletion_Suppressors",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Alleviators2$Term_Avg,]$Overlap <- paste(Name2,"Specific_Deletion_Enhancers",sep="_"))
try(X[X$Term_Avg %in% Overlap_Aggravators2$Term_Avg,]$Overlap <- "Overlapping_Deletion_Suppressors")
try(X[X$Term_Avg %in% Overlap_Alleviators2$Term_Avg,]$Overlap <- "Overlapping_Deletion_Enhancers")
try(X[X$Term_Avg %in% X2_Specific_Aggravators2_X1_Alleviatiors2$Term_Avg,]$Overlap <- paste(Name2,"Deletion_Suppressors",Name1,"Deletion_Enhancers",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Alleviators2_X1_Aggravators2$Term_Avg,]$Overlap <- paste(Name2,"Deletion_Enhancers",Name1,"Deletion_Suppressors",sep="_"))
X_abovethreshold <- X[!(is.na(X$Overlap)),]
gg <- ggplot(data = X_abovethreshold,aes(x=Z_lm_K_Avg_X1,y=Z_lm_K_Avg_X2,color=Overlap,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_K_SD_X1,SD_2=Z_lm_K_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(getwd(),"/",outputpath,"/","Scatter_lm_GTF_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold.pdf",sep=""),width = 12,height = 8)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#5")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirK,fname))
#6
gg <- ggplot(data = X_abovethreshold,aes(x=Z_lm_K_Avg_X1,y=Z_lm_K_Avg_X2,color=Overlap,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_K_SD_X1,SD_2=Z_lm_K_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_text(aes(label=Term_Avg),nudge_y = 0.25,size=2) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3,size=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(getwd(),"/",outputpath,"/","Scatter_lm_GTF_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_names.pdf",sep=""),width = 20,height = 20)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#6")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_names.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirK,fname))
#7
X_abovethreshold$X1_Rank <- NA
X_abovethreshold$X1_Rank <- rank(-X_abovethreshold$Z_lm_K_Avg_X1,ties.method = "random")
X_abovethreshold$X2_Rank <- NA
X_abovethreshold$X2_Rank <- rank(-X_abovethreshold$Z_lm_K_Avg_X2,ties.method = "random")
gg <- ggplot(data = X_abovethreshold,aes(x=Z_lm_K_Avg_X1,y=Z_lm_K_Avg_X2,color=Overlap,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_K_SD_X1,SD_2=Z_lm_K_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_text(aes(label=X1_Rank),nudge_y = 0.25,size=4) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3,size=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(getwd(),"/",outputpath,"/","Scatter_lm_GTF_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_numberedX1.pdf",sep=""),width = 15,height = 15)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#7")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_numberedX1.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirK,fname))
#8
gg <- ggplot(data = X_abovethreshold,aes(x=Z_lm_K_Avg_X1,y=Z_lm_K_Avg_X2,color=Overlap,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_K_SD_X1,SD_2=Z_lm_K_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_text(aes(label=X2_Rank),nudge_y = 0.25,size=4) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3,size=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(getwd(),"/",outputpath,"/","Scatter_lm_GTF_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_numberedX2.pdf",sep=""),width = 15,height = 15)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#8")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_numberedX2.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirK,fname))
print("write csv files")
write.csv(x=X,file = paste(getwd(),"/",outputpath,"/","All_GTF_Avg_Scores_",Name1,"_vs_",Name2,".csv",sep=""),row.names = FALSE)
write.csv(x=X_abovethreshold,file = paste(getwd(),"/",outputpath,"/","AboveThreshold_GTF_Avg_Scores_",Name1,"_vs_",Name2,".csv",sep=""),row.names = FALSE)
#End of GTA Pairwise compare for K values

View File

@@ -0,0 +1,332 @@
#4.This R script performs GTA L Pairwise Compares for user specified pairs of Experiments
#Arg1 is the first Experiment or a user ordered pair (i.e., Exp3)
#Arg2 is the second Experiment or a user ordered pair (i.e., Exp4)
#Note user can put whatever names they wish for the Canonical Exp1..4 in the ../Code/ExpLabels.txt spread sheet
#which correlates the canonical Exp Name with the user stylized label for plots and output files.
library(ggplot2)
library(plotly)
library(htmlwidgets)
library(extrafont)
library(grid)
library(ggthemes)
Args <- commandArgs(TRUE)
expNm= Args[1] #i.e., "Exp3"
expNm[2]= Args[2] #i.e., "Exp4"
expNumber1<- as.numeric(sub("^.*?(\\d+)$", "\\1", expNm[1]))
expNumber2<- as.numeric(sub("^.*?(\\d+)$", "\\1", expNm[2]))
#labels <- read.delim("ExpLabels.txt",skip=0,as.is=T,row.names=1,strip.white=TRUE)
labels <- read.delim("StudyInfo.txt",skip=0,as.is=T,row.names=1,strip.white=TRUE)
Name1 <- labels[expNumber1,1] #ssArg2 These are now supplied by Code/ExpLabels.txt which is user edited
Name2 <- labels[expNumber2,1] #ssArg4
Wstudy= getwd()
input_file1 <- paste0("../GTAresults/",expNm[1],"/Average_GOTerms_All.csv" ) #Args[1]
input_file2 <- paste0("../GTAresults/",expNm[2],"/Average_GOTerms_All.csv" ) #Args[3]
pairDirL= paste0("../GTAresults/","PairwiseCompareL_",expNm[1],"-",expNm[2])
pairDirK= paste0("../GTAresults/","PairwiseCompareK_",expNm[1],"-",expNm[2])
outPathGTAcompare= "../GTAresults/PairwiseCompareL" #paste0(Wstudy,"/GTAresults/PairwiseCompareL)
outPathGTAcompare[2]= "../GTAresults/PairwiseCompareK" #paste0(Wstudy,"/GTAresults/PairwiseCompareK")
#dir.create(outPathGTAcompare[1])
dir.create(pairDirL) #(outPathGTAcompare[1])
dir.create(pairDirK) #(outPathGTAcompare[2])
###########BEGIN PAIRWISE L-----LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
#define the output path (as fourth argument from Rscript)
outputpath <- pairDirL #outPathGTAcompare[1] #Args[5]
#outputPlotly <- "../GTAresults/PairwiseCompareL/" #"/GTAresults/PairwiseCompareL/"
print("39")
#theme elements for plots
theme_Publication <- function(base_size=14, base_family="sans") {
(theme_foundation(base_size=base_size, base_family=base_family)
+ theme(plot.title = element_text(face = "bold",
size = rel(1.2), hjust = 0.5),
text = element_text(),
panel.background = element_rect(colour = NA),
plot.background = element_rect(colour = NA),
panel.border = element_rect(colour = NA),
axis.title = element_text(face = "bold",size = rel(1)),
axis.title.y = element_text(angle=90,vjust =2),
axis.title.x = element_text(vjust = -0.2),
axis.text = element_text(),
axis.line = element_line(colour="black"),
axis.ticks = element_line(),
panel.grid.major = element_line(colour="#f0f0f0"),
panel.grid.minor = element_blank(),
legend.key = element_rect(colour = NA),
legend.position = "bottom",
legend.direction = "horizontal",
legend.key.size= unit(0.2, "cm"),
legend.spacing = unit(0, "cm"),
legend.title = element_text(face="italic"),
plot.margin=unit(c(10,5,5,5),"mm"),
strip.background=element_rect(colour="#f0f0f0",fill="#f0f0f0"),
strip.text = element_text(face="bold")
))
}
scale_fill_Publication <- function(...){
library(scales)
discrete_scale("fill","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
}
scale_colour_Publication <- function(...){
discrete_scale("colour","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
}
theme_Publication_legend_right <- function(base_size=14, base_family="sans") {
(theme_foundation(base_size=base_size, base_family=base_family)
+ theme(plot.title = element_text(face = "bold",
size = rel(1.2), hjust = 0.5),
text = element_text(),
panel.background = element_rect(colour = NA),
plot.background = element_rect(colour = NA),
panel.border = element_rect(colour = NA),
axis.title = element_text(face = "bold",size = rel(1)),
axis.title.y = element_text(angle=90,vjust =2),
axis.title.x = element_text(vjust = -0.2),
axis.text = element_text(),
axis.line = element_line(colour="black"),
axis.ticks = element_line(),
panel.grid.major = element_line(colour="#f0f0f0"),
panel.grid.minor = element_blank(),
legend.key = element_rect(colour = NA),
legend.position = "right",
legend.direction = "vertical",
legend.key.size= unit(0.5, "cm"),
legend.spacing = unit(0, "cm"),
legend.title = element_text(face="italic"),
plot.margin=unit(c(10,5,5,5),"mm"),
strip.background=element_rect(colour="#f0f0f0",fill="#f0f0f0"),
strip.text = element_text(face="bold")
))
}
scale_fill_Publication <- function(...){
discrete_scale("fill","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
}
scale_colour_Publication <- function(...){
discrete_scale("colour","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
}
X1 <- read.csv(file = input_file1,stringsAsFactors=FALSE,header = TRUE)
X2 <- read.csv(file = input_file2,stringsAsFactors=FALSE,header = TRUE)
print(117)
X <- merge(X1,X2,by ="Term_Avg",all=TRUE,suffixes = c("_X1","_X2"))
gg <- ggplot(data = X,aes(x=Z_lm_L_Avg_X1,y=Z_lm_L_Avg_X2,color=Ontology_Avg_X1,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_L_SD_X1,SD_2=Z_lm_L_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep = "")) +
theme_Publication_legend_right()
pdf(paste(outputpath,"/","Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOntology.pdf",sep=""),width = 12,height = 8)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("130")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_byOntology.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirL,fname))
#ID aggravators and alleviators, regardless of whether they meet 2SD threshold
X1_Specific_Aggravators <- X[which(X$Z_lm_L_Avg_X1 >= 2 & X$Z_lm_L_Avg_X2 < 2),]
X1_Specific_Alleviators <- X[which(X$Z_lm_L_Avg_X1 <= -2 & X$Z_lm_L_Avg_X2 > -2),]
X2_Specific_Aggravators <- X[which(X$Z_lm_L_Avg_X2 >= 2 & X$Z_lm_L_Avg_X1 < 2),]
X2_Specific_Alleviators <- X[which(X$Z_lm_L_Avg_X2 <= -2 & X$Z_lm_L_Avg_X1 > -2),]
Overlap_Aggravators <- X[which(X$Z_lm_L_Avg_X1 >= 2 & X$Z_lm_L_Avg_X2 >= 2),]
Overlap_Alleviators <- X[which(X$Z_lm_L_Avg_X1 <= -2 & X$Z_lm_L_Avg_X2 <= -2),]
X2_Specific_Aggravators_X1_Alleviatiors <- X[which(X$Z_lm_L_Avg_X2 >= 2 & X$Z_lm_L_Avg_X1 <= -2),]
X2_Specific_Alleviators_X1_Aggravators <- X[which(X$Z_lm_L_Avg_X2 <= -2 & X$Z_lm_L_Avg_X1 >= 2),]
print("155")
X$Overlap_Avg <- NA
try(X[X$Term_Avg %in% X1_Specific_Aggravators$Term_Avg,]$Overlap_Avg <- paste(Name1,"Specific_Deletion_Enhancers",sep="_"))
try(X[X$Term_Avg %in% X1_Specific_Alleviators$Term_Avg,]$Overlap_Avg <- paste(Name1,"Specific_Deletion_Suppresors",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Aggravators$Term_Avg,]$Overlap_Avg <- paste(Name2,"Specific_Deletion_Enhancers",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Alleviators$Term_Avg,]$Overlap_Avg <- paste(Name2,"Specific_Deletion_Suppressors",sep="_"))
try(X[X$Term_Avg %in% Overlap_Aggravators$Term_Avg,]$Overlap_Avg <- "Overlapping_Deletion_Enhancers")
try(X[X$Term_Avg %in% Overlap_Alleviators$Term_Avg,]$Overlap_Avg <- "Overlapping_Deletion_Suppressors")
try(X[X$Term_Avg %in% X2_Specific_Aggravators_X1_Alleviatiors$Term_Avg,]$Overlap_Avg <- paste(Name2,"Deletion_Enhancers",Name1,"Deletion_Suppressors",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Alleviators_X1_Aggravators$Term_Avg,]$Overlap_Avg <- paste(Name2,"Deletion_Suppressors",Name1,"Deletion_Enhancers",sep="_"))
gg <- ggplot(data = X,aes(x=Z_lm_L_Avg_X1,y=Z_lm_L_Avg_X2,color=Overlap_Avg,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_L_SD_X1,SD_2=Z_lm_L_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(outputpath,"/","Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap.pdf",sep=""),width = 12,height = 8)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#2-174")
#2
fname <- paste("/Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_byOverlap.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirL,fname))
x_rem2_gene <- X[X$NumGenes_Avg_X1 >= 2 & X$NumGenes_Avg_X2 >= 2,]
#3
gg <- ggplot(data = x_rem2_gene,aes(x=Z_lm_L_Avg_X1,y=Z_lm_L_Avg_X2,color=Overlap_Avg,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_L_SD_X1,SD_2=Z_lm_L_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(outputpath,"/","Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_above2genes.pdf",sep=""),width = 12,height = 8)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#3")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_byOverlap_above2genes.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirL,fname))
#4
X_overlap_nothresold <- X[!(is.na(X$Overlap_Avg)),]
gg <- ggplot(data = X_overlap_nothresold,aes(x=Z_lm_L_Avg_X1,y=Z_lm_L_Avg_X2,color=Overlap_Avg,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_L_SD_X1,SD_2=Z_lm_L_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep = "")) +
theme_Publication_legend_right()
pdf(paste(outputpath,"/","Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_Above2SD_ByOverlap.pdf",sep=""),width = 12,height = 8)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#4")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_Above2SD_ByOverlap.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirL,fname))
#only output GTA terms where average score is still above 2 after subtracting the SD
#Z1 will ID aggravators, Z2 alleviators
Z1 <- X
Z1$L_Subtract_SD_X1 <- Z1$Z_lm_L_Avg_X1 - Z1$Z_lm_L_SD_X1
Z1$L_Subtract_SD_X2 <- Z1$Z_lm_L_Avg_X2 - Z1$Z_lm_L_SD_X2
Z2 <- X
Z2$L_Subtract_SD_X1 <- Z1$Z_lm_L_Avg_X1 + Z1$Z_lm_L_SD_X1
Z2$L_Subtract_SD_X2 <- Z1$Z_lm_L_Avg_X2 + Z1$Z_lm_L_SD_X2
X1_Specific_Aggravators2 <- Z1[which(Z1$L_Subtract_SD_X1 >= 2 & Z1$L_Subtract_SD_X2 < 2),]
X1_Specific_Alleviators2 <- Z2[which(Z2$L_Subtract_SD_X1 <= -2 & Z2$L_Subtract_SD_X2 > -2),]
X2_Specific_Aggravators2 <- Z1[which(Z1$L_Subtract_SD_X2 >= 2 & Z1$L_Subtract_SD_X1 < 2),]
X2_Specific_Alleviators2 <- Z2[which(Z2$L_Subtract_SD_X2 <= -2 & Z2$L_Subtract_SD_X1 > -2),]
Overlap_Aggravators2 <- Z1[which(Z1$L_Subtract_SD_X1 >= 2 & Z1$L_Subtract_SD_X2 >= 2),]
Overlap_Alleviators2 <- Z2[which(Z2$L_Subtract_SD_X2 <= -2 & Z2$L_Subtract_SD_X1 <= -2),]
X2_Specific_Aggravators2_X1_Alleviatiors2 <- Z1[which(Z1$L_Subtract_SD_X2 >= 2 & Z2$L_Subtract_SD_X1 <= -2),]
X2_Specific_Alleviators2_X1_Aggravators2 <- Z2[which(Z2$L_Subtract_SD_X2 <= -2 & Z1$L_Subtract_SD_X1 >= 2),]
X$Overlap <- NA
try(X[X$Term_Avg %in% X1_Specific_Aggravators2$Term_Avg,]$Overlap <- paste(Name1,"Specific_Deletion_Enhancers",sep="_"))
try(X[X$Term_Avg %in% X1_Specific_Alleviators2$Term_Avg,]$Overlap <- paste(Name1,"Specific_Deletion_Suppresors",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Aggravators2$Term_Avg,]$Overlap <- paste(Name2,"Specific_Deletion_Enhancers",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Alleviators2$Term_Avg,]$Overlap <- paste(Name2,"Specific_Deletion_Suppressors",sep="_"))
try(X[X$Term_Avg %in% Overlap_Aggravators2$Term_Avg,]$Overlap <- "Overlapping_Deletion_Enhancers")
try(X[X$Term_Avg %in% Overlap_Alleviators2$Term_Avg,]$Overlap <- "Overlapping_Deletion_Suppressors")
try(X[X$Term_Avg %in% X2_Specific_Aggravators2_X1_Alleviatiors2$Term_Avg,]$Overlap <- paste(Name2,"Deletion_Enhancers",Name1,"Deletion_Suppressors",sep="_"))
try(X[X$Term_Avg %in% X2_Specific_Alleviators2_X1_Aggravators2$Term_Avg,]$Overlap <- paste(Name2,"Deletion_Suppressors",Name1,"Deletion_Enhancers",sep="_"))
#5
X_abovethreshold <- X[!(is.na(X$Overlap)),]
gg <- ggplot(data = X_abovethreshold,aes(x=Z_lm_L_Avg_X1,y=Z_lm_L_Avg_X2,color=Overlap,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_L_SD_X1,SD_2=Z_lm_L_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(outputpath,"/","Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold.pdf",sep=""),width = 12,height = 8)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#5")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirL,fname))
#6
gg <- ggplot(data = X_abovethreshold,aes(x=Z_lm_L_Avg_X1,y=Z_lm_L_Avg_X2,color=Overlap,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_L_SD_X1,SD_2=Z_lm_L_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_text(aes(label=Term_Avg),nudge_y = 0.25,size=2) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3,size=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(outputpath,"/","Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_names.pdf",sep=""),width = 20,height = 20)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#6")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_names.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirL,fname))
X_abovethreshold$X1_Rank <- NA
X_abovethreshold$X1_Rank <- rank(-X_abovethreshold$Z_lm_L_Avg_X1,ties.method = "random")
X_abovethreshold$X2_Rank <- NA
X_abovethreshold$X2_Rank <- rank(-X_abovethreshold$Z_lm_L_Avg_X2,ties.method = "random")
#7
gg <- ggplot(data = X_abovethreshold,aes(x=Z_lm_L_Avg_X1,y=Z_lm_L_Avg_X2,color=Overlap,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_L_SD_X1,SD_2=Z_lm_L_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_text(aes(label=X1_Rank),nudge_y = 0.25,size=4) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3,size=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(outputpath,"/","Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_numberedX1.pdf",sep=""),width = 15,height = 15)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#7")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_numberedX1.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirL,fname))
#8
gg <- ggplot(data = X_abovethreshold,aes(x=Z_lm_L_Avg_X1,y=Z_lm_L_Avg_X2,color=Overlap,Term=Term_Avg,Genes=Genes_Avg_X1,NumGenes=NumGenes_Avg_X1,AllPossibleGenes=AllPossibleGenes_Avg_X1,SD_1=Z_lm_L_SD_X1,SD_2=Z_lm_L_SD_X2)) +
xlab(paste("GO Term Avg lm Z for ",Name1,sep="")) +
geom_text(aes(label=X2_Rank),nudge_y = 0.25,size=4) +
geom_rect(aes(xmin=-2,xmax=2,ymin=-2,ymax=2),color="grey20",size=0.25,alpha=0.1,inherit.aes = FALSE,fill=NA) + geom_point(shape=3,size=3) +
ylab(paste("GO Term Avg lm Z for ",Name2,sep="")) + ggtitle(paste("Comparing Average GO Term Z lm for ",Name1," vs. ",Name2,sep="")) +
theme_Publication_legend_right()
pdf(paste(outputpath,"/","Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_numberedX2.pdf",sep=""),width = 15,height = 15)
gg
dev.off()
pgg <- ggplotly(gg)
#pgg
print("#8")
fname <- paste("Scatter_lm_GTA_Averages_",Name1,"_vs_",Name2,"_All_ByOverlap_AboveThreshold_numberedX2.html",sep="")
print(fname)
htmlwidgets::saveWidget(pgg, file.path(getwd(),fname))
file.rename(from = file.path(getwd(),fname), to = file.path(pairDirL,fname))
print("write csv files L")
write.csv(x=X,file = paste(outputpath,"/All_GTA_Avg_Scores_",Name1,"_vs_",Name2,".csv",sep=""),row.names = FALSE)
write.csv(x=X_abovethreshold,file = paste(getwd(),"/",outputpath,"/","AboveThreshold_GTA_Avg_Scores_",Name1,"_vs_",Name2,".csv",sep=""),row.names = FALSE)
#End of L GTA Pairwise Compare

View File

@@ -0,0 +1,43 @@
# Finding correlation between removing_bad_spots_at_start and Sean's results for YOR1_dF
# Intended to be run in RStudio, setting working directory to source code
library(ggplot2)
library(dplyr)
# Read in the data
sean_data <- read.csv("ZScores_Interaction_Sean.csv",stringsAsFactors = FALSE) SS_ZScores_Interaction.csv
remy_data <- read.csv("ZScores_Interaction_Remy.csv",stringsAsFactors = FALSE) JRcurated_ZScores_Interaction.csv
# We only care about L and K z scores for now, filter out other
# stuff. Then, remove NAs; then, sort so they both match up.
sean_data_filtered <- as_tibble(sean_data)
sean_data_filtered <- select(sean_data_filtered,OrfRep,Z_lm_L,Z_lm_K)
sean_data_filtered <- filter(sean_data_filtered,!is.na(Z_lm_L),!is.na(Z_lm_K))
sean_data_filtered <- arrange(sean_data_filtered,OrfRep)
remy_data_filtered <- as_tibble(remy_data)
remy_data_filtered <- select(remy_data_filtered,OrfRep,Z_lm_L,Z_lm_K)
remy_data_filtered <- filter(remy_data_filtered,!is.na(Z_lm_L),!is.na(Z_lm_K))
remy_data_filtered <- arrange(remy_data_filtered,OrfRep)
# Now everything is lined up, do linear model of trying to predict
# Sean L zscore with Remy L zscore, and make a plot
l_linear_model = lm(sean_data_filtered$Z_lm_L ~ remy_data_filtered$Z_lm_L)
summary(l_linear_model)
l_data = as.data.frame(cbind(remy_data_filtered$Z_lm_L,sean_data_filtered$Z_lm_L)) # Remy is V1 column, Sean is V2
#View(l_data)
l_gg <- ggplot(data=l_data,aes(x=V1,y=V2)) + labs(x="Remy_L",y="Sean_L")+ geom_point()
plot(l_gg)
# Repeat for K zscore
k_linear_model = lm(sean_data_filtered$Z_lm_K ~ remy_data_filtered$Z_lm_K)
summary(k_linear_model)
k_data = as.data.frame(cbind(remy_data_filtered$Z_lm_K,sean_data_filtered$Z_lm_K)) # Remy is V1 column, Sean is V2
#View(l_data)
l_gg <- ggplot(data=k_data,aes(x=V1,y=V2)) + labs(x="Remy_K",y="Sean_K")+ geom_point()
plot(l_gg)

View File

@@ -0,0 +1,765 @@
library("ontologyIndex")
library("ggplot2")
library("RColorBrewer")
library("grid")
library("ggthemes")
#library("plotly")
#library("htmlwidgets")
library("extrafont")
library("stringr")
library("org.Sc.sgd.db")
library("ggrepel")
library(gplots)
Wstudy=getwd()
inputFile= 'asdf'
inputFile[1] <- "../Exp1/ZScores/ZScores_Interaction.csv" #paste0(Wstudy,"/Exp1/ZScores/ZScores_Interaction.csv")
inputFile[2] <- "../Exp2/ZScores/ZScores_Interaction.csv"
inputFile[3] <- "../Exp3/ZScores/ZScores_Interaction.csv"
inputFile[4] <- "../Exp4/ZScores/ZScores_Interaction.csv"
inputFile[5] <- "../Exp5/ZScores/ZScores_Interaction.csv"
#labels <- read.delim("ExpLabels.txt",skip=0,as.is=T,row.names=1,strip.white=TRUE)
#labels <- read.delim("StudyInfo.csv",skip=0,as.is=T,row.names=1,strip.white=TRUE)
labels<- read.csv(file= "StudyInfo.csv",stringsAsFactors = FALSE)
lstExpNum= 'asdf'
a=0
#R can't index data.frame's so some stupid nasty code must be implemented
if (file.exists(inputFile[1])){
X1 <- (read.csv(file = inputFile[1],stringsAsFactors=FALSE,header = TRUE))
a=a+1
lstExpNum[a]= 1
Name1 <- labels[1,1]} #ssArg2 These are now supplied by Code/ExpLabels.txt which is user edited
if (file.exists(inputFile[2])){
X2 <- (read.csv(file = inputFile[2],stringsAsFactors=FALSE,header = TRUE))
a=a+1
lstExpNum[a]= 2
Name2 <- labels[2,1]}
if (file.exists(inputFile[3])){
X3 <- (read.csv(file = inputFile[3],stringsAsFactors=FALSE,header = TRUE))
a=a+1
lstExpNum[a]= 3
Name3 <- labels[3,1]} #ssArg2 These are now supplied by Code/ExpLabels.txt which is user edited
if (file.exists(inputFile[4])){
X4 <- (read.csv(file = inputFile[4],stringsAsFactors=FALSE,header = TRUE))
a=a+1
lstExpNum[a]= 4
Name4 <- labels[4,1]}
if (file.exists(inputFile[5])){
X5 <- (read.csv(file = inputFile[5],stringsAsFactors=FALSE,header = TRUE))
a=a+1
lstExpNum[a]= 5
Name5 <- labels[5,1]}
#--------------------------Standard Names-------------------------------------------------------
#ExpNames= c('Exp1','Exp2','Exp3','Exp4','Exp5')
#expNumber1<- as.numeric(sub("^.*?(\\d+)$", "\\1", expNm[1]))
#expNumber2<- as.numeric(sub("^.*?(\\d+)$", "\\1", expNm[2]))
#expNumber3<- as.numeric(sub("^.*?(\\d+)$", "\\1", expNm[3]))
#expNumber4<- as.numeric(sub("^.*?(\\d+)$", "\\1", expNm[4]))
#Name1= ExpNames[1]
#Name2= ExpNames[2]
#Name3= ExpNames[3]
#Name4= ExpNames[4]
#Name5= ExpNames[5]
print('52')
#----------------------TABLES------------------------------------------------------------
#import standard tables used in Sean's code That should be copied to each ExpStudy
ontology_obo_input <- "gene_ontology_edit.obo" #paste0(Wstudy,"/Code/gene_ontology_edit.obo") # Args[5]
GOtermstab_file <- "go_terms.tab"
GO_ID_Arg <-"All_SGD_GOTerms_for_QHTCPtk.csv" #All_SGD_GOTerms.csv #Args[7]
Ontology <- get_ontology(file=ontology_obo_input,propagate_relationships = "is_a",extract_tags = "minimal")
GO2ALLORFs <- as.list(org.Sc.sgdGO2ALLORFS) #all ORFs associated with GO term
Terms <- read.delim(file=GOtermstab_file,header=FALSE,quote = "",col.names = c("GO_ID","GO_Term","GO_Aspect","GO_Term_Definition"))
#----------------------------------------------------------------------------
#The directory to put the results into. Sean puts this in the 'Home' directory
subDir <- "../TermSpecificHeatmaps"
if (file.exists(subDir)){
outputpath <- subDir
} else {
dir.create(file.path(subDir))
}
outputpath <- "../TermSpecificHeatmaps/" #paste0(Wstudy,"/TermSpecificHeatmaps/")
print(outputpath)
print('73')
#-----------------------------------------------------------------------------------
XX3 <- read.csv(file = GO_ID_Arg,stringsAsFactors=FALSE,header = TRUE)
XX3[,1] <- paste("GO:",formatC(XX3[,1],width=7,flag="0"),sep="")
XX3[,2] <- gsub(pattern = " ",replacement = "_",x = XX3[,2])
XX3[,2] <- gsub(pattern = "/",replacement = "_",x = XX3[,2])
print('80')
#rm(X,)
#Exp1--------------------------------------------------
if (file.exists(inputFile[1])){
print('84')
X1$ORF <- X1$OrfRep
X1$ORF <- gsub("_1","",x=X1$ORF)
X1$ORF <- gsub("_2","",x=X1$ORF)
X1$ORF <- gsub("_3","",x=X1$ORF)
X1$ORF <- gsub("_4","",x=X1$ORF)
X1$Score_L <- "No Effect"
try(X1[is.na(X1$Z_lm_L),]$Score_L <- "No Growth")
try(X1[!is.na(X1$Z_lm_L) & X1$Z_lm_L >= 2,]$Score_L <- "Deletion Enhancer")
try(X1[!is.na(X1$Z_lm_L) & X1$Z_lm_L <= -2,]$Score_L <- "Deletion Suppressor")
X1$Score_K <- "No Effect"
try(X1[is.na(X1$Z_lm_K),]$Score_K <- "No Growth")
try(X1[!is.na(X1$Z_lm_K) & X1$Z_lm_K >= 2,]$Score_K <- "Deletion Suppressor")
try(X1[!is.na(X1$Z_lm_K) & X1$Z_lm_K <= -2,]$Score_K <- "Deletion Enhancer")
#express the na data as 0.001 in X1 for K and L
X1[is.na(X1$Z_lm_L),]$Z_lm_L <- 0.001
X1[is.na(X1$Z_lm_K),]$Z_lm_K <- 0.001
X1$Rank_L <- rank(X1$Z_lm_L)
X1$Rank_K <- rank(X1$Z_lm_K)
X1 <- X1[order(X1$OrfRep,decreasing = FALSE),]
colnames(X1) <- paste(colnames(X1),"_X1",sep="")
print('110')
}
print('112')
#Exp2------------------------------------------------------------------------
if (file.exists(inputFile[2])){
X2$ORF <- X2$OrfRep
X2$ORF <- gsub("_1","",x=X2$ORF)
X2$ORF <- gsub("_2","",x=X2$ORF)
X2$ORF <- gsub("_3","",x=X2$ORF)
X2$ORF <- gsub("_4","",x=X2$ORF)
X2$Score_L <- "No Effect"
try(X2[is.na(X2$Z_lm_L),]$Score_L <- "No Growth")
try(X2[!is.na(X2$Z_lm_L) & X2$Z_lm_L >= 2,]$Score_L <- "Deletion Enhancer")
try(X2[!is.na(X2$Z_lm_L) & X2$Z_lm_L <= -2,]$Score_L <- "Deletion Suppressor")
X2$Score_K <- "No Effect"
try(X2[is.na(X2$Z_lm_K),]$Score_K <- "No Growth")
try(X2[!is.na(X2$Z_lm_K) & X2$Z_lm_K >= 2,]$Score_K <- "Deletion Suppressor")
try(X2[!is.na(X2$Z_lm_K) & X2$Z_lm_K <= -2,]$Score_K <- "Deletion Enhancer")
#express the na data as 0.001 in X2
X2[is.na(X2$Z_lm_L),]$Z_lm_L <- 0.001
X2[is.na(X2$Z_lm_K),]$Z_lm_K <- 0.001
X2$Rank_L <- rank(X2$Z_lm_L)
X2$Rank_K <- rank(X2$Z_lm_K)
X2 <- X2[order(X2$OrfRep,decreasing = FALSE),]
colnames(X2) <- paste(colnames(X2),"_X2",sep="")
X <- cbind(X1,X2)
print('file2-140')
}
print('142')
#Exp3--------------------------------------------------------------
if (file.exists(inputFile[3])){
X3$ORF <- X3$OrfRep
X3$ORF <- gsub("_1","",x=X3$ORF)
X3$ORF <- gsub("_2","",x=X3$ORF)
X3$ORF <- gsub("_3","",x=X3$ORF)
X3$ORF <- gsub("_4","",x=X3$ORF)
X3$Score_L <- "No Effect"
try(X3[is.na(X3$Z_lm_L),]$Score_L <- "No Growth")
try(X3[!is.na(X3$Z_lm_L) & X3$Z_lm_L >= 2,]$Score_L <- "Deletion Enhancer")
try(X3[!is.na(X3$Z_lm_L) & X3$Z_lm_L <= -2,]$Score_L <- "Deletion Suppressor")
X3$Score_K <- "No Effect"
try(X3[is.na(X3$Z_lm_K),]$Score_K <- "No Growth")
try(X3[!is.na(X3$Z_lm_K) & X3$Z_lm_K >= 2,]$Score_K <- "Deletion Suppressor")
try(X3[!is.na(X3$Z_lm_K) & X3$Z_lm_K <= -2,]$Score_K <- "Deletion Enhancer")
#express the na data as 0.001 in X3
X3[is.na(X3$Z_lm_L),]$Z_lm_L <- 0.001
X3[is.na(X3$Z_lm_K),]$Z_lm_K <- 0.001
X3$Rank_L <- rank(X3$Z_lm_L)
X3$Rank_K <- rank(X3$Z_lm_K)
X3 <- X3[order(X3$OrfRep,decreasing = FALSE),]
colnames(X3) <- paste(colnames(X3),"_X3",sep="")
X <- cbind(X,X3)
}
#Exp4
if (file.exists(inputFile[4])){
X4$ORF <- X4$OrfRep
X4$ORF <- gsub("_1","",x=X4$ORF)
X4$ORF <- gsub("_2","",x=X4$ORF)
X4$ORF <- gsub("_3","",x=X4$ORF)
X4$ORF <- gsub("_4","",x=X4$ORF)
X4$Score_L <- "No Effect"
try(X4[is.na(X4$Z_lm_L),]$Score_L <- "No Growth")
try(X4[!is.na(X4$Z_lm_L) & X4$Z_lm_L >= 2,]$Score_L <- "Deletion Enhancer")
try(X4[!is.na(X4$Z_lm_L) & X4$Z_lm_L <= -2,]$Score_L <- "Deletion Suppressor")
X4$Score_K <- "No Effect"
try(X4[is.na(X4$Z_lm_K),]$Score_K <- "No Growth")
try(X4[!is.na(X4$Z_lm_K) & X4$Z_lm_K >= 2,]$Score_K <- "Deletion Suppressor")
try(X4[!is.na(X4$Z_lm_K) & X4$Z_lm_K <= -2,]$Score_K <- "Deletion Enhancer")
#express the na data as 0.001 in X4
X4[is.na(X4$Z_lm_L),]$Z_lm_L <- 0.001
X4[is.na(X4$Z_lm_K),]$Z_lm_K <- 0.001
X4$Rank_L <- rank(X4$Z_lm_L)
X4$Rank_K <- rank(X4$Z_lm_K)
X4 <- X4[order(X4$OrfRep,decreasing = FALSE),]
colnames(X4) <- paste(colnames(X4),"_X4",sep="")
X <- cbind(X,X4)
}
#Exp5--------------------------------------------------------------
if (file.exists(inputFile[5])){
X5$ORF <- X5$OrfRep
X5$ORF <- gsub("_1","",x=X5$ORF)
X5$ORF <- gsub("_2","",x=X5$ORF)
X5$ORF <- gsub("_3","",x=X5$ORF)
X5$ORF <- gsub("_4","",x=X5$ORF)
X5$Score_L <- "No Effect"
try(X5[is.na(X5$Z_lm_L),]$Score_L <- "No Growth")
try(X5[!is.na(X5$Z_lm_L) & X5$Z_lm_L >= 2,]$Score_L <- "Deletion Enhancer")
try(X5[!is.na(X5$Z_lm_L) & X5$Z_lm_L <= -2,]$Score_L <- "Deletion Suppressor")
X5$Score_K <- "No Effect"
try(X5[is.na(X5$Z_lm_K),]$Score_K <- "No Growth")
try(X5[!is.na(X5$Z_lm_K) & X5$Z_lm_K >= 2,]$Score_K <- "Deletion Suppressor")
try(X5[!is.na(X5$Z_lm_K) & X5$Z_lm_K <= -2,]$Score_K <- "Deletion Enhancer")
#express the na data as 0.001 in X5
X5[is.na(X5$Z_lm_L),]$Z_lm_L <- 0.001
X5[is.na(X5$Z_lm_K),]$Z_lm_K <- 0.001
X5$Rank_L <- rank(X5$Z_lm_L)
X5$Rank_K <- rank(X5$Z_lm_K)
X5 <- X5[order(X5$OrfRep,decreasing = FALSE),]
colnames(X5) <- paste(colnames(X5),"_X5",sep="")
X <- cbind(X,X5)
}
print('after5-229')
X$ORF <- X$OrfRep_X1
part1=1
if (file.exists(inputFile[1])& file.exists(inputFile[2])){
print('234 ifFile2')
X$ORF <- gsub("_1","",x=X$ORF)
try(X[X$Gene_X1 == "",]$Gene_X1 <- X[X$Gene_X1 == "",]$OrfRep_X1)
try(X[X$Gene_X2 == "",]$Gene_X2 <- X[X$Gene_X2 == "",]$OrfRep_X2)
X_heatmap <- X[colnames(X) == "ORF" | colnames(X) == "Gene_X1" |
colnames(X) == "Z_Shift_K_X1" | colnames(X) == "Z_lm_K_X1" |
colnames(X) == "Z_Shift_K_X2" | colnames(X) == "Z_lm_K_X2" |
colnames(X) == "Z_Shift_L_X1" | colnames(X) == "Z_lm_L_X1" |
colnames(X) == "Z_Shift_L_X2" | colnames(X) == "Z_lm_L_X2" ]
X_heatmap <- X_heatmap[,c(10,1,4,5,8,9,2,3,6,7)]
colnames(X_heatmap) <- gsub(pattern = "X1",replacement = Name1,colnames(X_heatmap))
colnames(X_heatmap) <- gsub(pattern = "X2",replacement = Name2,colnames(X_heatmap))
colnames(X_heatmap)[2] <- "Gene"
}
if (file.exists(inputFile[3])){
X$ORF <- gsub("_1","",x=X$ORF)
X$ORF <- gsub("_2","",x=X$ORF)
try(X[X$Gene_X1 == "",]$Gene_X1 <- X[X$Gene_X1 == "",]$OrfRep_X1)
try(X[X$Gene_X2 == "",]$Gene_X2 <- X[X$Gene_X2 == "",]$OrfRep_X2)
try(X[X$Gene_X3 == "",]$Gene_X3 <- X[X$Gene_X3 == "",]$OrfRep_X3)
X_heatmap <- X[colnames(X) == "ORF" | colnames(X) == "Gene_X1" |
colnames(X) == "Z_Shift_K_X1" | colnames(X) == "Z_lm_K_X1" |
colnames(X) == "Z_Shift_K_X2" | colnames(X) == "Z_lm_K_X2" |
colnames(X) == "Z_Shift_K_X3" | colnames(X) == "Z_lm_K_X3" |
colnames(X) == "Z_Shift_L_X1" | colnames(X) == "Z_lm_L_X1" |
colnames(X) == "Z_Shift_L_X2" | colnames(X) == "Z_lm_L_X2" |
colnames(X) == "Z_Shift_L_X3" | colnames(X) == "Z_lm_L_X3" ]
#Reorder columns
X_heatmap <- X_heatmap[,c(14,1,4,5,8,9,12,13,2,3,6,7,10,11)] #Three
colnames(X_heatmap) <- gsub(pattern = "X1",replacement = Name1,colnames(X_heatmap))
colnames(X_heatmap) <- gsub(pattern = "X2",replacement = Name2,colnames(X_heatmap))
colnames(X_heatmap) <- gsub(pattern = "X3",replacement = Name3,colnames(X_heatmap))
colnames(X_heatmap)[2] <- "Gene"
}
if (file.exists(inputFile[4])){
X$ORF <- gsub("_1","",x=X$ORF)
X$ORF <- gsub("_2","",x=X$ORF)
X$ORF <- gsub("_3","",x=X$ORF)
try(X[X$Gene_X1 == "",]$Gene_X1 <- X[X$Gene_X1 == "",]$OrfRep_X1)
try(X[X$Gene_X2 == "",]$Gene_X2 <- X[X$Gene_X2 == "",]$OrfRep_X2)
try(X[X$Gene_X3 == "",]$Gene_X3 <- X[X$Gene_X3 == "",]$OrfRep_X3)
try(X[X$Gene_X4 == "",]$Gene_X4 <- X[X$Gene_X4 == "",]$OrfRep_X4)
X_heatmap <- X[colnames(X) == "ORF" | colnames(X) == "Gene_X1" |
colnames(X) == "Z_Shift_K_X1" | colnames(X) == "Z_lm_K_X1" |
colnames(X) == "Z_Shift_K_X2" | colnames(X) == "Z_lm_K_X2" |
colnames(X) == "Z_Shift_K_X3" | colnames(X) == "Z_lm_K_X3" |
colnames(X) == "Z_Shift_K_X4" | colnames(X) == "Z_lm_K_X4" |
colnames(X) == "Z_Shift_L_X1" | colnames(X) == "Z_lm_L_X1" |
colnames(X) == "Z_Shift_L_X2" | colnames(X) == "Z_lm_L_X2" |
colnames(X) == "Z_Shift_L_X3" | colnames(X) == "Z_lm_L_X3" |
colnames(X) == "Z_Shift_L_X4" | colnames(X) == "Z_lm_L_X4" ]
#Reorder columns
X_heatmap <- X_heatmap[,c(18,1,4,5,8,9,12,13,16,17,2,3,6,7,10,11,14,15)] #Four
colnames(X_heatmap) <- gsub(pattern = "X1",replacement = Name1,colnames(X_heatmap))
colnames(X_heatmap) <- gsub(pattern = "X2",replacement = Name2,colnames(X_heatmap))
colnames(X_heatmap) <- gsub(pattern = "X3",replacement = Name3,colnames(X_heatmap))
colnames(X_heatmap) <- gsub(pattern = "X4",replacement = Name4,colnames(X_heatmap))
colnames(X_heatmap)[2] <- "Gene"
}
if (file.exists(inputFile[5])){
X$ORF <- gsub("_1","",x=X$ORF)
X$ORF <- gsub("_2","",x=X$ORF)
X$ORF <- gsub("_3","",x=X$ORF)
X$ORF <- gsub("_4","",x=X$ORF)
try(X[X$Gene_X1 == "",]$Gene_X1 <- X[X$Gene_X1 == "",]$OrfRep_X1)
try(X[X$Gene_X2 == "",]$Gene_X2 <- X[X$Gene_X2 == "",]$OrfRep_X2)
try(X[X$Gene_X3 == "",]$Gene_X3 <- X[X$Gene_X3 == "",]$OrfRep_X3)
try(X[X$Gene_X4 == "",]$Gene_X4 <- X[X$Gene_X4 == "",]$OrfRep_X4)
try(X[X$Gene_X5 == "",]$Gene_X5 <- X[X$Gene_X5 == "",]$OrfRep_X5)
X_heatmap <- X[colnames(X) == "ORF" | colnames(X) == "Gene_X1" |
colnames(X) == "Z_Shift_K_X1" | colnames(X) == "Z_lm_K_X1" |
colnames(X) == "Z_Shift_K_X2" | colnames(X) == "Z_lm_K_X2" |
colnames(X) == "Z_Shift_K_X3" | colnames(X) == "Z_lm_K_X3" |
colnames(X) == "Z_Shift_K_X4" | colnames(X) == "Z_lm_K_X4" |
colnames(X) == "Z_Shift_K_X5" | colnames(X) == "Z_lm_K_X5" |
colnames(X) == "Z_Shift_L_X1" | colnames(X) == "Z_lm_L_X1" |
colnames(X) == "Z_Shift_L_X2" | colnames(X) == "Z_lm_L_X2" |
colnames(X) == "Z_Shift_L_X3" | colnames(X) == "Z_lm_L_X3" |
colnames(X) == "Z_Shift_L_X4" | colnames(X) == "Z_lm_L_X4" |
colnames(X) == "Z_Shift_L_X5" | colnames(X) == "Z_lm_L_X5"]
#Reorder columns
X_heatmap <- X_heatmap[,c(22,1,4,5,8,9,12,13,16,17,20,21,2,3,6,7,10,11,14,15,18,19)]
colnames(X_heatmap) <- gsub(pattern = "X1",replacement = Name1,colnames(X_heatmap))
colnames(X_heatmap) <- gsub(pattern = "X2",replacement = Name2,colnames(X_heatmap))
colnames(X_heatmap) <- gsub(pattern = "X3",replacement = Name3,colnames(X_heatmap))
colnames(X_heatmap) <- gsub(pattern = "X4",replacement = Name4,colnames(X_heatmap))
colnames(X_heatmap) <- gsub(pattern = "X5",replacement = Name5,colnames(X_heatmap))
colnames(X_heatmap)[2] <- "Gene"
}
#-----------------------------------------------------------------------------------------
#theme elements for plots
theme_Publication <- function(base_size=14, base_family="sans") {
(theme_foundation(base_size=base_size, base_family=base_family)
+ theme(plot.title = element_text(face = "bold",
size = rel(1.2), hjust = 0.5),
text = element_text(),
panel.background = element_rect(colour = NA),
plot.background = element_rect(colour = NA),
panel.border = element_rect(colour = NA),
axis.title = element_text(face = "bold",size = rel(1)),
axis.title.y = element_text(angle=90,vjust =2),
axis.title.x = element_text(vjust = -0.2),
axis.text = element_text(),
axis.line = element_line(colour="black"),
axis.ticks = element_line(),
panel.grid.major = element_line(colour="#f0f0f0"),
panel.grid.minor = element_blank(),
legend.key = element_rect(colour = NA),
legend.position = "bottom",
legend.direction = "horizontal",
legend.key.size= unit(0.2, "cm"),
legend.spacing = unit(0, "cm"),
legend.title = element_text(face="italic"),
plot.margin=unit(c(10,5,5,5),"mm"),
strip.background=element_rect(colour="#f0f0f0",fill="#f0f0f0"),
strip.text = element_text(face="bold")
))
}
scale_fill_Publication <- function(...){
library(scales)
discrete_scale("fill","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
}
scale_colour_Publication <- function(...){
discrete_scale("colour","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
}
theme_Publication_legend_right <- function(base_size=14, base_family="sans") {
(theme_foundation(base_size=base_size, base_family=base_family)
+ theme(plot.title = element_text(face = "bold",
size = rel(1.2), hjust = 0.5),
text = element_text(),
panel.background = element_rect(colour = NA),
plot.background = element_rect(colour = NA),
panel.border = element_rect(colour = NA),
axis.title = element_text(face = "bold",size = rel(1)),
axis.title.y = element_text(angle=90,vjust =2),
axis.title.x = element_text(vjust = -0.2),
axis.text = element_text(),
axis.line = element_line(colour="black"),
axis.ticks = element_line(),
panel.grid.major = element_line(colour="#f0f0f0"),
panel.grid.minor = element_blank(),
legend.key = element_rect(colour = NA),
legend.position = "right",
legend.direction = "vertical",
legend.key.size= unit(0.5, "cm"),
legend.spacing = unit(0, "cm"),
legend.title = element_text(face="italic"),
plot.margin=unit(c(10,5,5,5),"mm"),
strip.background=element_rect(colour="#f0f0f0",fill="#f0f0f0"),
strip.text = element_text(face="bold")
))
}
scale_fill_Publication <- function(...){
discrete_scale("fill","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
}
scale_colour_Publication <- function(...){
discrete_scale("colour","Publication",manual_pal(values = c("#386cb0","#fdb462","#7fc97f","#ef3b2c","#662506","#a6cee3","#fb9a99","#984ea3","#ffff33")), ...)
}
#www.geneontology.org/ontology/gene_ontology_edit.obo file
Ontology <- get_ontology(file=ontology_obo_input,propagate_relationships = "is_a",extract_tags = "minimal")
print(Ontology)
#all ORFs associated with GO term
GO2ALLORFs <- as.list(org.Sc.sgdGO2ALLORFS)
print('429')
#Gene_Association is the gene association to GO term file
#Gene_Association <- read.delim("Documents/Hartman_Lab/SGD_Downloads/gene_association.sgd",skip=8,header=FALSE,quote="",col.names = c("Database","Database_Object_ID","Database_Object_Symbol","NOT","GO_ID","Database_Reference","Evidence","With_or_From","Aspect","Database_Object_Name","Database_Object_Synonym","Database_Object_Type","taxon","Date","Assigned_By","OtherInfo","Empty"))
#Gene_Association$ORF <- str_split_fixed(as.character(Gene_Association$Database_Object_Synonym),"\\|",2)[,1]
#Gene_Association$GO_ID_Numeric <- as.integer(str_split_fixed(as.character(Gene_Association$GO_ID),"\\:",2)[,2])
#Terms is the GO term list jwr moved up to TAABLES
Terms <- read.delim(file=GOtermstab_file,header=FALSE,quote = "",col.names = c("GO_ID","GO_Term","GO_Aspect","GO_Term_Definition"))
#-----------------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------
#BIG LOOP BIG LOOP ------------------------------------------------------
colormapbreaks <- c(-12,-10,-8,-6,-4,-2,2,4,6,8,10,12)
for(s in 1:dim(XX3)[1]){
#Ontology <- get_ontology(file="Documents/Hartman_Lab/SGD_Downloads/gene_ontology_edit.obo",propagate_relationships = "is_a",extract_tags = "minimal")
#Ontology_Everything <- get_ontology(file="Documents/Hartman_Lab/SGD_Downloads/gene_ontology_edit.obo",propagate_relationships = "is_a",extract_tags = "everything")
#GO_ID_Arg <- "GO:0006325"
GO_ID_Arg_loop <- as.character(XX3[s,1])
GOTerm_parent <- get_descendants(Ontology,roots = GO_ID_Arg_loop)
#GOTerm_parent <- get_descendants(Ontology,roots = "GO:0006325")
#only make plots if parent term has fewer than 500 children
print('for(s in 1:dim(XX3)[1]){ -454')
Parent_Size <- length(as.vector(GO2ALLORFs[GO_ID_Arg_loop][[1]]))
if(length(GOTerm_parent) > 100){
#print(length(GOTerm_parent))
next()
}
Parent_Size <- length(as.vector(GO2ALLORFs[GO_ID_Arg_loop][[1]]))
if(Parent_Size < 2){
next()
}
if(Parent_Size > 2000){
pdf(file=paste(outputpath,XX3[s,2],".pdf",sep=""),width = 12, height = 45, onefile = TRUE)
print('pdf2000 469')
for(i in 1:length(GOTerm_parent)){
GO_Term <- GOTerm_parent[i]
GO_Term_Num <- as.integer(str_split_fixed(as.character(GO_Term),"\\:",2)[,2])
GO_Term_Name <- as.character(Terms[Terms$GO_ID == GO_Term_Num,]$GO_Term)
#Genes_Annotated_to_Term <- Gene_Association[Gene_Association$GO_ID == GO_Term,]
All_Genes_Annotated_to_Term <- as.vector(GO2ALLORFs[GO_Term][[1]])
Genes_Annotated_to_Term <- X_heatmap[X_heatmap$ORF %in% All_Genes_Annotated_to_Term,]
X0 <- as.matrix(Genes_Annotated_to_Term[,3:dim(Genes_Annotated_to_Term)[2]])
if(dim(Genes_Annotated_to_Term)[1] > 2){
try(heatmap.2(x=X0,
Rowv=TRUE, Colv=NA, distfun = dist, hclustfun = hclust,
dendrogram = "row", cexCol = 0.7, cexRow = 0.5, scale = "none",
breaks=colormapbreaks, symbreaks=FALSE, colsep = c(2,4,6), sepcolor= "white", offsetCol = 0.1,
ylab = "Gene",
cellnote = round(X0,digits=0), notecex = 0.5, key=TRUE,
keysize=0.5, trace="none", density.info=c("none"), margins=c(10,8),
na.color="red", col=brewer.pal(11,"PuOr"),
main=GO_Term_Name,
#ColSideColors=ev_repeat,
labRow=as.character(Genes_Annotated_to_Term$Gene)))
}
}
dev.off()
}
if(Parent_Size >= 1000 && Parent_Size <= 2000){
pdf(file=paste(outputpath,XX3[s,2],".pdf",sep=""),width = 12, height = 35, onefile = TRUE)
for(i in 1:length(GOTerm_parent)){
GO_Term <- GOTerm_parent[i]
GO_Term_Num <- as.integer(str_split_fixed(as.character(GO_Term),"\\:",2)[,2])
GO_Term_Name <- as.character(Terms[Terms$GO_ID == GO_Term_Num,]$GO_Term)
#Genes_Annotated_to_Term <- Gene_Association[Gene_Association$GO_ID == GO_Term,]
All_Genes_Annotated_to_Term <- as.vector(GO2ALLORFs[GO_Term][[1]])
Genes_Annotated_to_Term <- X_heatmap[X_heatmap$ORF %in% All_Genes_Annotated_to_Term,]
X0 <- as.matrix(Genes_Annotated_to_Term[,3:dim(Genes_Annotated_to_Term)[2]])
if(dim(Genes_Annotated_to_Term)[1] > 2){
try(heatmap.2(x=X0,
Rowv=TRUE, Colv=NA, distfun = dist, hclustfun = hclust,
dendrogram = "row", cexCol = 0.7, cexRow = 0.6, scale = "none",
breaks=colormapbreaks, symbreaks=FALSE, colsep = c(2,4,6), sepcolor= "white", offsetCol = 0.1,
ylab = "Gene",
cellnote = round(X0,digits=0), notecex = 0.5, key=TRUE,
keysize=0.5, trace="none", density.info=c("none"), margins=c(10,8),
na.color="red", col=brewer.pal(11,"PuOr"),
main=GO_Term_Name,
#ColSideColors=ev_repeat,
labRow=as.character(Genes_Annotated_to_Term$Gene)))
}
}
dev.off()
}
if(Parent_Size >= 500 && Parent_Size <= 1000){
pdf(file=paste(outputpath,XX3[s,2],".pdf",sep=""),width = 12, height = 30, onefile = TRUE)
for(i in 1:length(GOTerm_parent)){
GO_Term <- GOTerm_parent[i]
GO_Term_Num <- as.integer(str_split_fixed(as.character(GO_Term),"\\:",2)[,2])
GO_Term_Name <- as.character(Terms[Terms$GO_ID == GO_Term_Num,]$GO_Term)
#Genes_Annotated_to_Term <- Gene_Association[Gene_Association$GO_ID == GO_Term,]
All_Genes_Annotated_to_Term <- as.vector(GO2ALLORFs[GO_Term][[1]])
Genes_Annotated_to_Term <- X_heatmap[X_heatmap$ORF %in% All_Genes_Annotated_to_Term,]
X0 <- as.matrix(Genes_Annotated_to_Term[,3:dim(Genes_Annotated_to_Term)[2]])
if(dim(Genes_Annotated_to_Term)[1] > 2){
try(heatmap.2(x=X0,
Rowv=TRUE, Colv=NA, distfun = dist, hclustfun = hclust,
dendrogram = "row", cexCol = 0.7, cexRow = 0.6, scale = "none",
breaks=colormapbreaks, symbreaks=FALSE, colsep = c(2,4,6), sepcolor= "white", offsetCol = 0.1,
ylab = "Gene",
cellnote = round(X0,digits=0), notecex = 0.5, key=TRUE,
keysize=0.5, trace="none", density.info=c("none"), margins=c(10,8),
na.color="red", col=brewer.pal(11,"PuOr"),
main=GO_Term_Name,
#ColSideColors=ev_repeat,
labRow=as.character(Genes_Annotated_to_Term$Gene)))
}
}
dev.off()
}
if(Parent_Size >= 200 && Parent_Size <= 500){
pdf(file=paste(outputpath,XX3[s,2],".pdf",sep=""),width = 12, height = 25, onefile = TRUE)
for(i in 1:length(GOTerm_parent)){
GO_Term <- GOTerm_parent[i]
GO_Term_Num <- as.integer(str_split_fixed(as.character(GO_Term),"\\:",2)[,2])
GO_Term_Name <- as.character(Terms[Terms$GO_ID == GO_Term_Num,]$GO_Term)
#Genes_Annotated_to_Term <- Gene_Association[Gene_Association$GO_ID == GO_Term,]
All_Genes_Annotated_to_Term <- as.vector(GO2ALLORFs[GO_Term][[1]])
Genes_Annotated_to_Term <- X_heatmap[X_heatmap$ORF %in% All_Genes_Annotated_to_Term,]
X0 <- as.matrix(Genes_Annotated_to_Term[,3:dim(Genes_Annotated_to_Term)[2]])
if(dim(Genes_Annotated_to_Term)[1] > 2){
try(heatmap.2(x=X0,
Rowv=TRUE, Colv=NA, distfun = dist, hclustfun = hclust,
dendrogram = "row", cexCol = 0.7, cexRow = 0.7, scale = "none",
breaks=colormapbreaks, symbreaks=FALSE, colsep = c(2,4,6), sepcolor= "white", offsetCol = 0.1,
ylab = "Gene",
cellnote = round(X0,digits=0), notecex = 0.5, key=TRUE,
keysize=0.5, trace="none", density.info=c("none"), margins=c(10,8),
na.color="red", col=brewer.pal(11,"PuOr"),
main=GO_Term_Name,
#ColSideColors=ev_repeat,
labRow=as.character(Genes_Annotated_to_Term$Gene)))
}
}
dev.off()
}
if(Parent_Size >= 100 && Parent_Size <= 200){
pdf(file=paste(outputpath,XX3[s,2],".pdf",sep=""),width = 12, height = 20, onefile = TRUE)
for(i in 1:length(GOTerm_parent)){
GO_Term <- GOTerm_parent[i]
GO_Term_Num <- as.integer(str_split_fixed(as.character(GO_Term),"\\:",2)[,2])
GO_Term_Name <- as.character(Terms[Terms$GO_ID == GO_Term_Num,]$GO_Term)
#Genes_Annotated_to_Term <- Gene_Association[Gene_Association$GO_ID == GO_Term,]
All_Genes_Annotated_to_Term <- as.vector(GO2ALLORFs[GO_Term][[1]])
Genes_Annotated_to_Term <- X_heatmap[X_heatmap$ORF %in% All_Genes_Annotated_to_Term,]
X0 <- as.matrix(Genes_Annotated_to_Term[,3:dim(Genes_Annotated_to_Term)[2]])
if(dim(Genes_Annotated_to_Term)[1] > 2){
try(heatmap.2(x=X0,
Rowv=TRUE, Colv=NA, distfun = dist, hclustfun = hclust,
dendrogram = "row", cexCol = 0.7, cexRow = 0.7, scale = "none",
breaks=colormapbreaks, symbreaks=FALSE, colsep = c(2,4,6), sepcolor= "white", offsetCol = 0.1,
ylab = "Gene",
cellnote = round(X0,digits=0), notecex = 0.5, key=TRUE,
keysize=0.5, trace="none", density.info=c("none"), margins=c(10,8),
na.color="red", col=brewer.pal(11,"PuOr"),
main=GO_Term_Name,
#ColSideColors=ev_repeat,
labRow=as.character(Genes_Annotated_to_Term$Gene)))
}
}
dev.off()
}
if(Parent_Size >= 60 && Parent_Size <= 100){
pdf(file=paste(outputpath,XX3[s,2],".pdf",sep=""),width = 12, height = 15, onefile = TRUE)
for(i in 1:length(GOTerm_parent)){
GO_Term <- GOTerm_parent[i]
GO_Term_Num <- as.integer(str_split_fixed(as.character(GO_Term),"\\:",2)[,2])
GO_Term_Name <- as.character(Terms[Terms$GO_ID == GO_Term_Num,]$GO_Term)
#Genes_Annotated_to_Term <- Gene_Association[Gene_Association$GO_ID == GO_Term,]
All_Genes_Annotated_to_Term <- as.vector(GO2ALLORFs[GO_Term][[1]])
Genes_Annotated_to_Term <- X_heatmap[X_heatmap$ORF %in% All_Genes_Annotated_to_Term,]
X0 <- as.matrix(Genes_Annotated_to_Term[,3:dim(Genes_Annotated_to_Term)[2]])
if(dim(Genes_Annotated_to_Term)[1] > 2){
try(heatmap.2(x=X0,
Rowv=TRUE, Colv=NA, distfun = dist, hclustfun = hclust,
dendrogram = "row", cexCol = 0.7, cexRow = 0.7, scale = "none",
breaks=colormapbreaks, symbreaks=FALSE, colsep = c(2,4,6), sepcolor= "white", offsetCol = 0.1,
ylab = "Gene",
cellnote = round(X0,digits=0), notecex = 0.5, key=TRUE,
keysize=0.5, trace="none", density.info=c("none"), margins=c(10,8),
na.color="red", col=brewer.pal(11,"PuOr"),
main=GO_Term_Name,
#ColSideColors=ev_repeat,
labRow=as.character(Genes_Annotated_to_Term$Gene)))
}
}
dev.off()
}
if(Parent_Size >= 30 && Parent_Size <= 60){
pdf(file=paste(outputpath,XX3[s,2],".pdf",sep=""),width = 12, height = 10, onefile = TRUE)
for(i in 1:length(GOTerm_parent)){
GO_Term <- GOTerm_parent[i]
GO_Term_Num <- as.integer(str_split_fixed(as.character(GO_Term),"\\:",2)[,2])
GO_Term_Name <- as.character(Terms[Terms$GO_ID == GO_Term_Num,]$GO_Term)
#Genes_Annotated_to_Term <- Gene_Association[Gene_Association$GO_ID == GO_Term,]
All_Genes_Annotated_to_Term <- as.vector(GO2ALLORFs[GO_Term][[1]])
Genes_Annotated_to_Term <- X_heatmap[X_heatmap$ORF %in% All_Genes_Annotated_to_Term,]
X0 <- as.matrix(Genes_Annotated_to_Term[,3:dim(Genes_Annotated_to_Term)[2]])
if(dim(Genes_Annotated_to_Term)[1] > 2){
try(heatmap.2(x=X0,
Rowv=TRUE, Colv=NA, distfun = dist, hclustfun = hclust,
dendrogram = "row", cexCol = 0.7, cexRow = 0.7, scale = "none",
breaks=colormapbreaks, symbreaks=FALSE, colsep = c(2,4,6), sepcolor= "white", offsetCol = 0.1,
ylab = "Gene",
cellnote = round(X0,digits=0), notecex = 0.5, key=TRUE,
keysize=0.5, trace="none", density.info=c("none"), margins=c(10,8),
na.color="red", col=brewer.pal(11,"PuOr"),
main=GO_Term_Name,
#ColSideColors=ev_repeat,
labRow=as.character(Genes_Annotated_to_Term$Gene)))
}
if(dim(Genes_Annotated_to_Term)[1] <= 2 && dim(Genes_Annotated_to_Term)[1] > 0){
try(heatmap.2(x=X0,
Rowv=TRUE, Colv=NA, distfun = dist, hclustfun = hclust,
dendrogram = "none", cexCol = 0.7, cexRow = 0.7, scale = "none",
breaks=colormapbreaks, symbreaks=FALSE, colsep = c(2,4,6), sepcolor= "white", offsetCol = 0.1,
ylab = "Gene",
cellnote = round(X0,digits=0), notecex = 0.5, key=TRUE,
keysize=0.5, trace="none", density.info=c("none"), margins=c(10,8),
na.color="red", col=brewer.pal(11,"PuOr"),
main=GO_Term_Name,
#ColSideColors=ev_repeat,
labRow=as.character(Genes_Annotated_to_Term$Gene)))
}
}
dev.off()
}
if(Parent_Size >= 3 && Parent_Size <= 30){
pdf(file=paste(outputpath,XX3[s,2],".pdf",sep=""),width = 12, height = 7, onefile = TRUE)
for(i in 1:length(GOTerm_parent)){
GO_Term <- GOTerm_parent[i]
GO_Term_Num <- as.integer(str_split_fixed(as.character(GO_Term),"\\:",2)[,2])
GO_Term_Name <- as.character(Terms[Terms$GO_ID == GO_Term_Num,]$GO_Term)
#Genes_Annotated_to_Term <- Gene_Association[Gene_Association$GO_ID == GO_Term,]
All_Genes_Annotated_to_Term <- as.vector(GO2ALLORFs[GO_Term][[1]])
Genes_Annotated_to_Term <- X_heatmap[X_heatmap$ORF %in% All_Genes_Annotated_to_Term,]
X0 <- as.matrix(Genes_Annotated_to_Term[,3:dim(Genes_Annotated_to_Term)[2]])
if(dim(Genes_Annotated_to_Term)[1] > 2){
try(heatmap.2(x=X0,
Rowv=TRUE, Colv=NA, distfun = dist, hclustfun = hclust,
dendrogram = "row", cexCol = 0.7, cexRow = 0.7, scale = "none",
breaks=colormapbreaks, symbreaks=FALSE, colsep = c(2,4,6), sepcolor= "white", offsetCol = 0.1,
ylab = "Gene",
cellnote = round(X0,digits=0), notecex = 0.5, key=TRUE,
keysize=0.5, trace="none", density.info=c("none"), margins=c(10,8),
na.color="red", col=brewer.pal(11,"PuOr"),
main=GO_Term_Name,
#ColSideColors=ev_repeat,
labRow=as.character(Genes_Annotated_to_Term$Gene)))
}
if(dim(Genes_Annotated_to_Term)[1] <= 2 && dim(Genes_Annotated_to_Term)[1] > 0){
try(heatmap.2(x=X0,
Rowv=TRUE, Colv=NA, distfun = dist, hclustfun = hclust,
dendrogram = "none", cexCol = 0.7, cexRow = 0.7, scale = "none",
breaks=colormapbreaks, symbreaks=FALSE, colsep = c(2,4,6), sepcolor= "white", offsetCol = 0.1,
ylab = "Gene",
cellnote = round(X0,digits=0), notecex = 0.5, key=TRUE,
keysize=0.5, trace="none", density.info=c("none"), margins=c(10,8),
na.color="red", col=brewer.pal(11,"PuOr"),
main=GO_Term_Name,
#ColSideColors=ev_repeat,
labRow=as.character(Genes_Annotated_to_Term$Gene)))
}
}
dev.off()
}
if(Parent_Size == 2){
pdf(file=paste(outputpath,XX3[s,2],".pdf",sep=""),width = 12, height = 7, onefile = TRUE)
for(i in 1:length(GOTerm_parent)){
GO_Term <- GOTerm_parent[i]
GO_Term_Num <- as.integer(str_split_fixed(as.character(GO_Term),"\\:",2)[,2])
GO_Term_Name <- as.character(Terms[Terms$GO_ID == GO_Term_Num,]$GO_Term)
#Genes_Annotated_to_Term <- Gene_Association[Gene_Association$GO_ID == GO_Term,]
All_Genes_Annotated_to_Term <- as.vector(GO2ALLORFs[GO_Term][[1]])
Genes_Annotated_to_Term <- X_heatmap[X_heatmap$ORF %in% All_Genes_Annotated_to_Term,]
X0 <- as.matrix(Genes_Annotated_to_Term[,3:dim(Genes_Annotated_to_Term)[2]])
if(dim(Genes_Annotated_to_Term)[1] > 2){
try(heatmap.2(x=X0,
Rowv=TRUE, Colv=NA, distfun = dist, hclustfun = hclust,
dendrogram = "row", cexCol = 0.7, cexRow = 0.7, scale = "none",
breaks=colormapbreaks, symbreaks=FALSE, colsep = c(2,4,6), sepcolor= "white", offsetCol = 0.1,
ylab = "Gene",
cellnote = round(X0,digits=0), notecex = 0.5, key=TRUE,
keysize=0.5, trace="none", density.info=c("none"), margins=c(10,8),
na.color="red", col=brewer.pal(11,"PuOr"),
main=GO_Term_Name,
#ColSideColors=ev_repeat,
labRow=as.character(Genes_Annotated_to_Term$Gene)))
}
if(dim(Genes_Annotated_to_Term)[1] <= 2 && dim(Genes_Annotated_to_Term)[1] > 0){
try(heatmap.2(x=X0,
Rowv=TRUE, Colv=NA, distfun = dist, hclustfun = hclust,
dendrogram = "none", cexCol = 0.7, cexRow = 0.7, scale = "none",
breaks=colormapbreaks, symbreaks=FALSE, colsep = c(2,4,6), sepcolor= "white", offsetCol = 0.1,
ylab = "Gene",
cellnote = round(X0,digits=0), notecex = 0.5, key=TRUE,
keysize=0.5, trace="none", density.info=c("none"), margins=c(10,8),
na.color="red", col=brewer.pal(11,"PuOr"),
main=GO_Term_Name,
#ColSideColors=ev_repeat,
labRow=as.character(Genes_Annotated_to_Term$Gene)))
}
print('740')
}
dev.off()
}
}