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

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'};