123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317 |
- % EZmultiExLoad
- % Calls to EZVimDisplay (ln 185) EZmultiGeneRFsLst (ln213) EZdiagRFsSheet(ln218)
- % TODO this file could use some elseif's
- global Exp
- global zonePB
- global Expaa
- global Expbb
- global exDlst
- global exFolder
- % Load .mat file
- expN=zonePB; % added to accomodate AppDesigner limitations 230821
- Exp(expN).UgeneCnt=0;
- Exp(expN).DexpLength=size(matFile,2); DexpLength=size(matFile,2);
- for n=1:Exp(expN).DexpLength % size(matFile,2)
- if expN==1
- orfLstSel=get(handles.GeneOrfTog,'value');
- end
- if expN==2
- orfLstSel=get(handles.GeneOrfTog,'value');
- end
- if expN==3
- orfLstSel=get(handles.GeneOrfTog,'value');
- end
- Exp(expN).Dexp(n).srtGnLst={('CheckMP/MPDMfile')};
- Exp(expN).Dexp(n).srtOrfLst={('CheckMP/MPDMfile')};
- set(handles.listboxGnOrf,'value',1) %Fix accomodation for bug in App Designer .. .wlapp converter 230918
- set(handles.listboxGnOrf,'string',cellstr([{'Failed To Load'}; {' '}]));
- % try
- ExpOutmat=matFile(n)
- load(char(ExpOutmat));
- %cd(scansDir)
- %cd ..;
- %resDir=pwd;
- Exp(expN).Dexp(n).resDir=cell2mat(resDir(n));
- cd(Exp(expN).Dexp(n).resDir)
- cd ..;
- ExpPath=pwd;
- Exp(expN).Dexp(n).ExpFoldr=ExpPath;
- cd(w)
- % Experiment LOADs
- load(fullfile(Exp(expN).Dexp(n).ExpFoldr,'MasterPlateFiles','MPDMmat.mat'))
- load(fullfile(Exp(expN).Dexp(n).resDir,'Fotos','Coordinates'))
- load(fullfile(Exp(expN).Dexp(n).resDir,'Fotos','anlZones'))
- load(fullfile(Exp(expN).Dexp(n).resDir,'Fotos','BGatTpts'))
- load(fullfile(Exp(expN).Dexp(n).resDir,'PTmats','NImParameters'))
- % Backup for cond. sothat failure to load is recovered back prev. ExpJob data
- % test in temp
- Exp(expN).Dexp(n).temp.DM=DM;
- Exp(expN).Dexp(n).temp.MP=MP;
- Exp(expN).Dexp(n).temp.scan=scan;
- Exp(expN).Dexp(n).temp.FexpScanSpots=FexpScanSpots;
- Exp(expN).Dexp(n).temp.FexpScanBMtp=FexpScanBMtp;
- Exp(expN).Dexp(n).temp.anlZoneRefs=anlZoneRefs;
- Exp(expN).Dexp(n).temp.ImParMat=ImParMat;
- Exp(expN).Dexp(n).DM=Exp(expN).Dexp(n).temp.DM;
- Exp(expN).Dexp(n).MP=Exp(expN).Dexp(n).temp.MP;
- Exp(expN).Dexp(n).scan=Exp(expN).Dexp(n).temp.scan;
- Exp(expN).Dexp(n).FexpScanSpots=Exp(expN).Dexp(n).temp.FexpScanSpots;
- Exp(expN).Dexp(n).FexpScanBMtp=Exp(expN).Dexp(n).temp.FexpScanBMtp;
- Exp(expN).Dexp(n).anlZoneRefs=Exp(expN).Dexp(n).temp.anlZoneRefs;
- Exp(expN).Dexp(n).ImParMat=Exp(expN).Dexp(n).temp.ImParMat;
- Exp(expN).Dexp((Exp(expN).DexpLength+1):end)=[];
- Exp(expN).Dexp(n).temp=[];
- end
- % Load First new ExpJOb
- if expN==1
- tPtsSize=size(Exp(expN).Dexp(1).FexpScanBMtp{1,1},(3)); %size(FexpScanBMtp{1,1},3);
- set(handles.MPsldr1,'max',MPnum); %length(MP)
- set(handles.DMsldr1,'max',length(DM.drug));
- set(handles.Tptsldr1,'max',tPtsSize);
- % MPnum=length(Exp(expN).Dexp(1).MP);
- set(handles.MPsldr1,'min',1,'max',MPnum)
- 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/MPnum 1/MPnum]); % [1/length(MP) 1/length(MP)])
- set(handles.DMsldr1,'SliderStep',[1/length(DM.drug) 1/length(DM.drug)]);
- set(handles.Tptsldr1,'SliderStep',[1/tPtsSize 1/tPtsSize]);
- set(handles.DN1,'value',1)
- set(handles.DN1,'string',1)
- end
- if expN==2,
- tPtsSize=size(Exp(expN).Dexp(1).FexpScanBMtp{1,1},(3)); % size(FexpScanBMtp{1,1},3);
- set(handles.MPsldr2,'max',MPnum);
- 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) % length(MP))
- DMnum=length(Exp(expN).Dexp(n).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/MPnum 1/MPnum]); %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(Exp(expN).Dexp(1).FexpScanBMtp{1,1},(3)); % size(FexpScanBMtp{1,1},3);
- set(handles.MPsldr3,'max',MPnum);
- 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/MPnum 1/MPnum]); % 1/length(MP) 1/length(MP)])
- set(handles.DMsldr3,'SliderStep',[1/length(DM.drug) 1/length(DM.drug)]);
- set(handles.Tptsldr3,'SliderStep',[1/tPtsSize 1/tPtsSize]);
- set(handles.DN3,'value',1)
- set(handles.DN3,'string',1)
- end
- if expN==1
- set(handles.GeneOrfLoc1,'string',{''});
- 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,'value',1) %Fix accomodation for bug in App Designer .. .wlapp converter 230918
- set(handles.listboxGnOrf,'string',Exp(expN).Dexp(1).srtGnLst)
- set(handles.listboxGnOrf,'string',Exp(expN).Dexp(1).srtOrfLst)
- EZVimDisplay
- usrRefFg=0;
- 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);
- if iscell(answer(1))
- rfGene=cell2mat(answer(1));
- else
- rfGene=answer(1);
- end
- if ~strcmpi(rfGene,'RF1')|| ~strcmpi(rfGene,'RF2'), usrRefFg=1; end
- rfSpec=answer(2); % if strcmpi(answer(2),'None'), rfSpec=''; end
- rfGnSp=strcat(rfGene,rfSpec);
- if strcmpi(rfSpec,'None'), rfGnSp={strcat(rfGene,'-')}; end
- % Added 17-1023 For User Addition of Gene Composites to ListBox
- Expaa{expN,1}=[]
- Expbb{expN,1}=[];
-
- for n=1:size(matFile,2)
- try
- EZmultiGeneRFsLst
- catch
- msg='EZmultiGeneRFLst failed possibly Too Few non-zero Median spots'
- end
- EZdiagRFsSheet
- Exp(expN).Dexp(n).RFrnames=rnames;
- Exp(expN).Dexp(n).RFdata=data;
- RFconfig=0;
- if sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmean')) ...
- && ~isempty(Exp(expN).Dexp(n).RFmean) ...
- && sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmeanG')) ...
- && isempty(Exp(expN).Dexp(n).RFmeanG)
- RFconfig=1;
- end
- if sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmean'))==0 ...
- || isempty(Exp(expN).Dexp(n).RFmean) ...
- && sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmeanG')) ...
- && ~isempty(Exp(expN).Dexp(n).RFmeanG)
- RFconfig=2;
- end
- if sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmean')) ...
- && ~isempty(Exp(expN).Dexp(n).RFmean) ...
- && sum(ismember(fieldnames(Exp(expN).Dexp(n)),'RFmeanG')) ...
- && ~isempty(Exp(expN).Dexp(n).RFmeanG)
- RFconfig=3;
- end
- Exp(expN).RFconfig=RFconfig;
- Exp(expN).Dexp(n).RFconfig=RFconfig;
- try msgBadGeneName
- catch, end
- try
- Exp(expN).Dexp(n).resetHtmpTg =5; %Exp(expN).resetHtmpTg =5;
- if RFconfig==0
- RFconfigMsg='No RF1 references in this Experiment Job'
- Exp(expN).Dexp(n).resetHtmpTg =3; %Exp(expN).resetHtmpTg =3;
- end
- catch
- end
- end
- % Auto Select Zone And Load Listboxgnorf Data
- DexpN=1;
- zeroCLn=zeros(1,DMnum);
- Exp(expN).expLoadCnt=Exp(expN).expLoadCnt+1; expLdCnt=Exp(expN).expLoadCnt;
- if expN==1 % Adapted to accomodate AppDesigner 230821
- 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;
- Exp(1).hzeroCLn(expLdCnt)=plot(DNLaxes1,zeroCLn,1:DMnum,'y');
- end
- if expN==2 % Adapted to accomodate AppDesigner 230821
- 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;
- Exp(2).hzeroCLn(expLdCnt)=plot(DNLaxes2,zeroCLn,1:DMnum,'y');
- end
- if expN==3 % Adapted to accomodate AppDesigner 230821
- 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;
- 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='Ln521'
- i
- end
- end
- end
- % HtMapTog 'string', 'Current user L/N' selection'
- Exp(expN).Dexp(DexpN).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;
|