Format DMPexcel2mat.m

This commit is contained in:
2024-07-25 13:12:19 -04:00
parent 4d72a078b5
commit 37533136ae
2 changed files with 133 additions and 150 deletions

View File

@@ -11,12 +11,14 @@ else
end end
infile= Scanfiles(1,:); infile= Scanfiles(1,:);
cd(MPdir) cd(MPdir)
%fid=fopen(infile)%('exp23PrintTimes.xls'); % textread puts date and time sequentially into vector %fid=fopen(infile)%('exp23PrintTimes.xls'); % textread puts date and time sequentially into vector
if ispc if ispc
[num, txt, raw] = xlsread(infile); %,'Yor1HitsMPsetFinal'); [num, txt, raw] = xlsread(infile); %,'Yor1HitsMPsetFinal');
fields= {txt(2,1:15)}; %or 1:17 for later but dont wish to exceed and cause error ? if used fields= {txt(2,1:15)}; %or 1:17 for later but dont wish to exceed and cause error ? if used
else else
clear MPtbl clear MPtbl
opts = detectImportOptions(infile); opts = detectImportOptions(infile);
@@ -26,12 +28,10 @@ else
MPcell= readcell(infile); MPcell= readcell(infile);
end end
cd(w) cd(w)
numb=0; numb=0;
clear MP; clear MP;
try try
if ispc if ispc
excLnNum=3; excLnNum=3;
while (isequal(txt{excLnNum,1},'###')) while (isequal(txt{excLnNum,1},'###'))
@@ -50,19 +50,20 @@ else
MP(numb).orfRep= ' '; MP(numb).orfRep= ' ';
MP(numb).specifics= ' '; MP(numb).specifics= ' ';
end end
%{
if size(raw,2)>17 ; Future MP field % Future MP field
MP(numb).specifics2= {raw((excLnNum+1):(excLnNum+384),18)}; %added 12_1008 to specify strain Bkground in MP % if size(raw,2)>17
else % MP(numb).specifics2= {raw((excLnNum+1):(excLnNum+384),18)}; %added 12_1008 to specify strain Bkground in MP
MP(numb).specifics2= ' '; % else
end % MP(numb).specifics2=' ';
%} % end
excLnNum=excLnNum+385; excLnNum=excLnNum+385;
msg=strcat('NumberOfMP = ',num2str(numb), ' lastLineNo. = ',num2str(excLnNum)); msg=strcat('NumberOfMP = ',num2str(numb), ' lastLineNo. = ',num2str(excLnNum));
end % end if ispc end
else %if not ispc else
excLnNum=1; excLnNum=1;
while (isequal(MPcell{(excLnNum+2),1},'###')) while (isequal(MPcell{(excLnNum+2),1},'###'))
numb=numb+1; numb=numb+1;
@@ -91,37 +92,27 @@ msg=strcat('NumberOfMP = ',num2str(numb), ' lastLineNo. = ',num2str(excLnNum))
excLnNum=excLnNum+385; excLnNum=excLnNum+385;
msg=strcat('NumberOfMP = ',num2str(numb), 'lastLineNo. = ',num2str(excLnNum)) msg=strcat('NumberOfMP = ',num2str(numb), 'lastLineNo. = ',num2str(excLnNum))
end end
end
end %end of if ispc for MP while loop choice PC or Linux-other (ln~48)
catch ME catch ME
h = msgbox(msg,'Check Number of Master Plates and Excel Lines') h = msgbox(msg,'Check Number of Master Plates and Excel Lines')
uiwait(h); uiwait(h);
end %end for try MP excel sheet input end %end for try MP excel sheet input
%*********************************************************************
%DMupload %DMupload
%Drug and Media Plate setup Upload from Excel %Drug and Media Plate setup Upload from Excel
%scan().plate().LocInd().gene
cd(MPdir); cd(MPdir);
excLnNum=1; excLnNum=1;
%w=pwd
%cd('D:\EASY\Experiments\'); %cd(ExpPath); %
numOfDrugs=0; numOfDrugs=0;
numOfMedias=0; numOfMedias=0;
%GUI input for selecting a MasterPlate Excel file %GUI input for selecting a MasterPlate Excel file
questdlg('\fontsize{20} Select DrugMedia File','File Selection','OK', struct('Default','OK','Interpreter','tex')); questdlg('\fontsize{20} Select DrugMedia File','File Selection','OK', struct('Default','OK','Interpreter','tex'));
[Scanfiles, pathname]=uigetfile('*.*', 'MultiSelect','off'); [Scanfiles, pathname]=uigetfile('*.*', 'MultiSelect','off');
if ispc DMdir=fullfile(pathname);
DMdir= fullfile(pathname,'\');
else
DMdir=fullfile(pathname,'/');
end
clear infile; clear infile;
infile= Scanfiles(1,:); infile= Scanfiles(1,:);
cd(DMdir) cd(DMdir)
%fid=fopen(infile)%('exp23PrintTimes.xls'); % textread puts date and time sequentially into vector
if ispc if ispc
[num, txt, raw] = xlsread(infile); %,'Yor1HitsMPsetFinal'); [num, txt, raw] = xlsread(infile); %,'Yor1HitsMPsetFinal');
fields= {txt(2,1:5)}; fields= {txt(2,1:5)};
@@ -133,13 +124,10 @@ else
Linked= DMtbl{1,1}; Linked= DMtbl{1,1};
DMcell= readcell(infile); DMcell= readcell(infile);
end end
cd(w) cd(w)
numb=0; numb=0;
%fields= {txt(2,1:5)};
%Linked= num(1,1);
if isequal(Linked,1) %Drugs and Media are linked 1 to 1; else they are combinatorial if isequal(Linked,1) %Drugs and Media are linked 1 to 1; else they are combinatorial
clear DM; clear DM;
%try %try
@@ -180,9 +168,6 @@ else
msg=strcat('NumberOf1:1DrugMediaPlates = ',num2str(numb), ' lastLineNo. = ',num2str(excLnNum)) msg=strcat('NumberOf1:1DrugMediaPlates = ',num2str(numb), ' lastLineNo. = ',num2str(excLnNum))
end end
end end
end end
%Legacy contengency -Not ever used!! %Legacy contengency -Not ever used!!
if isequal(Linked,0) %0 indicates Drugs and Media are combinatorial if isequal(Linked,0) %0 indicates Drugs and Media are combinatorial
@@ -218,9 +203,7 @@ else %else if not PC (Then linux or other)
excLnNum=excLnNum+1; excLnNum=excLnNum+1;
end end
end end
msg=strcat('NumberOfDrugs = ',num2str(drgCnt), ' NumberOfMedias = ',num2str(medCnt) ) msg=strcat('NumberOfDrugs = ',num2str(drgCnt), ' NumberOfMedias = ',num2str(medCnt) )
end end
save (fullfile(MPdir,'MPDMmat'), 'fields','MP','DM','Linked'); save (fullfile(MPdir,'MPDMmat'), 'fields','MP','DM','Linked');