Pause EZview work for now
This commit is contained in:
212
workflow/.old/apps/matlab/ExpFrontend.m
Normal file
212
workflow/.old/apps/matlab/ExpFrontend.m
Normal file
@@ -0,0 +1,212 @@
|
|||||||
|
% FrontEnd utility to copy source result sheet into Exp_ folders of
|
||||||
|
% StudiesQHTCP/StudyName/Exp1(2,3,4). This allow the automation of path
|
||||||
|
% capture to the StudiesDataArchieve.txt study log.
|
||||||
|
% Select, copy and Capture Study Exp_ details to study log
|
||||||
|
|
||||||
|
%Exp meta data collection
|
||||||
|
|
||||||
|
% Set path variables
|
||||||
|
wCodeDir=pwd;
|
||||||
|
Wstudy=fullfile('../', wCodeDir);
|
||||||
|
studyDate=datetime('now');
|
||||||
|
|
||||||
|
%Load results file meta data into workspace
|
||||||
|
try
|
||||||
|
ExpLabel= strcat('Exp',wCodeDir(end))
|
||||||
|
questdlg('\fontsize{20} Select the !!Results File','File Selection','OK', struct('Default','OK','Interpreter','tex'));
|
||||||
|
[resFile,resPath]= uigetfile('*.txt')
|
||||||
|
copyfile((fullfile(resPath,resFile)),fullfile(wCodeDir))
|
||||||
|
resDate= char(regexp(resFile, '(\d\d\_\d\d\d\d)|( \d\d\_\d\d\d\d|\d\d\d\d\d\d)','match'))
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
if ispc
|
||||||
|
lastSep=max(strfind(Wstudy,'\'))
|
||||||
|
studyName=Wstudy((lastSep+1):end)
|
||||||
|
else
|
||||||
|
lastSep=max(strfind(Wstudy,'/'))
|
||||||
|
studyName=Wstudy((lastSep+1):end)
|
||||||
|
end
|
||||||
|
|
||||||
|
% Build the study info array
|
||||||
|
S.sDate(1)= {studyDate};
|
||||||
|
S.sName(1)= {studyName}
|
||||||
|
S.sPath(1)= {Wstudy}
|
||||||
|
S.ELabel(1)= {ExpLabel}
|
||||||
|
S.EresDate(1)= {resDate}
|
||||||
|
S.EresFile(1)= {resFile}
|
||||||
|
S.EresPath(1)= {resPath}
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
fid = fopen('StudiesDataArchive.txt','a');
|
||||||
|
fprintf(fid,'StudyDate\tStudyName\tStudyPath\tExpNum\tExpDate\tExpPath\tResultFile\n');
|
||||||
|
fprintf(fid, '%s\t %s\t %s\t %s\t %s\t %s\t %s \n',S.sDate{1},S.sName{1},S.sPath{1},S.ELabel{1},S.EresDate{1},S.EresPath{1},S.EresFile{1});
|
||||||
|
fclose(fid);
|
||||||
|
fclose('all');
|
||||||
|
|
||||||
|
catch
|
||||||
|
cd(wCodeDir)
|
||||||
|
disp('Error: Unable to Execute ExpFrontend.m')
|
||||||
|
end
|
||||||
|
|
||||||
|
cd(wCodeDir)
|
||||||
|
|
||||||
|
%*************************************************************************************
|
||||||
|
%*************************************************************************************
|
||||||
|
%#####################################################################################
|
||||||
|
%Improved storage ammenable for database use
|
||||||
|
%FrontEnd utility to copy source result sheet into Exp_ folders of
|
||||||
|
%StudiesQHTCP/StudyName/Exp1(2,3,4). This allow the automation of path
|
||||||
|
%capture to the StudiesDataArchieve.txt study log.
|
||||||
|
%Select, copy and Capture Study Exp_ details to study log
|
||||||
|
studyDateNow= studyDate %preserve the 'Now' date
|
||||||
|
nowNumFNm= strcat((int2str(now)),'.mat') % from previous section incase the /StudyName doesn't have a standard date
|
||||||
|
%capture the /StudiesQHTCP directory for storing log data
|
||||||
|
cd ../..
|
||||||
|
logPath= pwd %is /.../Exp_
|
||||||
|
cd(wCodeDir)
|
||||||
|
%Try to load an existing data set from previous Frontend calls
|
||||||
|
try %end ~ln121
|
||||||
|
load(fullfile(logPath,'.studyLog.mat')) %load(fullfile('../../','studyLog.mat'))
|
||||||
|
catch %If no studyLog.mat found [Initial First Entry]
|
||||||
|
ExpLabel= strcat('Exp',wCodeDir(end))
|
||||||
|
resDate= char(regexp(resFile, '(\d\d\_\d\d\d\d)|( \d\d\_\d\d\d\d|\d\d\d\d\d\d)','match'))
|
||||||
|
cd .. %move up to current study folder from ../Exp_ folder;
|
||||||
|
%Study meta data collection
|
||||||
|
Wstudy= pwd %Capture the specific current Study directory
|
||||||
|
try %try to extract study date from folder name
|
||||||
|
studyDate= char(regexp(Wstudy, '(\d\d\_\d\d\d\d)|( \d\d\_\d\d\d\d|\d\d\d\d\d\d)| \d\d\d\d\d\d)','match'))
|
||||||
|
S.sDate(1)= {studyDate};
|
||||||
|
catch %if unsuccessful, accept the current date and convert to a 6 char string
|
||||||
|
studyDate= yyyymmdd(studyDateNow);
|
||||||
|
studyDate= (int2str(studyDate))
|
||||||
|
studyDate= studyDate(3:8)
|
||||||
|
end
|
||||||
|
%Capture StudyName
|
||||||
|
if ispc
|
||||||
|
lastSep=max(strfind(Wstudy,'\'))
|
||||||
|
studyName= Wstudy((lastSep+1):end)
|
||||||
|
else
|
||||||
|
lastSep=max(strfind(Wstudy,'/'))
|
||||||
|
studyName= Wstudy((lastSep+1):end)
|
||||||
|
|
||||||
|
end
|
||||||
|
%Put current First data entry into Structure of Save to StudyLog.mat file
|
||||||
|
S.sDate(1)= {studyDate};
|
||||||
|
S.sName(1)= {studyName}
|
||||||
|
S.sPath(1)= {Wstudy}
|
||||||
|
S.ELabel(1)= {ExpLabel}
|
||||||
|
S.EresDate(1)= {resDate}
|
||||||
|
S.EresFile(1)= {resFile}
|
||||||
|
S.EresPath(1)= {resPath}
|
||||||
|
|
||||||
|
cd(wCodeDir)
|
||||||
|
|
||||||
|
logFiletxt= fullfile(logPath,'StudiesDataArchive4DB.txt') %relative .txt path
|
||||||
|
%Initialize the StudiesDataArchive.txt file with the First row of meta data
|
||||||
|
|
||||||
|
%Print to a .txt spreadsheet the first set of data in the logFiletxt file
|
||||||
|
fid = fopen(logFiletxt,'w');
|
||||||
|
fprintf(fid,'StudyDate\tStudyName\tStudyPath\tExpNum\tExpDate\tExpPath\tResultFile\n');
|
||||||
|
fprintf(fid, '%s\t %s\t %s\t %s\t %s\t %s\t %s \n',studyDate,studyName,Wstudy,ExpLabel,resDate,resPath,resFile);
|
||||||
|
fclose(fid);
|
||||||
|
%Save the first entry meta data into a permanent .mat files for future recall
|
||||||
|
save(fullfile(logPath,'studyLog4DB.mat'), 'S')
|
||||||
|
save(fullfile(logPath,'.studyLog.mat'), 'S')
|
||||||
|
save(fullfile(logPath,'.nowNumFNm.mat'), 'S')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end %end for try for the First entry only
|
||||||
|
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
%++++++++END of FIRST ENTRY startup section++++++++++++++++++++++++++++++++
|
||||||
|
%++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%Begin routine for all Entries After the Initial data entry****************
|
||||||
|
ExpLabel= strcat('Exp',wCodeDir(end))
|
||||||
|
resDate= char(regexp(resFile, '(\d\d\_\d\d\d\d)|( \d\d\_\d\d\d\d|\d\d\d\d\d\d)','match')) %Capture date from !!Results file
|
||||||
|
|
||||||
|
cd .. %Move to the current study folder
|
||||||
|
|
||||||
|
%Capture study meta dat
|
||||||
|
Wstudy= pwd % Capture the path to the current study
|
||||||
|
|
||||||
|
%Attempt to extract study date from folder name and convert to a
|
||||||
|
%searchable numeric date
|
||||||
|
studyDate= char(regexp(Wstudy, '(\d\d\_\d\d\d\d)|( \d\d\_\d\d\d\d|\d\d\d\d\d\d)| \d\d\d\d\d\d)','match'))
|
||||||
|
if ~isempty(studyDate) %If no date in folder name use current date and convert to 6char string
|
||||||
|
S.sDate(1)= {studyDate};
|
||||||
|
if isequal((str2num(studyDate(3))),'_') %Remove '_' so that date is a number for easy DB search
|
||||||
|
studyDate= strcat(studyDate(1:2),studyDate(4:6))
|
||||||
|
end
|
||||||
|
else
|
||||||
|
studyDate= yyyymmdd(studyDateNow);
|
||||||
|
studyDate= (int2str(studyDate))
|
||||||
|
studyDate= studyDate(3:8)
|
||||||
|
end
|
||||||
|
|
||||||
|
if ispc
|
||||||
|
lastSep=max(strfind(Wstudy,'\'))
|
||||||
|
studyName= Wstudy((lastSep+1):end)
|
||||||
|
else
|
||||||
|
lastSep=max(strfind(Wstudy,'/'))
|
||||||
|
studyName= Wstudy((lastSep+1):end)
|
||||||
|
end
|
||||||
|
|
||||||
|
%Put meta data into a structure for storage (studyLog.mat) and future
|
||||||
|
%compare operations
|
||||||
|
lastRow= length(S.sPath)
|
||||||
|
|
||||||
|
%Compare these just obtained paths with those stored in the studyLog.mat
|
||||||
|
%file and add a new row if the study or results sheet meta data is new or different
|
||||||
|
cd .. %Move the the /QHTPCstudies folder
|
||||||
|
logtxt= 'StudiesDataArchive4DB.txt'
|
||||||
|
logFiletxt= fullfile(logPath,logtxt) %
|
||||||
|
try
|
||||||
|
matched=0;
|
||||||
|
for n= 1:(lastRow)
|
||||||
|
if strcmp(Wstudy,S.sPath(n)) && strcmp(resPath, S.EresPath(n)) && strcmp(ExpLabel, S.ELabel(n))
|
||||||
|
matched= 1;
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
%Update the StudiesDataArchive.txt file with a new row of meta data
|
||||||
|
if matched== 0 %if no match for this entry then add a line to the text archive file
|
||||||
|
fid = fopen(logFiletxt,'w');
|
||||||
|
S.sDate(lastRow+1)= {studyDate};
|
||||||
|
S.sName(lastRow+1)= {studyName};
|
||||||
|
S.sPath(lastRow+1)= {Wstudy};
|
||||||
|
S.ELabel(lastRow+1)= {ExpLabel};
|
||||||
|
S.EresDate(lastRow+1)= {resDate};
|
||||||
|
S.EresFile(lastRow+1)= {resFile};
|
||||||
|
S.EresPath(lastRow+1)= {resPath};
|
||||||
|
for n= 1:(lastRow +1)
|
||||||
|
%Print to a .txt spreadsheet and Save update to .mat files
|
||||||
|
if n==1
|
||||||
|
fprintf(fid,'StudyDate\tStudyName\tStudyPath\tExpNum\tExpDate\tExpPath\tResultFile\n');
|
||||||
|
end
|
||||||
|
fprintf(fid, '%s\t %s\t %s\t %s\t %s\t %s\t %s \n',S.sDate{n},S.sName{n},S.sPath{n},S.ELabel{n},S.EresDate{n},S.EresPath{n},S.EresFile{n});
|
||||||
|
end
|
||||||
|
|
||||||
|
fclose(fid); %close DBase amenable study log file after data update
|
||||||
|
|
||||||
|
save((fullfile(logPath,'studyLog4DB.mat')), 'S') % path for studyLog.mat
|
||||||
|
save((fullfile(logPath,'.studyLog.mat')), 'S') %path backup studyLogBU.mat
|
||||||
|
save((fullfile(logPath,strcat('.',nowNumFNm))), 'S')
|
||||||
|
end
|
||||||
|
fclose('all');
|
||||||
|
|
||||||
|
catch
|
||||||
|
cd(wCodeDir) %Return to the location of the frontend.m code (/studyName/Exp_)
|
||||||
|
fclose('all');
|
||||||
|
clear S %clear data structure variable 'S.'
|
||||||
|
end
|
||||||
|
|
||||||
|
cd(wCodeDir) %Return to the location of the frontend.m code (/studyName/Exp_)
|
||||||
|
clear all %clear workspace variables
|
||||||
|
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
global Expaa
|
global Expaa
|
||||||
global Expbb
|
global Expbb
|
||||||
global expType
|
global expType
|
||||||
global usrExpJobsDir
|
global scansDir
|
||||||
global zonePB
|
global zonePB
|
||||||
|
|
||||||
w=pwd;
|
w=pwd;
|
||||||
@@ -90,7 +90,7 @@ if expType==1
|
|||||||
|
|
||||||
% Return without execution if user cancels or doesn't select a .mat file
|
% Return without execution if user cancels or doesn't select a .mat file
|
||||||
try
|
try
|
||||||
if openExpfile==0 || scansDir==0
|
if matFile==0 || scansDir==0
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
catch
|
catch
|
||||||
@@ -100,14 +100,11 @@ if expType==1
|
|||||||
orfLstSel=get(handles.GeneOrfTog,'value')
|
orfLstSel=get(handles.GeneOrfTog,'value')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
Exp(expN).Dexp(1).srtGnLst={('CheckMP/MPDMfile')};
|
Exp(expN).Dexp(1).srtGnLst={('CheckMP/MPDMfile')};
|
||||||
Exp(expN).Dexp(1).srtOrfLst={('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,'value',1) %Fix accomodation for bug in App Designer .. .wlapp converter 230906
|
||||||
set(handles.listboxGnOrf,'string',cellstr([{'Failed To Load'}; {' '}]));
|
set(handles.listboxGnOrf,'string',cellstr([{'Failed To Load'}; {' '}]));
|
||||||
|
load(matFile);
|
||||||
ExpOutmat=fullfile(scansDir,openExpfile);
|
|
||||||
load(ExpOutmat);
|
|
||||||
cd(scansDir)
|
cd(scansDir)
|
||||||
cd ..;
|
cd ..;
|
||||||
resDir=pwd;
|
resDir=pwd;
|
||||||
@@ -137,7 +134,6 @@ if expType==1
|
|||||||
load(fullfile(resDir,'Fotos','BGatTpts'))
|
load(fullfile(resDir,'Fotos','BGatTpts'))
|
||||||
load(fullfile(resDir,'PTmats','NImParameters'))
|
load(fullfile(resDir,'PTmats','NImParameters'))
|
||||||
%Backup for cond. sothat failure to load is recovered back prev. ExpJob data
|
%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.DM=DM;
|
||||||
Exp(expN).Dexp(1).temp.MP=MP;
|
Exp(expN).Dexp(1).temp.MP=MP;
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
%single gene L based interaction shift display
|
%single gene L based interaction shift display
|
||||||
function EZinterAgingDev0
|
function EZinterAgingDev0
|
||||||
global Exp
|
global Exp
|
||||||
|
global matFile
|
||||||
|
|
||||||
[openExpfile,scansDir]=uigetfile('.mat','Open Experiment folder and data storage .mat file name','MultiSelect','on');
|
[matFile,scansDir]=uigetfile('.mat','Open Experiment folder and data storage .mat file name','MultiSelect','on');
|
||||||
AgMPDM=load(fullfile(scansDir,'MasterPlateFiles','MPDMmat.mat'));
|
AgMPDM=load(fullfile(scansDir,'MasterPlateFiles','MPDMmat.mat'));
|
||||||
|
|
||||||
for i=1:size(openExpfile,2)
|
for i=1:size(matFile,2)
|
||||||
ExpOutmat{i}=fullfile(scansDir,openExpfile{i});
|
ExpOutmat{i}=fullfile(scansDir,matFile{i});
|
||||||
EScan{i}=load(ExpOutmat{1});
|
EScan{i}=load(ExpOutmat{1});
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ function EZmultiDayGui
|
|||||||
global exDlst
|
global exDlst
|
||||||
global exFolder
|
global exFolder
|
||||||
global expType
|
global expType
|
||||||
global usrExpJobsDir
|
global scansDir
|
||||||
|
|
||||||
xPos=0.05;
|
xPos=0.05;
|
||||||
btnWid=0.10;
|
btnWid=0.10;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ for n=1:Exp(expN).DexpLength % size(matFile,2)
|
|||||||
set(handles.listboxGnOrf,'value',1) %Fix accomodation for bug in App Designer .. .wlapp converter 230918
|
set(handles.listboxGnOrf,'value',1) %Fix accomodation for bug in App Designer .. .wlapp converter 230918
|
||||||
set(handles.listboxGnOrf,'string',cellstr([{'Failed To Load'}; {' '}]));
|
set(handles.listboxGnOrf,'string',cellstr([{'Failed To Load'}; {' '}]));
|
||||||
% try
|
% try
|
||||||
ExpOutmat=matFile(n) %fullfile(scansDir,openExpfile);
|
ExpOutmat=matFile(n)
|
||||||
load(char(ExpOutmat));
|
load(char(ExpOutmat));
|
||||||
%cd(scansDir)
|
%cd(scansDir)
|
||||||
%cd ..;
|
%cd ..;
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ global Exp
|
|||||||
global Expaa
|
global Expaa
|
||||||
global Expbb
|
global Expbb
|
||||||
global userPars
|
global userPars
|
||||||
global usrExpJobsDir
|
global scansDir
|
||||||
|
global matFile
|
||||||
global zonePB
|
global zonePB
|
||||||
global mpdmFile
|
global mpdmFile
|
||||||
global ghandles
|
global ghandles
|
||||||
@@ -147,7 +148,7 @@ try
|
|||||||
% directory in the uigetfile to load the experiment .mat file.
|
% directory in the uigetfile to load the experiment .mat file.
|
||||||
|
|
||||||
try
|
try
|
||||||
[openExpfile,scansDir]=uigetfile('.mat','Open Experiment folder and data storage .mat file name','MultiSelect','off')
|
[matFile,scansDir]=uigetfile('.mat','Open Experiment folder and data storage .mat file name','MultiSelect','off')
|
||||||
load (fullfile(Exp(1).Dexp(1).ExpFoldr,'MasterPlateFiles','MPDMmat.mat'))
|
load (fullfile(Exp(1).Dexp(1).ExpFoldr,'MasterPlateFiles','MPDMmat.mat'))
|
||||||
for i=1:numExps
|
for i=1:numExps
|
||||||
Exp(i).Dexp(1).DM=DM;
|
Exp(i).Dexp(1).DM=DM;
|
||||||
@@ -804,13 +805,9 @@ catch ME %Outer loop try around entire code subroutine
|
|||||||
Exp(1).Dexp(1).srtOrfLst=cellstr([{'Failed To Load'}; {' '}]);
|
Exp(1).Dexp(1).srtOrfLst=cellstr([{'Failed To Load'}; {' '}]);
|
||||||
Exp(2).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'}; {' '}]);
|
Exp(3).Dexp(1).srtOrfLst=cellstr([{'Failed To Load'}; {' '}]);
|
||||||
%[openExpfile,scansDir]
|
|
||||||
if ~contains(openExpfile,'.mat')
|
if ~contains(matFile,'.mat')
|
||||||
cd(scansDir)
|
ExpOutImFile=fullfile(matFile);
|
||||||
cd '..'
|
|
||||||
ExpPath=pwd;
|
|
||||||
cd(w)
|
|
||||||
ExpOutImFile=fullfile(scansDir,openExpfile);
|
|
||||||
EZvImagesOnly
|
EZvImagesOnly
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1892,14 +1892,13 @@ function HMapRange_Callback(hObject, eventdata, handles)
|
|||||||
% flip=upper(answer(2));
|
% flip=upper(answer(2));
|
||||||
end
|
end
|
||||||
|
|
||||||
function SetExpJobsFolder_Callback(hObject, eventdata, handles)
|
function setScansDir_Callback(hObject, eventdata, handles)
|
||||||
% hObject handle to SetExpJobsFolder (see GCBO)
|
% hObject handle to SetExpJobsFolder (see GCBO)
|
||||||
% eventdata reserved - to be defined in a future version of MATLAB
|
% eventdata reserved - to be defined in a future version of MATLAB
|
||||||
% handles structure with handles and user data (see GUIDATA
|
% handles structure with handles and user data (see GUIDATA
|
||||||
if ~exist('usrExpJobsDir','var')
|
% if ~exist('scansDir','var')
|
||||||
selpath=uigetdir('default','Set /ExpJobs Folder')
|
scansDir=uigetdir('default','Set Project Scans Folder')
|
||||||
usrExpJobsDir=selpath;
|
% end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
% Executes on button press in zonePB1.
|
% Executes on button press in zonePB1.
|
||||||
|
|||||||
Reference in New Issue
Block a user