1321 lines
52 KiB
Plaintext
Executable File
1321 lines
52 KiB
Plaintext
Executable File
%EZexpSel.m %modified to accomodate App Designer issues 230829
|
|
%Called from EZviewGui.m or EZviewGui_export.m or migrapted EZviewGui_App.wlapp 230831
|
|
%{
|
|
>EZexpSel
|
|
>EZVimDisplay
|
|
>EZhtMap
|
|
>EZdiagRFsSheet
|
|
>EZsingleExUserRF
|
|
>EZmultigeneRFsLst
|
|
>EZdiagRFsSheet
|
|
>EZhtMap
|
|
>EZmultiDayGui
|
|
>EZmultiDay
|
|
>EZmultiExLoad
|
|
%}
|
|
|
|
w=pwd;
|
|
%*****Single Exp or Chronological Study*********************************************
|
|
% Construct a questdlg with three options
|
|
|
|
global Expaa
|
|
global Expbb
|
|
global expType
|
|
global usrExpJobsDir
|
|
global zonePB
|
|
|
|
Exp(expN).expLoadCnt= 0;
|
|
%Initiation for composite plotting cPlots
|
|
Exp(expN).cTraceN= 1;
|
|
Exp(expN).cTraceIndx= 1;
|
|
Exp(expN).CompositPlot= 0;
|
|
%****************************************
|
|
choice= 'Cancel';
|
|
expType=0;
|
|
choice = questdlg('Choose Single Exp, Chronological Study OR Multi Exp', ...
|
|
'Experiment Type Menu', ...
|
|
'Single Exp','Chronological Study','Multi Exp','Single Exp');
|
|
% Handle response
|
|
switch choice
|
|
case 'Single Exp'
|
|
disp([choice 'Single Exp Selected'])
|
|
expType = 1;
|
|
case 'Chronological Study'
|
|
disp([choice 'Chronological Study Selected'])
|
|
expType = 2;
|
|
case 'Multi Exp'
|
|
disp([choice 'Multi Exp Selected'])
|
|
expType = 3;
|
|
case 'Cancel'
|
|
disp('Cancel Load Exp')
|
|
expType = 0
|
|
end
|
|
expType
|
|
if expType==0, return; end
|
|
|
|
%****************************************************
|
|
zonePB= expN;
|
|
%Pre Load setup incase failure to Load occurs*****************
|
|
%updated 230818 to migrate to AppDesigner
|
|
if expN==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])
|
|
end
|
|
|
|
if expN==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])
|
|
end
|
|
|
|
if expN==3
|
|
set(handles.zonePB3,'value',1)
|
|
set(handles.zonePB1,'value',0)
|
|
set(handles.zonePB2,'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]);
|
|
end
|
|
|
|
Exp(expN).htmapRFanswer= {'G','L'}; %ZoneData
|
|
|
|
%_____________________-------------------__________________________
|
|
|
|
if expType==1
|
|
Exp(expN).DexpType= 'single';
|
|
%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
|
|
%*************************************************
|
|
%try %Linux accommodatition
|
|
if ispc
|
|
try
|
|
cd(usrExpJobsDir);
|
|
catch
|
|
cd(fullfile('C:\')); %end % \Easy\Experiments'));
|
|
end
|
|
|
|
else
|
|
try
|
|
cd(usrExpJobsDir);
|
|
catch
|
|
cd(fullfile('~'))
|
|
end
|
|
end
|
|
%if isunix,cd (fullfile('~','ExpJobs'));end
|
|
%if ismac, cd (fullfile('~','ExpJobs'));end
|
|
%catch ME
|
|
% cd(w)
|
|
%end
|
|
datacursormode off;
|
|
%*************************************************
|
|
%try to use user selected 'ExpJobs' folder otherwise use a default
|
|
%directory in the uigetfile to load the experiment .mat file.
|
|
try
|
|
load('ExpJobsFldr')
|
|
catch
|
|
disp('Fail to load ExpJobsFldr.mat file from code directory. Create one under the [File] Menu option.');
|
|
end
|
|
%try %Linux accommodatition
|
|
if ispc
|
|
try
|
|
cd(usrExpJobsDir);
|
|
catch
|
|
cd(fullfile('C:\')); %end % \Easy\Experiments'));
|
|
end
|
|
|
|
else
|
|
try
|
|
cd(usrExpJobsDir);
|
|
catch
|
|
cd(fullfile('~'))
|
|
end
|
|
end
|
|
|
|
try
|
|
[openExpfile,openExppath] = uigetfile('.mat','Open Experiment folder and data storage .mat file name','MultiSelect','off')
|
|
catch ME
|
|
catchissue='Ln50'
|
|
ME
|
|
cd(w)
|
|
return
|
|
end
|
|
%Return without execution if user cancels or doesn't select a .mat file
|
|
try
|
|
if openExpfile==0 || openExppath==0, cd(w), return, end
|
|
catch
|
|
end
|
|
if expN==1
|
|
orfLstSel=get(handles.GeneOrfTog,'value')
|
|
end
|
|
|
|
if expN==2
|
|
orfLstSel=get(handles.GeneOrfTog,'value')
|
|
end
|
|
|
|
if expN==3
|
|
orfLstSel=get(handles.GeneOrfTog,'value')
|
|
end
|
|
Exp(expN).Dexp(1).srtGnLst={('CheckMP/MPDMfile')};
|
|
Exp(expN).Dexp(1).srtOrfLst={('CheckMP/MPDMfile')};
|
|
set(handles.listboxGnOrf,'value',1) %Fix accomodation for bug in App Designer .. .wlapp converter 230906
|
|
set(handles.listboxGnOrf,'string',cellstr([{'Failed To Load'}; {' '}]));
|
|
%try
|
|
ExpOutmat= fullfile(openExppath,openExpfile);
|
|
load(ExpOutmat);
|
|
cd(openExppath)
|
|
cd ..;
|
|
resDir=pwd;
|
|
Exp(expN).Dexp(1).resDir=resDir;
|
|
cd ..;
|
|
try %This try-catch is to go up one more dir if the images aren't found (from /OtherResults)
|
|
test4imageDir= imread(fullfile(pwd,'1','1.bmp'));
|
|
ExpPath=pwd;
|
|
Exp(expN).Dexp(1).ExpFoldr=ExpPath;
|
|
catch
|
|
try
|
|
cd ..
|
|
test4imageDir= imread(fullfile(pwd,'1','1.bmp'));
|
|
ExpPath=pwd;
|
|
Exp(expN).Dexp(1).ExpFoldr=ExpPath;
|
|
catch
|
|
cd(w)
|
|
end
|
|
end
|
|
cd(w)
|
|
%Experiment LOADs
|
|
%load (fullfile(ExpFoldr,'MasterPlateFiles','MPDMmat.mat'))
|
|
load (fullfile(Exp(expN).Dexp(1).ExpFoldr,'MasterPlateFiles','MPDMmat.mat'))
|
|
load(fullfile(resDir,'Fotos','Coordinates'))
|
|
load(fullfile(resDir,'Fotos','anlZones'))
|
|
load(fullfile(resDir,'Fotos','BGatTpts'))
|
|
load(fullfile(resDir,'PTmats','NImParameters'))
|
|
%Backup for cond. sothat failure to load is recovered back prev. ExpJob data
|
|
%test in temp
|
|
|
|
Exp(expN).Dexp(1).temp.DM=DM;
|
|
Exp(expN).Dexp(1).temp.MP=MP;
|
|
Exp(expN).Dexp(1).temp.scan=scan;
|
|
Exp(expN).Dexp(1).temp.FexpScanSpots=FexpScanSpots;
|
|
Exp(expN).Dexp(1).temp.FexpScanBMtp=FexpScanBMtp;
|
|
Exp(expN).Dexp(1).temp.anlZoneRefs=anlZoneRefs;
|
|
Exp(expN).Dexp(1).temp.ImParMat=ImParMat;
|
|
|
|
Exp(expN).Dexp(1).DM=Exp(expN).Dexp(1).temp.DM;
|
|
Exp(expN).Dexp(1).MP= Exp(expN).Dexp(1).temp.MP;
|
|
Exp(expN).Dexp(1).scan= Exp(expN).Dexp(1).temp.scan;
|
|
Exp(expN).Dexp(1).FexpScanSpots= Exp(expN).Dexp(1).temp.FexpScanSpots;
|
|
Exp(expN).Dexp(1).FexpScanBMtp= Exp(expN).Dexp(1).temp.FexpScanBMtp;
|
|
Exp(expN).Dexp(1).anlZoneRefs=Exp(expN).Dexp(1).temp.anlZoneRefs;
|
|
Exp(expN).Dexp(1).ImParMat=Exp(expN).Dexp(1).temp.ImParMat;
|
|
|
|
Exp(expN).DexpLength= 1;
|
|
Exp(expN).Dexp((Exp(expN).DexpLength+1):end)= [];
|
|
|
|
|
|
|
|
%Load new ExpJOb*****************
|
|
if expN==1,
|
|
%Exp(1).traceN=0;
|
|
tPtsSize=size(FexpScanBMtp{1,1},3);
|
|
set(handles.MPsldr1,'max',length(MP));
|
|
set(handles.DMsldr1,'max',length(DM.drug));
|
|
set(handles.Tptsldr1,'max',tPtsSize);
|
|
|
|
%MPnum=length(Exp(expN).Dexp(1).MP);
|
|
set(handles.MPsldr1,'min',1) %,'max',MPnum+.1)
|
|
DMnum= length(Exp(expN).Dexp(1).DM.drug);
|
|
set(handles.DMsldr1,'min',1,'max',DMnum)
|
|
tPtsSize=size(Exp(expN).Dexp(1).FexpScanBMtp{1,1},(3));
|
|
set(handles.Tptsldr1,'min',1,'max',tPtsSize)
|
|
|
|
set(handles.MPsldr1,'value',1)
|
|
set(handles.DMsldr1,'value',1)
|
|
set(handles.Tptsldr1,'value',1)
|
|
set(handles.MPed1,'string','1')
|
|
set(handles.DMed1,'string','1')
|
|
set(handles.Tpted1,'string','1')
|
|
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.DN1,'value',1)
|
|
set(handles.DN1,'string',1)
|
|
end
|
|
if expN==2,
|
|
%Exp(2).traceN=0;
|
|
tPtsSize=size(FexpScanBMtp{1,1},3);
|
|
set(handles.MPsldr2,'max',length(MP));
|
|
set(handles.DMsldr2,'max',length(DM.drug));
|
|
set(handles.Tptsldr2,'max',tPtsSize);
|
|
%MPnum=length(Exp(expN).Dexp(1).MP);
|
|
set(handles.MPsldr2,'min',1) %,'max',MPnum)
|
|
DMnum= length(Exp(expN).Dexp(1).DM.drug);
|
|
set(handles.DMsldr2,'min',1,'max',DMnum)
|
|
tPtsSize=size(Exp(expN).Dexp(1).FexpScanBMtp{1,1},(3));
|
|
set(handles.Tptsldr2,'min',1,'max',tPtsSize)
|
|
|
|
set(handles.MPsldr2,'value',1)
|
|
set(handles.DMsldr2,'value',1)
|
|
set(handles.Tptsldr2,'value',1)
|
|
set(handles.MPed2,'string','1')
|
|
set(handles.DMed2,'string','1')
|
|
set(handles.Tpted2,'string','1')
|
|
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.DN2,'value',1)
|
|
set(handles.DN2,'string',1)
|
|
end
|
|
|
|
if expN==3,
|
|
%Exp(3).traceN=0;
|
|
tPtsSize=size(FexpScanBMtp{1,1},3);
|
|
set(handles.MPsldr3,'max',length(MP));
|
|
set(handles.DMsldr3,'max',length(DM.drug));
|
|
set(handles.Tptsldr3,'max',tPtsSize);
|
|
%MPnum=length(Exp(expN).Dexp(1).MP);
|
|
set(handles.MPsldr3,'min',1) %,'max',MPnum)
|
|
DMnum= length(Exp(expN).Dexp(1).DM.drug);
|
|
set(handles.DMsldr3,'min',1,'max',DMnum)
|
|
tPtsSize=size(Exp(expN).Dexp(1).FexpScanBMtp{1,1},(3));
|
|
set(handles.Tptsldr3,'min',1,'max',tPtsSize)
|
|
|
|
set(handles.MPsldr3,'value',1)
|
|
set(handles.DMsldr3,'value',1)
|
|
set(handles.Tptsldr3,'value',1)
|
|
set(handles.MPed3,'string','1')
|
|
set(handles.DMed3,'string','1')
|
|
set(handles.Tpted3,'string','1')
|
|
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]);
|
|
|
|
set(handles.DN3,'value',1)
|
|
set(handles.DN3,'string',1)
|
|
end
|
|
|
|
if expN==1,set(handles.GeneOrfLoc1,'string',{''});
|
|
set(handles.graphStrLoc1,'string',{''});
|
|
cla(handles.Paxes1)
|
|
end
|
|
if expN==2,set(handles.GeneOrfLoc2,'string',{''});
|
|
set(handles.graphStrLoc2,'string',{''});
|
|
cla(handles.Paxes2)
|
|
end
|
|
if expN==3,set(handles.GeneOrfLoc3,'string',{''});
|
|
set(handles.graphStrLoc3,'string',{''})
|
|
cla(handles.Paxes3)
|
|
end
|
|
Exp(expN).Dexp(1).srtGnLst={('CheckMP/MPDMfile')};
|
|
Exp(expN).Dexp(1).srtOrfLst={('CheckMP/MPDMfile')};
|
|
set(handles.listboxGnOrf,'string',Exp(expN).Dexp(1).srtGnLst)
|
|
set(handles.listboxGnOrf,'string',Exp(expN).Dexp(1).srtOrfLst)
|
|
%--------------------------------------------------------------------------
|
|
%*********************
|
|
EZVimDisplay %*
|
|
%*********************
|
|
|
|
|
|
%*****************Capture Exp Name*****************************************
|
|
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)-2) +1;
|
|
endPos=(slashPos(length(slashPos)) -1);
|
|
expStrn= xp(startPos:end);
|
|
if expN==1,set(handles.expName1,'string',expStrn);end
|
|
if expN==2,set(handles.expName2,'string',expStrn);end
|
|
if expN==3,set(handles.expName3,'string',expStrn);end
|
|
catch
|
|
catchissue='Ln198'
|
|
end %nested try-catch-end
|
|
|
|
%*************************************************************************
|
|
%****Compile GeneList and OrfList,****************************************
|
|
%****Sort and add the medians of Ref Plates if RF1,RF2 exist**************
|
|
|
|
%Added 17-1023 For User Addition of Gene Composites to ListBox
|
|
Expaa{expN,1}= []; Expbb{expN,1}= [];
|
|
%*************************************************************************
|
|
lstindx=0;
|
|
lstindxOrf=0;
|
|
spN=0;
|
|
rfcnt=0;
|
|
dRF1indx=0;
|
|
RF1mp=[]; RF2mp=[];
|
|
for mp=1:MPnum %length(Exp(expN).Dexp(1).MP)
|
|
|
|
for ind384=1:384
|
|
spN=spN+1;
|
|
|
|
try %temp find data error
|
|
r= ceil(ind384/24);
|
|
if rem(ind384,24)==0, c=24; else c=rem(ind384,24); end
|
|
|
|
%Insert test for numeric in genename and orf if isnumeric
|
|
%Correct common EXCEL problem of converting OCT1 into a date numeric
|
|
if cell2mat(Exp(expN).Dexp(1).MP(mp).genename{1}(ind384))==38991,
|
|
Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)={'OCT1_'};
|
|
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).genename{1}(ind384)),'RF1'))... %&& mp==1)...
|
|
&& (~strcmpi((Exp(expN).Dexp(1).MP(mp).orf{1}(ind384)),'RF2'))... %||~strcmpi((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),'RF2'))... %&& mp==length(Exp(expN).Dexp(1).MP))...
|
|
&& iscellstr((Exp(expN).Dexp(1).MP(mp).orf{1}(ind384)))
|
|
|
|
lstindxOrf=lstindxOrf+1;
|
|
Exp(expN).Dexp(1).MP(mp).orf{1}(ind384) =strrep((Exp(expN).Dexp(1).MP(mp).orf{1}(ind384)),':',' ');
|
|
bb(lstindxOrf,1)= (Exp(expN).Dexp(1).MP(mp).orf{1}(ind384));
|
|
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
|
|
%Exp(expN).Dexp(1).mutSpotIndx(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'))... %&& ~RF1fullPlate)...
|
|
&& (~strcmpi((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),'RF2'))... %&& ~RF2fullPlate)...
|
|
&& iscellstr((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)))
|
|
|
|
lstindx=lstindx+1;
|
|
Exp(expN).Dexp(1).MP(mp).genename{1}(ind384) =strrep((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),':',' ');
|
|
aa(lstindx,1)= (Exp(expN).Dexp(1).MP(mp).genename{1}(ind384));
|
|
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;
|
|
|
|
|
|
elseif (RF1fullPlate==1 ||... %sum(ismember((Exp(expN).Dexp(1).MP(mp).genename{1}),'RF1'))==384 || ...
|
|
(((length(unique(Exp(expN).Dexp(1).MP(mp).genename{1}(1:384)))) ==1 && mp==1 ) && ... %(isequal((Exp(expN).Dexp(1).MP(mp).genename{1}(1:384)), (Exp(expN).Dexp(1).MP(mp).genename{1}(384:-1:1)))&& mp==1 )) && ...
|
|
~exist('RF1scanN','var')))
|
|
rfcnt=rfcnt+1;
|
|
RFs(spN:spN+383)= spN:spN+383;
|
|
RF1mp=mp
|
|
RF1scanN=(mp*DMnum)-(DMnum-1)
|
|
|
|
elseif (RF2fullPlate==1||... %sum(ismember((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),'RF2'))==384 ||...
|
|
(((length(unique(Exp(expN).Dexp(1).MP(mp).genename{1}(1:384)))) ==1 && mp== MPnum ) && ...
|
|
~exist('RF2scanN','var')))
|
|
rfcnt=rfcnt+1;
|
|
RFs(spN:spN+383)= spN:spN+383;
|
|
RF2mp=mp
|
|
RF2scanN= (mp*DMnum)-(DMnum-1)
|
|
|
|
%Dispersed Reference capture and find Medians
|
|
elseif strcmpi((Exp(expN).Dexp(1).MP(mp).genename{1}(ind384)),'RF1') && ...
|
|
(RF1fullPlate~=1)
|
|
|
|
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 236 EZexpSel.m'
|
|
mp
|
|
ind384
|
|
msgBadGeneName= strcat('check genename at mp=',num2str(mp),' indx=',num2str(ind384))
|
|
end
|
|
|
|
end %end associated with for ind384=1:384
|
|
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(expN).Dexp(1).mutSpotIndx.wRFs= union(RFs, mutorfs);
|
|
catch
|
|
msg= 'No RFs Found in Exp! wRFs'
|
|
Exp(expN).Dexp(1).mutSpotIndx.wRFs= mutorfs;
|
|
end
|
|
try
|
|
Exp(expN).Dexp(1).mutSpotIndx.woRFs= setdiff(mutorfs,RFs);
|
|
catch
|
|
Exp(expN).Dexp(1).mutSpotIndx.woRFs= mutorfs;
|
|
msg= 'No RFs Found in Exp! woRFs'
|
|
end
|
|
|
|
%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
|
|
|
|
|
|
|
|
|
|
Exp(expN).Dexp(1).RFmd1indx=[];
|
|
Exp(expN).Dexp(1).RFmd1LB= {[]};
|
|
Exp(expN).Dexp(1).RFmd1pltN={};
|
|
Exp(expN).Dexp(1).RFmd1val= [];
|
|
Exp(expN).Dexp(1).mean1= [];
|
|
Exp(expN).Dexp(1).std1= [];
|
|
Exp(expN).Dexp(1).min1= [];
|
|
Exp(expN).Dexp(1).max1= [];
|
|
|
|
Exp(expN).Dexp(1).RFcmpK= []; %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpr= []; %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpL= []; %For Ref Composite 17_1009
|
|
|
|
Exp(expN).Dexp(1).RFmd2indx= [];
|
|
Exp(expN).Dexp(1).RFmd2LB= {[]};
|
|
Exp(expN).Dexp(1).RFmd2pltN= {};
|
|
Exp(expN).Dexp(1).RFmd2val= [];
|
|
Exp(expN).Dexp(1).mean2= [];
|
|
Exp(expN).Dexp(1).std2= [];
|
|
Exp(expN).Dexp(1).min2= [];
|
|
Exp(expN).Dexp(1).max2= [];
|
|
|
|
Exp(expN).Dexp(1).RFmean= [];
|
|
Exp(expN).Dexp(1).RFstd= [];
|
|
Exp(expN).Dexp(1).RFmin= [];
|
|
Exp(expN).Dexp(1).RFmax= [];
|
|
|
|
Exp(expN).Dexp(1).RFmdPLvals= []; %17_1201 TrendOL
|
|
Exp(expN).Dexp(1).RFmdPLB= {[]};
|
|
Exp(expN).Dexp(1).RFmdPindx= [];
|
|
Exp(expN).Dexp(1).RFmdPpltN= [];
|
|
Exp(expN).Dexp(1).RFmdPscanN= [];
|
|
Exp(expN).Dexp(1).RFmedianP= [];
|
|
Exp(expN).Dexp(1).stdP= [];
|
|
Exp(expN).Dexp(1).meanP= [];
|
|
Exp(expN).Dexp(1).minP= [];
|
|
Exp(expN).Dexp(1).maxP= [];
|
|
Exp(expN).Dexp(1).RFcmpPK= []; %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpPr= []; %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpPL= []; %For Ref Composite 17_1009
|
|
|
|
Exp(expN).Dexp(1).RFmdGLB= {[]};
|
|
Exp(expN).Dexp(1).RFmdGindx= [];
|
|
Exp(expN).Dexp(1).RFmdGpltN= [];
|
|
Exp(expN).Dexp(1).RFmdGscanN= [];
|
|
Exp(expN).Dexp(1).RFmedianG= [];
|
|
Exp(expN).Dexp(1).RFmeanG= [];
|
|
Exp(expN).Dexp(1).RFstdG= [];
|
|
Exp(expN).Dexp(1).RFminG= [];
|
|
Exp(expN).Dexp(1).RFmaxG= [];
|
|
Exp(expN).Dexp(1).RFcmpGK= []; %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpGr= []; %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpGL= []; %For Ref Composite 17_1009
|
|
|
|
%{
|
|
Exp(expN).Dexp(1).RFmeanGK= []; %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFstdGK= []; %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFminGK= []; %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFmaxGK= []; %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFmeanGr= []; %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFstdGr= []; %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFminGr= []; %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFmaxGr= []; %For Ref Composite 17_1009
|
|
%}
|
|
|
|
|
|
|
|
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
|
|
clear medValLst
|
|
clear kValLst
|
|
clear rValLst
|
|
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);
|
|
|
|
kValLst= Exp(expN).Dexp(1).scan(rf1scN).plate(1).CFout(medianIndx,3); %For Ref Composite 17_1009
|
|
rValLst= Exp(expN).Dexp(1).scan(rf1scN).plate(1).CFout(medianIndx,4); %For Ref Composite 17_1009
|
|
|
|
mval1=median(medValLst); %mval1=median(Exp(expN).Dexp(1).scan(RF1mps).plate(1).CFout(1:384,5)); %CFout(1:383,5));
|
|
RFmd1pos=find(mval1==(Exp(expN).Dexp(1).scan(rf1scN).plate(1).CFout(1:384,5)));
|
|
RFmd1loc(1)= ceil(RFmd1pos/24); %calc r value
|
|
RFmd1loc(2)= RFmd1pos - ((RFmd1loc(1)-1)*24); %calc c value
|
|
lstindx=lstindx+1;
|
|
lstindxOrf= lstindxOrf+1;
|
|
aa(lstindx,1)= {strcat('RF1md(',num2str(d+1),')')}; %{'RF1md'};
|
|
aa(lstindx,2)={strcat(':',num2str(RF1mp),':',num2str(RFmd1loc(1)),':',num2str(RFmd1loc(2)))}; %,'std_',num2str(std1))};
|
|
bb(lstindxOrf,1)= {strcat('RF1md(',num2str(d+1),')')}; %{'RF1md'};
|
|
bb(lstindxOrf,2)={strcat(':',num2str(RF1mp),':',num2str(RFmd1loc(1)),':',num2str(RFmd1loc(2)))}; %,'std_',num2str(std1))};
|
|
%Composite Reference Amalgum Plot *********************
|
|
lstindx=lstindx+1;
|
|
lstindxOrf= lstindxOrf+1;
|
|
aa(lstindx,1)= {strcat('RF1cmp(',num2str(d+1),')')};
|
|
aa(lstindx,2)={''};
|
|
bb(lstindxOrf,1)= {strcat('RF1cmp(',num2str(d+1),')')};
|
|
bb(lstindxOrf,2)={''};
|
|
%*******************************************************
|
|
|
|
Exp(expN).Dexp(1).RFmd1LB(d+1)= strcat(aa(lstindx,1),aa(lstindx,2));
|
|
Exp(expN).Dexp(1).RFmd1indx(d+1)= RFmd1pos;
|
|
Exp(expN).Dexp(1).RFmd1pltN= RF1mp;
|
|
Exp(expN).Dexp(1).RFmd1val(d+1)= mval1;
|
|
Exp(expN).Dexp(1).RFmd1Lvals= medValLst; %17_1201 TrendOL
|
|
Exp(expN).Dexp(1).mean1(d+1)= mean1;
|
|
Exp(expN).Dexp(1).std1(d+1)= std1;
|
|
Exp(expN).Dexp(1).min1(d+1)= min1;
|
|
Exp(expN).Dexp(1).max1(d+1)= max1;
|
|
Exp(expN).Dexp(1).RFcmpL(1).dm(d+1).Lvals= medValLst; %17_1201 TrendOL
|
|
Exp(expN).Dexp(1).RFcmpL(1).dm(d+1).med= median(medValLst); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpL(1).dm(d+1).mean= mean(medValLst); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpL(1).dm(d+1).std= std(medValLst); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpL(1).dm(d+1).min= min(medValLst); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpL(1).dm(d+1).max= max(medValLst); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpK(1).dm(d+1).Kvals= kValLst; %17_1201 TrendOL
|
|
Exp(expN).Dexp(1).RFcmpK(1).dm(d+1).med= median(kValLst); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpK(1).dm(d+1).mean= mean(kValLst); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpK(1).dm(d+1).std= std(kValLst); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpK(1).dm(d+1).min= min(kValLst); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpK(1).dm(d+1).max= max(kValLst); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpr(1).dm(d+1).rvals= rValLst; %17_1201 TrendOL
|
|
Exp(expN).Dexp(1).RFcmpr(1).dm(d+1).med= median(rValLst); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpr(1).dm(d+1).mean= mean(rValLst); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpr(1).dm(d+1).std= std(rValLst); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpr(1).dm(d+1).min= min(rValLst); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpr(1).dm(d+1).max= max(rValLst); %For Ref Composite 17_1009
|
|
|
|
else
|
|
% Need to set L r K values to zeros or pick the first spot with zeros
|
|
%Spot 1 could be other than zero as the median isn't calculated if
|
|
%fewer than some percent are nonzero
|
|
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(expN).Dexp(1).RFmd1indx(d+1)=firstZero;
|
|
Exp(expN).Dexp(1).RFmd1pltN= RF1mp;
|
|
|
|
try medValList1{d+1}= Exp(expN).Dexp(1).scan(rf1scN).plate(1).CFout(medianIndx,5); nonZeroCnt;
|
|
catch, catcherror = 'Ln356',
|
|
end
|
|
|
|
end %~isempty(nonZeroIndx) && length(medianIndx) > (.15*384)
|
|
catch %try ~ln375
|
|
medianCalcTryFailed1= 'Failed! Failed! Ln362 But process continued with bogus P1ind384 spot value!'
|
|
|
|
try
|
|
firstZero= find(((Exp(expN).Dexp(1).scan(rf1scN).plate(1).CFout(1:384,5))==0),1,'first')
|
|
Exp(expN).Dexp(1).RFmd1indx(d+1)=firstZero;
|
|
catch
|
|
catchissue='Ln366'
|
|
Exp(expN).Dexp(1).RFmd1indx(d+1)=384; %if crapout,Then use spot384 as default to keep going
|
|
end
|
|
try
|
|
Exp(expN).Dexp(1).RFmd1pltN= RF1mp;
|
|
catch
|
|
catchissue='Ln372'
|
|
Exp(expN).Dexp(1).RFmd1pltN= 1;
|
|
end
|
|
|
|
error='EZexpSel lineAfter 258'
|
|
|
|
|
|
end %try ~ln375
|
|
|
|
end %for d=0:DMnum
|
|
end % if exist('RF1scanN','var')
|
|
%**********************************************************************************
|
|
%Calc RF2 median if a full plate of RF2s exist**************************
|
|
Exp(expN).Dexp(1).RFmd2indx=[];
|
|
Exp(expN).Dexp(1).RFmd2pltN=[];
|
|
|
|
|
|
if exist('RF2scanN','var')
|
|
for d=0:(DMnum-1)
|
|
medianIndx2=[];
|
|
nonZeroIndx2=[];
|
|
medValList2=[];
|
|
rf2scN=RF2scanN+d;
|
|
|
|
try %if RF2scanN doesn't exist this addition to list will be skipped
|
|
nonZeroIndx2= find(Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(1:384,5));
|
|
if isempty(nonZeroIndx2), nonZeroCnt2=0; medianIndx2= nonZeroIndx2;
|
|
else nonZeroCnt2=length(nonZeroIndx2);
|
|
end
|
|
%
|
|
if ~isempty(nonZeroIndx2) && mod(nonZeroCnt2,2)==0, medianIndx2= nonZeroIndx2(1:nonZeroCnt2-1); end
|
|
if ~isempty(nonZeroIndx2) && mod(nonZeroCnt2,2)~=0, medianIndx2= nonZeroIndx2; end
|
|
clear medValLst2
|
|
clear kValLst2
|
|
clear rValLst2
|
|
if ~isempty(nonZeroIndx2) && length(medianIndx2) > (.15*384) %To calc. a median, more than 15% of spots must be nonZero
|
|
medValLst2= Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(medianIndx2,5);
|
|
medValList2{d+1}= medValLst2;
|
|
min2= min(medValLst2);
|
|
max2= max(medValLst2);
|
|
std2= std(medValLst2);
|
|
mean2= mean(medValLst2);
|
|
|
|
kValLst2= Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(medianIndx2,3); %For Ref Composite 17_1009
|
|
rValLst2= Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(medianIndx2,4); %For Ref Composite 17_1009
|
|
|
|
mval2=median(medValLst2); %mval2=median(Exp(expN).Dexp(1).scan(RF2mps).plate(1).CFout(1:383,5));
|
|
RFmd2pos=find(mval2==(Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(1:384,5)));
|
|
RFmd2loc(1)= ceil(RFmd2pos/24); %calc r value
|
|
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))};
|
|
%Composite Reference Amalgum Plot (CRAP)
|
|
lstindx=lstindx+1;
|
|
lstindxOrf= lstindxOrf+1;
|
|
aa(lstindx,1)= {strcat('RF2cmp(',num2str(d+1),')')};
|
|
aa(lstindx,2)={''};
|
|
bb(lstindxOrf,1)= {strcat('RF2cmp(',num2str(d+1),')')};
|
|
bb(lstindxOrf,2)={''};
|
|
|
|
Exp(expN).Dexp(1).RFmd2LB(d+1)= strcat(aa(lstindx,1),aa(lstindx,2));
|
|
Exp(expN).Dexp(1).RFmd2indx(d+1)=RFmd2pos;
|
|
Exp(expN).Dexp(1).RFmd2pltN= RF2mp;
|
|
Exp(expN).Dexp(1).RFmd2val(d+1)= mval2;
|
|
Exp(expN).Dexp(1).RFmd1Lvals= medValLst2; %17_1201 TrendOL
|
|
Exp(expN).Dexp(1).mean2(d+1)= mean2;
|
|
Exp(expN).Dexp(1).std2(d+1)= std2;
|
|
Exp(expN).Dexp(1).min2(d+1)= min2;
|
|
Exp(expN).Dexp(1).max2(d+1)= max2;
|
|
Exp(expN).Dexp(1).RFcmpL(2).dm(d+1).Lvals= medValLst2; %17_1201 TrendOL
|
|
Exp(expN).Dexp(1).RFcmpL(2).dm(d+1).med= median(medValLst2); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpL(2).dm(d+1).mean= mean(medValLst2); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpL(2).dm(d+1).std= std(medValLst2); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpL(2).dm(d+1).min= min(medValLst2); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpL(2).dm(d+1).max= max(medValLst2); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpK(2).dm(d+1).Kvals= kValLst2; %17_1201 TrendOL
|
|
Exp(expN).Dexp(1).RFcmpK(2).dm(d+1).med= median(kValLst2); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpK(2).dm(d+1).mean= mean(kValLst2); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpK(2).dm(d+1).std= std(kValLst2); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpK(2).dm(d+1).min= min(kValLst2); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpK(2).dm(d+1).max= max(kValLst2); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpr(2).dm(d+1).rvals= rValLst2; %17_1201 TrendOL
|
|
Exp(expN).Dexp(1).RFcmpr(2).dm(d+1).med= median(rValLst2); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpr(2).dm(d+1).mean= mean(rValLst2); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpr(2).dm(d+1).std= std(rValLst2); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpr(2).dm(d+1).min= min(rValLst2); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpr(2).dm(d+1).max= max(rValLst); %For Ref Composite 17_1009
|
|
|
|
else
|
|
% Pick the first spot with zeros
|
|
% Use that position to satisfy and keep process OK
|
|
medianCalcFailed2= 'Too 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(expN).Dexp(1).RFmd2indx(d+1)=firstZero2;
|
|
Exp(expN).Dexp(1).RFmd2pltN= RF2mp;
|
|
|
|
try medValList2{d+1}= Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(medianIndx2,5); nonZeroCnt2; catch, catchissue='Ln431', end
|
|
|
|
end
|
|
|
|
catch
|
|
medianCalcTryFailed2= 'Failed! Failed! Ln436 No RF1median But process continued with bogus P1ind384 spot value!'
|
|
|
|
try
|
|
firstZero2= find(((Exp(expN).Dexp(1).scan(rf2scN).plate(1).CFout(1:384,5))==0),1,'first');
|
|
Exp(expN).Dexp(1).RFmd2indx(d+1)=firstZero2;
|
|
catch
|
|
catchissue='Ln442'
|
|
Exp(expN).Dexp(1).RFmd2indx(d+1)=384; %if crapout,Then use spot384 as default to keep going
|
|
end
|
|
try
|
|
Exp(expN).Dexp(1).RFmd2pltN= RF2mp;
|
|
catch
|
|
catchissue='Ln448'
|
|
Exp(expN).Dexp(1).RFmd2pltN= 1;
|
|
end
|
|
|
|
error='EZexpSel lineAfter 279'
|
|
|
|
end %if RF2scanN doesn't exist this addition to list will be skipped
|
|
clear RFcombValList
|
|
RFcombValList= cat(1,medValList1{d+1},medValList2{d+1});
|
|
Exp(expN).Dexp(1).RFmean(d+1)= mean(RFcombValList);
|
|
Exp(expN).Dexp(1).RFstd(d+1)=std(RFcombValList);
|
|
try, Exp(expN).Dexp(1).RFmin(d+1)=min(RFcombValList);
|
|
catch, Exp(expN).Dexp(1).RFmin(d+1)= 0; end
|
|
try, Exp(expN).Dexp(1).RFmax(d+1)=max(RFcombValList);
|
|
catch, Exp(expN).Dexp(1).RFmax(d+1)= 0; end
|
|
|
|
end %for d=0:DMnum ln446
|
|
|
|
elseif exist('RF1scanN','var')
|
|
Exp(expN).Dexp(1).RFmean= Exp(expN).Dexp(1).mean1;
|
|
Exp(expN).Dexp(1).RFstd= Exp(expN).Dexp(1).std1;
|
|
Exp(expN).Dexp(1).RFmin= Exp(expN).Dexp(1).min1;
|
|
Exp(expN).Dexp(1).RFmax= Exp(expN).Dexp(1).max1;
|
|
end %if exist('RF2scanN','var') ln445
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
%*************************************************************************************************
|
|
%***********DISPERSE REFERENCE PLATES
|
|
Exp(expN).Dexp(1).RFmdPindx=[];
|
|
Exp(expN).Dexp(1).RFmdPpltN=[];
|
|
if exist('drf','var')
|
|
%Det. index of change from one MP to the next
|
|
|
|
i=2;
|
|
chgIndx(1)=1;
|
|
for j=1:length(drf(:,3))
|
|
|
|
if j>1
|
|
if cell2mat(drf(j,3))~= cell2mat(drf((j-1),3)), chgIndx(i)=j; i=i+1; end
|
|
end
|
|
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) % length(chgIndx)
|
|
|
|
for d=1:(DMnum)
|
|
medianIndxDisp=[];
|
|
NZrefIndxP=[];
|
|
nonZeroValsP=[];
|
|
medValLstDisp=[];
|
|
rf1scNdisp=((dMPs(mm)-1)*DMnum)+(d);
|
|
|
|
try % Determine the dispersed RFs median mean and std if such exist
|
|
NZrefIndxP= drfPindx((find(drfPindx(:,dMPs(mm)))),dMPs(mm)); %find(Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(drf(chgIndx(cI):chgIndx(cI+1)),5));
|
|
%vv= Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5);
|
|
vv(chgIndx(mm):(chgIndx(mm+1)-1),d)=Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5);
|
|
%For Global Ref Composite 17_1009 %**************************************************************************
|
|
vvK(chgIndx(mm):(chgIndx(mm+1)-1),d)=Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,3);
|
|
vvr(chgIndx(mm):(chgIndx(mm+1)-1),d)=Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,4);
|
|
%*****************************************************************************************************
|
|
nonZeroValsP= nonzeros(Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5));
|
|
std1Disp= std(nonZeroValsP);
|
|
mean1Disp= mean(nonZeroValsP);
|
|
minDisp= min(nonZeroValsP);
|
|
maxDisp= max(nonZeroValsP);
|
|
drfVals=Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5);
|
|
|
|
%MEDIAN Determination for PLATES with Dispersed RFs
|
|
%NZrefIndxP= NZrefIndxP %find(Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5));
|
|
if isempty(NZrefIndxP), nonZeroCntDisp=0, medianIndxDisp= NZrefIndxP;
|
|
else nonZeroCntDisp=length(NZrefIndxP);
|
|
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);
|
|
%medValList1Disp{d}= medValLstDisp;
|
|
mval1Disp=median(medValLstDisp); %mval1=median(Exp(expN).Dexp(1).scan(RF1mps).plate(1).CFout(1:384,5)); %CFout(1:383,5));
|
|
nonZeroMedPosIndx=find(mval1Disp==nonZeroValsP); %(Exp(expN).Dexp(1).scan(rf1scNdisp).plate(1).CFout(NZrefIndxP,5))); %(nonZeroIndxDisp,5))); %((nonZrfIndx.mp{dMPs(mm),:}),5)));
|
|
RFmd1posD= NZrefIndxP(nonZeroMedPosIndx); %drfPindx((RFmd1posIndx),dMPs(mm));
|
|
RFmd1locD(1)= ceil(RFmd1posD/24); %calc r value
|
|
RFmd1locD(2)= RFmd1posD - ((RFmd1locD(1)-1)*24); %calc c value
|
|
|
|
lstindx=lstindx+1;
|
|
lstindxOrf= lstindxOrf+1;
|
|
aa(lstindx,1)= {strcat('RF1mdP(',num2str(d),')')};
|
|
aa(lstindx,2)={strcat(':',num2str(dMPs(mm)),':',num2str(RFmd1locD(1)),':',num2str(RFmd1locD(2)))};
|
|
bb(lstindxOrf,1)= {strcat('RF1mdP(',num2str(d),')')};
|
|
bb(lstindxOrf,2)={strcat(':',num2str(dMPs(mm)),':',num2str(RFmd1locD(1)),':',num2str(RFmd1locD(2)))};
|
|
|
|
Exp(expN).Dexp(1).RFmdPLvals(d,dMPs(mm))= mval1Disp; %17_1201 TrendOL
|
|
Exp(expN).Dexp(1).RFmdPLB(d,dMPs(mm))= strcat(aa(lstindx,1),aa(lstindx,2));
|
|
Exp(expN).Dexp(1).RFmdPindx(d,dMPs(mm))= RFmd1posD;
|
|
Exp(expN).Dexp(1).RFmdPpltN(d,dMPs(mm))= dMPs(mm); %This is a storage of the MasterPlate used NOT the ScanPlate? WeMight wish to store the ScanPlateNumber also???
|
|
Exp(expN).Dexp(1).RFmdPscanN(d,dMPs(mm))=rf1scNdisp;
|
|
Exp(expN).Dexp(1).RFmedianP(d,dMPs(mm))= mval1Disp;
|
|
Exp(expN).Dexp(1).stdP(d,dMPs(mm))= std1Disp;
|
|
Exp(expN).Dexp(1).meanP(d,dMPs(mm))= mean1Disp;
|
|
Exp(expN).Dexp(1).minP(d,dMPs(mm))= minDisp;
|
|
Exp(expN).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='Ln619'
|
|
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
|
|
medianIndxG=[];
|
|
NZrfIndxG=[];
|
|
minG = min(nonzeros(vv(:,d)));
|
|
maxG = max(nonzeros(vv(:,d)));
|
|
RFmeanG= mean(nonzeros(vv(:,d)));
|
|
RFstdG= std(nonzeros(vv(:,d)));
|
|
NZrfIndxG= find(vv(:,d)); %find(nonzeros(vv(:,d))); WWRONG FOR A WHILE!
|
|
|
|
if isempty(RFmeanG), nonZeroCntD=0, %medianIndxDisp= RFmeanG(d);
|
|
else nonZeroCntD= length(nonzeros(vv(:,d)));
|
|
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))};
|
|
%Composite Reference Amalgum Plot ******************
|
|
lstindx=lstindx+1;
|
|
lstindxOrf= lstindxOrf+1;
|
|
aa(lstindx,1)= {strcat('RFcmpG(',num2str(d),')')};
|
|
aa(lstindx,2)={''};
|
|
bb(lstindxOrf,1)= {strcat('RFcmpG(',num2str(d),')')};
|
|
bb(lstindxOrf,2)={''};
|
|
%*****************************************************
|
|
%Exp(expN).Dexp(1).RFmdGLvals= vv(medianIndxD,d); %17_1201 TrendOL
|
|
Exp(expN).Dexp(1).RFmdGLB(d)= strcat(aa(lstindx,1),aa(lstindx,2));
|
|
Exp(expN).Dexp(1).RFmdGindx(d)= nzPosIndxDG;
|
|
Exp(expN).Dexp(1).RFmdGpltN(d)= RFmdDGloc(d,1);
|
|
Exp(expN).Dexp(1).RFmdGscanN(d)= uu(nzPosIndxDG,4);
|
|
Exp(expN).Dexp(1).RFmedianG(d)= mvalsDG;
|
|
Exp(expN).Dexp(1).RFminG(d)= minG;
|
|
Exp(expN).Dexp(1).RFmaxG(d)= maxG;
|
|
Exp(expN).Dexp(1).RFstdG(d)= RFstdG;
|
|
Exp(expN).Dexp(1).RFmeanG(d)= RFmeanG;
|
|
|
|
Exp(expN).Dexp(1).RFcmpGL.dm(d).Lvals= vv(medianIndxD,d); %17_1201 TrendOL
|
|
Exp(expN).Dexp(1).RFcmpGL.dm(d).med= median(vv(medianIndxD,d)); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpGL.dm(d).mean= mean(vv(medianIndxD,d)); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpGL.dm(d).std= std(vv(medianIndxD,d)); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpGL.dm(d).min= min(vv(medianIndxD,d)); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpGL.dm(d).max= max(vv(medianIndxD,d)); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpGK.dm(d).Kvals= vvK(medianIndxD,d); %17_1201 TrendOL
|
|
Exp(expN).Dexp(1).RFcmpGK.dm(d).med= median(vvK(medianIndxD,d)); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpGK.dm(d).mean= mean(vvK(medianIndxD,d)); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpGK.dm(d).std= std(vvK(medianIndxD,d)); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpGK.dm(d).min= min(vvK(medianIndxD,d)); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpGK.dm(d).max= max(vvK(medianIndxD,d)); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpGr.dm(d).rvals= vvr(medianIndxD,d); %17_1201 TrendOL
|
|
Exp(expN).Dexp(1).RFcmpGr.dm(d).med= median(vvr(medianIndxD,d)); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpGr.dm(d).mean= mean(vvr(medianIndxD,d)); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpGr.dm(d).std= std(vvr(medianIndxD,d)); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpGr.dm(d).min= min(vvr(medianIndxD,d)); %For Ref Composite 17_1009
|
|
Exp(expN).Dexp(1).RFcmpGr.dm(d).max= max(vvr(medianIndxD,d)); %For Ref Composite 17_1009
|
|
|
|
end %if ~isempty(NZrfIndxG) && length(medianIndxD) > (.15*size(drf,1)) %To calc. a median, more than 15%
|
|
end
|
|
|
|
end % if exist('drf','var')
|
|
%END OF DISPERSE REFERENCE PLATAES CALCULATIONS AND LIST ADDITIONS
|
|
%*********************************************************************
|
|
%Added 17-1023 For User Addition of Gene Composites to ListBox
|
|
%Expaa{ic,1}= aa; Expbb{ic,1}= bb;
|
|
%**********************************************************************
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
|
|
|
%try
|
|
for mp=1:MPnum %length(Exp(expN).Dexp(1).MP)
|
|
for ind384=1:384
|
|
spN=spN+1;
|
|
|
|
|
|
end
|
|
|
|
%catch
|
|
%end %try for user selected Reference routine
|
|
end
|
|
|
|
%****************************************************************************************************
|
|
gnLstRaw= strcat(aa(:,1),aa(:,2));
|
|
Exp(expN).Dexp(1).srtGnLst= sort(gnLstRaw);
|
|
|
|
orfLstRaw=strcat(bb(:,1),bb(:,2));
|
|
Exp(expN).Dexp(1).srtOrfLst= sort(orfLstRaw);
|
|
%********Auto select Zone and load listboxGnOrf data**********
|
|
zeroCLn= zeros(1,DMnum);
|
|
Exp(expN).expLoadCnt= Exp(expN).expLoadCnt+1; expLdCnt= Exp(expN).expLoadCnt;
|
|
zonePB= expN;
|
|
if expN==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(1).srtOrfLst)
|
|
else
|
|
set(handles.listboxGnOrf,'string',Exp(1).Dexp(1).srtGnLst)
|
|
end
|
|
DNLaxes1= handles.DNLaxes1; %ZoneRelated
|
|
Exp(1).hzeroCLn(expLdCnt) = plot(DNLaxes1,zeroCLn,1:DMnum,'y');
|
|
end
|
|
|
|
if expN==2
|
|
set(handles.zonePB1,'value',0)
|
|
set(handles.zonePB3,'value',0)
|
|
set(handles.zonePB2,'value',1)
|
|
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(1).srtOrfLst)
|
|
else
|
|
set(handles.listboxGnOrf,'string',Exp(2).Dexp(1).srtGnLst)
|
|
end
|
|
DNLaxes2= handles.DNLaxes2; %ZoneRelated
|
|
Exp(2).hzeroCLn(expLdCnt) = plot(DNLaxes2,zeroCLn,1:DMnum,'y');
|
|
|
|
end
|
|
|
|
if expN==3
|
|
set(handles.zonePB1,'value',0)
|
|
set(handles.zonePB2,'value',0)
|
|
set(handles.zonePB3,'value',1)
|
|
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(1).srtOrfLst)
|
|
else
|
|
set(handles.listboxGnOrf,'string',Exp(3).Dexp(1).srtGnLst)
|
|
end
|
|
DNLaxes3= handles.DNLaxes3; %ZoneRelated
|
|
Exp(3).hzeroCLn(expLdCnt) = plot(DNLaxes3,zeroCLn,1:DMnum,'y');
|
|
end
|
|
|
|
if Exp(4).interacPBsel==0 %if interaction "raw" don't show a center line
|
|
for i=1:Exp(expN).expLoadCnt,
|
|
try set(Exp(expN).hzeroCLn(i),'visible','off');
|
|
catch
|
|
catchissue= strcat('Ln521',i)
|
|
end,
|
|
end %ZoneRelated
|
|
end
|
|
%*********************************************************
|
|
EZdiagRFsSheet %**
|
|
%*****************
|
|
|
|
%*********************************************************
|
|
RFconfig=0;
|
|
if sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmean'))&&...
|
|
~isempty(Exp(expN).Dexp(1).RFmean)&&...
|
|
sum(ismember(fieldnames(Exp(expN).Dexp(1)),'RFmeanG'))&&...
|
|
isempty(Exp(expN).Dexp(1).RFmeanG)
|
|
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(expN).RFconfig= RFconfig; %ZoneRelated
|
|
%******************************************
|
|
if RFconfig~=0
|
|
Exp(expN).Dexp(1).RFrnames=rnames;
|
|
Exp(expN).Dexp(1).RFdata= data;
|
|
Exp(expN).Dexp(1).resetHtmpTg =5; %ZoneRelated
|
|
|
|
% HtMapTog 'string', 'Current user L/N' selection'
|
|
Exp(expN).Dexp(1).spotIndx= [];
|
|
if expN==1,
|
|
Exp(1).htmapPBsel=0;
|
|
set(handles.HtMapTog1,'string','L')
|
|
%*********
|
|
EZhtMap %*
|
|
%*********
|
|
end
|
|
if expN==2,
|
|
Exp(2).htmapPBsel=0;
|
|
set(handles.HtMapTog2,'string','L')
|
|
%*********
|
|
EZhtMap %*
|
|
%*********
|
|
end
|
|
if expN==3,
|
|
Exp(3).htmapPBsel=0;
|
|
set(handles.HtMapTog3,'string','L')
|
|
%*********
|
|
EZhtMap %*
|
|
%*********
|
|
end
|
|
htMapTogPBfg=0;
|
|
|
|
elseif RFconfig==0,
|
|
RFconfigMsg= 'No RF1 references in this Experiment Job'
|
|
try
|
|
%*********************
|
|
EZsingleExUserRF
|
|
%EZmultiDayGui %*
|
|
%cd(w) %*
|
|
%EZmultiDay %*
|
|
%EZmultiExLoad %*
|
|
%*********************
|
|
catch
|
|
RFconfigMsg= 'No RF1 or User selected references in this Experiment Job'
|
|
Exp(expN).Dexp(1).resetHtmpTg =3; %ZoneRelated
|
|
end
|
|
|
|
% Exp(expN).Dexp(1).resetHtmpTg =3; %ZoneRelated
|
|
end
|
|
%*****************************************
|
|
%**********************************************
|
|
%{
|
|
try msgBadGeneName, catch, end
|
|
try
|
|
|
|
if RFconfig==0,
|
|
RFconfigMsg= 'No RF1 references in this Experiment Job'
|
|
Exp(expN).Dexp(1).resetHtmpTg =3; %ZoneRelated
|
|
end
|
|
catch
|
|
end
|
|
%***************************
|
|
%}
|
|
%*******************************************************************
|
|
elseif expType==2 %Multiple Experiment from in one Folder extraction
|
|
Exp(expN).DexpType= 'chrono';
|
|
%*********************
|
|
%Test for Bad MP cell array (usually 384 [NaN}'s)
|
|
%replaced length(Exp(expN).Dexp(1).MP) with MPnum
|
|
for mx=1:length(Exp(expN).Dexp(1).MP)
|
|
try
|
|
char((Exp(expN).Dexp(1).MP(mx).genename{1}(384)))
|
|
MPnum=mx;
|
|
catch
|
|
break
|
|
end
|
|
end
|
|
%*************************************************
|
|
ww=pwd;
|
|
try EZmultiDayGui; catch ME
|
|
msg = ME.message, cd(ww); end %* %*
|
|
try EZmultiDay; catch ME
|
|
msg = ME.message, cd(ww); end %*
|
|
try EZmultiExLoad; catch ME
|
|
msg = ME.message, cd(ww); end %*
|
|
%*********************
|
|
elseif expType==3
|
|
Exp(expN).DexpType= 'multi';
|
|
%*********************
|
|
%Test for Bad MP cell array (usually 384 [NaN}'s)
|
|
%replaced length(Exp(expN).Dexp(1).MP) with MPnum
|
|
for mx=1:length(Exp(expN).Dexp(1).MP)
|
|
try
|
|
char((Exp(expN).Dexp(1).MP(mx).genename{1}(384)))
|
|
MPnum=mx;
|
|
catch
|
|
break
|
|
end
|
|
end
|
|
%*************************************************
|
|
ww=pwd;
|
|
try EZmultiDayGui; catch ME
|
|
msg = ME.message,cd(ww); end %* %*
|
|
try EZmultiDay; catch ME
|
|
msg = ME.message, cd(ww); end %*
|
|
try EZmultiExLoad; catch ME
|
|
msg = ME.message, cd(ww); end %*
|
|
%*********************
|
|
else
|
|
disp('Cancel Load Exp')
|
|
end
|
|
|
|
|
|
|
|
%__________________________________________________________________________
|
|
%Bone Yard***********************************
|
|
%Exp(expN).Dexp(1).RF1cmpK.[]; %For Ref Composite 17_1009
|
|
%Exp(expN).Dexp(1).std1K= []; %For Ref Composite 17_1009
|
|
%Exp(expN).Dexp(1).min1K= []; %For Ref Composite 17_1009
|
|
%Exp(expN).Dexp(1).max1K= []; %For Ref Composite 17_1009
|
|
%Exp(expN).Dexp(1)RF1cmpr= []; %For Ref Composite 17_1009
|
|
%Exp(expN).Dexp(1).std1r= []; %For Ref Composite 17_1009
|
|
%Exp(expN).Dexp(1).min1r= []; %For Ref Composite 17_1009
|
|
%Exp(expN).Dexp(1).max1r= []; %For Ref Composite 17_1009
|
|
%Exp(expN).Dexp(1).RF= []; %For Ref Composite 17_1009
|
|
%Exp(expN).Dexp(1).std2K= []; %For Ref Composite 17_1009
|
|
%Exp(expN).Dexp(1).min2K= []; %For Ref Composite 17_1009
|
|
%Exp(expN).Dexp(1).max2K= []; %For Ref Composite 17_1009
|
|
%Exp(expN).Dexp(1).RF2cmpr= []; %For Ref Composite 17_1009
|
|
%Exp(expN).Dexp(1).std2r= []; %For Ref Composite 17_1009
|
|
%Exp(expN).Dexp(1).min2r= []; %For Ref Composite 17_1009
|
|
%Exp(expN).Dexp(1).max2r= []; %For Ref Composite 17_1009
|
|
|
|
%kValList1{d+1}= kValLst; %For Ref Composite 17_1009
|
|
%kmin1= min(kValLst); %For Ref Composite 17_1009
|
|
%kmax1= max(kValLst); %For Ref Composite 17_1009
|
|
%kstd1= std(kValLst); %For Ref Composite 17_1009
|
|
%kmean1= mean(kValLst); %For Ref Composite 17_1009
|
|
%rValList1{d+1}= rValLst; %For Ref Composite 17_1009
|
|
%rmin1= min(rValLst); %For Ref Composite 17_1009
|
|
%rmax1= max(rValLst); %For Ref Composite 17_1009
|
|
%rstd1= std(rValLst); %For Ref Composite 17_1009
|
|
%rmean1= mean(rValLst); %For Ref Composite 17_1009
|
|
%kValList2{d+1}= kValLst2; %For Ref Composite 17_1009
|
|
%kmin2= min(kValLst2); %For Ref Composite 17_1009
|
|
%kmax2= max(kValLst2); %For Ref Composite 17_1009
|
|
%kstd2= std(kValLst2); %For Ref Composite 17_1009
|
|
%kmean2= mean(kValLst2); %For Ref Composite 17_1009
|
|
%rValList2{d+1}= rValLst2; %For Ref Composite 17_1009
|
|
% rmin2= min(rValLst2); %For Ref Composite 17_1009
|
|
%rmax2= max(rValLst2); %For Ref Composite 17_1009
|
|
%rstd2= std(rValLst2); %For Ref Composite 17_1009
|
|
%rmean2= mean(rValLst2); %For Ref Composite 17_1009
|
|
|
|
|
|
%{
|
|
|
|
%User Reference Input Dialog Box used in the multiExperiment Chrono setup
|
|
|
|
prompt = {'Enter GeneName to use as Reference:',...
|
|
'Enter Specifics Term if used to futher specify Reference '}
|
|
dlg_title = 'User Reference Input';
|
|
num_lines = 1;
|
|
def = {'RF1','None'};
|
|
answer = inputdlg(prompt,dlg_title,num_lines,def);
|
|
rfGene= cell2mat(answer(1));
|
|
if ~strcmpi(rfGene,'RF1')|| ~strcmpi(rfGene,'RF2'), usrRefFg=1; end
|
|
rfSpec= answer(2); %if strcmpi(answer(2),'None'), rfSpec= ''; end
|
|
rfGnSp= strcat(rfGene,rfSpec);
|
|
|
|
|
|
%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
%First user input prototype code
|
|
if ~exist('RF1scanN','var') && ~exist('RF2scanN','var') %change || &&
|
|
prompt = {'Enter Masterplate Number(s) of Your Reference GeneName spots:',...
|
|
'Enter GeneName of Your Reference:'};
|
|
dlg_title = 'User Reference Input';
|
|
num_lines = 1;
|
|
def = {'Ref MP(s)','USRrefGeneName'};
|
|
answer = inputdlg(prompt,dlg_title,num_lines,def);
|
|
rfMPstr= cell2mat(answer(1));
|
|
rfMPcomas=strfind((cell2mat(answer(1))),',');
|
|
n=0;
|
|
if isempty(rfMPcomas)|| max(rfMPcomas)== length(rfMPstr)
|
|
usrMPs= rfMPstr
|
|
else
|
|
for i= rfMPcomas,
|
|
n=n+1
|
|
usrMPs(n)= str2double(rfMPstr(i-1:i))
|
|
if i== max(rfMPcomas)
|
|
usrMPs(n+1)= str2double(rfMPstr(i:end))
|
|
end
|
|
end
|
|
end
|
|
usrMPs= answer(1);
|
|
refGene= answer(2);
|
|
|
|
end
|
|
%}
|