Format DMPexcel2mat.m
This commit is contained in:
@@ -5,18 +5,20 @@ numOfMPs=0;
|
|||||||
questdlg('\fontsize{20} Select Master Plate File','File Selection','OK', struct('Default','OK','Interpreter','tex'))
|
questdlg('\fontsize{20} Select Master Plate File','File Selection','OK', struct('Default','OK','Interpreter','tex'))
|
||||||
[Scanfiles, pathname]=uigetfile('*.*','MultiSelect','off');
|
[Scanfiles, pathname]=uigetfile('*.*','MultiSelect','off');
|
||||||
if ispc
|
if ispc
|
||||||
MPdir= fullfile(pathname,'\');
|
MPdir= fullfile(pathname,'\');
|
||||||
else
|
else
|
||||||
MPdir=fullfile(pathname,'/');
|
MPdir=fullfile(pathname,'/');
|
||||||
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,201 +28,182 @@ 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},'###'))
|
||||||
numb=numb+1;
|
numb=numb+1;
|
||||||
MP(numb).head = {raw(excLnNum,2:6)};
|
MP(numb).head = {raw(excLnNum,2:6)};
|
||||||
MP(numb).recNum = {raw((excLnNum+1):(excLnNum+384),1)};
|
MP(numb).recNum = {raw((excLnNum+1):(excLnNum+384),1)};
|
||||||
MP(numb).orf = {raw((excLnNum+1):(excLnNum+384),2)};
|
MP(numb).orf = {raw((excLnNum+1):(excLnNum+384),2)};
|
||||||
MP(numb).strain = {raw((excLnNum+1):(excLnNum+384),3)};
|
MP(numb).strain = {raw((excLnNum+1):(excLnNum+384),3)};
|
||||||
MP(numb).genename= {raw((excLnNum+1):(excLnNum+384),12)};
|
MP(numb).genename= {raw((excLnNum+1):(excLnNum+384),12)};
|
||||||
MP(numb).drug= {raw((excLnNum+1):(excLnNum+384),8)};
|
MP(numb).drug= {raw((excLnNum+1):(excLnNum+384),8)};
|
||||||
MP(numb).media= {raw((excLnNum+1):(excLnNum+384),7)};
|
MP(numb).media= {raw((excLnNum+1):(excLnNum+384),7)};
|
||||||
if size(raw,2)>15
|
if size(raw,2)>15
|
||||||
MP(numb).orfRep= {raw((excLnNum+1):(excLnNum+384),16)}; %added 12_1005 to specify replicates Orfs in MP
|
MP(numb).orfRep= {raw((excLnNum+1):(excLnNum+384),16)}; %added 12_1005 to specify replicates Orfs in MP
|
||||||
MP(numb).specifics= {raw((excLnNum+1):(excLnNum+384),17)}; %added 12_1008 to specify replicates Specific details in MP
|
MP(numb).specifics= {raw((excLnNum+1):(excLnNum+384),17)}; %added 12_1008 to specify replicates Specific details in MP
|
||||||
else
|
|
||||||
MP(numb).orfRep= ' ';
|
|
||||||
MP(numb).specifics= ' ';
|
|
||||||
end
|
|
||||||
%{
|
|
||||||
if size(raw,2)>17 ; Future MP field
|
|
||||||
MP(numb).specifics2= {raw((excLnNum+1):(excLnNum+384),18)}; %added 12_1008 to specify strain Bkground in MP
|
|
||||||
else
|
|
||||||
MP(numb).specifics2= ' ';
|
|
||||||
end
|
|
||||||
%}
|
|
||||||
excLnNum=excLnNum+385;
|
|
||||||
|
|
||||||
msg=strcat('NumberOfMP = ',num2str(numb), ' lastLineNo. = ',num2str(excLnNum));
|
|
||||||
|
|
||||||
end % end if ispc
|
|
||||||
else %if not ispc
|
|
||||||
excLnNum=1;
|
|
||||||
while (isequal(MPcell{(excLnNum+2),1},'###'))
|
|
||||||
numb=numb+1;
|
|
||||||
MP(numb).head = {MPtbl(excLnNum,2:6)};
|
|
||||||
MP(numb).head{1}= table2cell(MP(numb).head{1});
|
|
||||||
MP(numb).recNum = {MPtbl((excLnNum+1):(excLnNum+384),1)};
|
|
||||||
MP(numb).recNum{1}= table2cell(MP(numb).recNum{1});
|
|
||||||
MP(numb).orf = {MPtbl((excLnNum+1):(excLnNum+384),2)};
|
|
||||||
MP(numb).orf{1}= table2cell(MP(numb).orf{1});
|
|
||||||
MP(numb).strain = {MPtbl((excLnNum+1):(excLnNum+384),3)};
|
|
||||||
MP(numb).strain{1}= table2cell(MP(numb).strain{1});
|
|
||||||
MP(numb).genename= {MPtbl((excLnNum+1):(excLnNum+384),12)};
|
|
||||||
MP(numb).genename{1}= table2cell(MP(numb).genename{1});
|
|
||||||
MP(numb).media= {MPtbl((excLnNum+1):(excLnNum+384),7)};
|
|
||||||
MP(numb).media{1}= table2cell(MP(numb).media{1});
|
|
||||||
if size(MPtbl,2)>15
|
|
||||||
MP(numb).orfRep= {MPtbl((excLnNum+1):(excLnNum+384),16)}; %added 12_1005 to specify replicates Orfs in MP
|
|
||||||
MP(numb).orfRep{1}= table2cell(MP(numb).orfRep{1});
|
|
||||||
MP(numb).specifics= {MPtbl((excLnNum+1):(excLnNum+384),17)}; %added 12_1008 to specify replicates Specific details in MP
|
|
||||||
MP(numb).specifics{1}= table2cell(MP(numb).specifics{1});
|
|
||||||
else
|
else
|
||||||
MP(numb).orfRep= ' ';
|
MP(numb).orfRep= ' ';
|
||||||
MP(numb).specifics= ' ';
|
MP(numb).specifics= ' ';
|
||||||
end
|
end
|
||||||
|
|
||||||
excLnNum=excLnNum+385;
|
% Future MP field
|
||||||
msg=strcat('NumberOfMP = ',num2str(numb), 'lastLineNo. = ',num2str(excLnNum))
|
% if size(raw,2)>17
|
||||||
|
% MP(numb).specifics2= {raw((excLnNum+1):(excLnNum+384),18)}; %added 12_1008 to specify strain Bkground in MP
|
||||||
|
% else
|
||||||
|
% MP(numb).specifics2=' ';
|
||||||
|
% end
|
||||||
|
|
||||||
|
excLnNum=excLnNum+385;
|
||||||
|
|
||||||
|
msg=strcat('NumberOfMP = ',num2str(numb), ' lastLineNo. = ',num2str(excLnNum));
|
||||||
|
|
||||||
|
end
|
||||||
|
else
|
||||||
|
excLnNum=1;
|
||||||
|
while (isequal(MPcell{(excLnNum+2),1},'###'))
|
||||||
|
numb=numb+1;
|
||||||
|
MP(numb).head={MPtbl(excLnNum,2:6)};
|
||||||
|
MP(numb).head{1}=table2cell(MP(numb).head{1});
|
||||||
|
MP(numb).recNum={MPtbl((excLnNum+1):(excLnNum+384),1)};
|
||||||
|
MP(numb).recNum{1}=table2cell(MP(numb).recNum{1});
|
||||||
|
MP(numb).orf={MPtbl((excLnNum+1):(excLnNum+384),2)};
|
||||||
|
MP(numb).orf{1}=table2cell(MP(numb).orf{1});
|
||||||
|
MP(numb).strain={MPtbl((excLnNum+1):(excLnNum+384),3)};
|
||||||
|
MP(numb).strain{1}=table2cell(MP(numb).strain{1});
|
||||||
|
MP(numb).genename={MPtbl((excLnNum+1):(excLnNum+384),12)};
|
||||||
|
MP(numb).genename{1}= table2cell(MP(numb).genename{1});
|
||||||
|
MP(numb).media= {MPtbl((excLnNum+1):(excLnNum+384),7)};
|
||||||
|
MP(numb).media{1}= table2cell(MP(numb).media{1});
|
||||||
|
if size(MPtbl,2)>15
|
||||||
|
MP(numb).orfRep= {MPtbl((excLnNum+1):(excLnNum+384),16)}; %added 12_1005 to specify replicates Orfs in MP
|
||||||
|
MP(numb).orfRep{1}=table2cell(MP(numb).orfRep{1});
|
||||||
|
MP(numb).specifics={MPtbl((excLnNum+1):(excLnNum+384),17)}; %added 12_1008 to specify replicates Specific details in MP
|
||||||
|
MP(numb).specifics{1}=table2cell(MP(numb).specifics{1});
|
||||||
|
else
|
||||||
|
MP(numb).orfRep= ' ';
|
||||||
|
MP(numb).specifics= ' ';
|
||||||
|
end
|
||||||
|
|
||||||
|
excLnNum=excLnNum+385;
|
||||||
|
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)};
|
||||||
Linked= num(1,1);
|
Linked= num(1,1);
|
||||||
else
|
else
|
||||||
opts = detectImportOptions(infile);
|
opts = detectImportOptions(infile);
|
||||||
DMtbl= readtable(infile,opts);
|
DMtbl= readtable(infile,opts);
|
||||||
fields= opts.VariableOptions;
|
fields= opts.VariableOptions;
|
||||||
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
|
||||||
excLnNum=2;
|
excLnNum=2;
|
||||||
if ispc
|
if ispc
|
||||||
while (~isequal(txt{excLnNum,2},'###'))
|
while (~isequal(txt{excLnNum,2},'###'))
|
||||||
numb=numb+1;
|
numb=numb+1;
|
||||||
DM.drug(numb) = {raw(excLnNum,2)};
|
DM.drug(numb) = {raw(excLnNum,2)};
|
||||||
DM.conc(numb) = {raw(excLnNum,3)};
|
DM.conc(numb) = {raw(excLnNum,3)};
|
||||||
DM.media(numb) = {raw(excLnNum,4)};
|
DM.media(numb) = {raw(excLnNum,4)};
|
||||||
DM.mod1(numb) = {raw(excLnNum,5)};
|
DM.mod1(numb) = {raw(excLnNum,5)};
|
||||||
DM.conc1(numb) = {raw(excLnNum,6)};
|
DM.conc1(numb) = {raw(excLnNum,6)};
|
||||||
DM.mod2(numb) = {raw(excLnNum,7)};
|
DM.mod2(numb) = {raw(excLnNum,7)};
|
||||||
DM.conc2(numb) = {raw(excLnNum,8)};
|
DM.conc2(numb) = {raw(excLnNum,8)};
|
||||||
excLnNum=excLnNum+1;
|
excLnNum=excLnNum+1;
|
||||||
msg=strcat('NumberOf1:1DrugMediaPlates = ',num2str(numb), ' lastLineNo. = ',num2str(excLnNum))
|
msg=strcat('NumberOf1:1DrugMediaPlates = ',num2str(numb), ' lastLineNo. = ',num2str(excLnNum))
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
clear DM
|
clear DM
|
||||||
excLnNum=1;
|
excLnNum=1;
|
||||||
while (~isequal(DMcell{excLnNum+1,2},'###'))
|
while (~isequal(DMcell{excLnNum+1,2},'###'))
|
||||||
numb=numb+1;
|
numb=numb+1;
|
||||||
DM.drug(numb) = {DMtbl(excLnNum,2)};
|
DM.drug(numb) = {DMtbl(excLnNum,2)};
|
||||||
DM.drug(numb)= table2cell(DM.drug{numb});
|
DM.drug(numb)= table2cell(DM.drug{numb});
|
||||||
DM.conc(numb) = {DMtbl(excLnNum,3)};
|
DM.conc(numb) = {DMtbl(excLnNum,3)};
|
||||||
DM.conc(numb)= table2cell(DM.conc{numb});
|
DM.conc(numb)= table2cell(DM.conc{numb});
|
||||||
DM.media(numb) = {DMtbl(excLnNum,4)};
|
DM.media(numb) = {DMtbl(excLnNum,4)};
|
||||||
DM.media(numb)= table2cell(DM.media{numb});
|
DM.media(numb)= table2cell(DM.media{numb});
|
||||||
DM.mod1(numb) = {DMtbl(excLnNum,5)};
|
DM.mod1(numb) = {DMtbl(excLnNum,5)};
|
||||||
DM.mod1(numb)= table2cell(DM.mod1{numb});
|
DM.mod1(numb)= table2cell(DM.mod1{numb});
|
||||||
DM.conc1(numb) = {DMtbl(excLnNum,6)};
|
DM.conc1(numb) = {DMtbl(excLnNum,6)};
|
||||||
DM.conc1(numb)= table2cell(DM.conc1{numb});
|
DM.conc1(numb)= table2cell(DM.conc1{numb});
|
||||||
DM.mod2(numb) = {DMtbl(excLnNum,7)};
|
DM.mod2(numb) = {DMtbl(excLnNum,7)};
|
||||||
DM.mod2(numb)= table2cell(DM.mod2{numb});
|
DM.mod2(numb)= table2cell(DM.mod2{numb});
|
||||||
DM.conc2(numb) = {DMtbl(excLnNum,8)};
|
DM.conc2(numb) = {DMtbl(excLnNum,8)};
|
||||||
DM.conc2(numb)= table2cell(DM.conc2{numb});
|
DM.conc2(numb)= table2cell(DM.conc2{numb});
|
||||||
excLnNum=excLnNum+1;
|
excLnNum=excLnNum+1;
|
||||||
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
|
||||||
clear DM;
|
clear DM;
|
||||||
excLnNum=2;
|
excLnNum=2;
|
||||||
drgCnt=0;
|
drgCnt=0;
|
||||||
medCnt=0;
|
medCnt=0;
|
||||||
if ispc
|
if ispc
|
||||||
while (~isequal(txt{excLnNum,2},'###'))
|
while (~isequal(txt{excLnNum,2},'###'))
|
||||||
drgCnt=drgCnt+1;
|
drgCnt=drgCnt+1;
|
||||||
DM.drug(drgCnt) = {raw(excLnNum,2)};
|
DM.drug(drgCnt) = {raw(excLnNum,2)};
|
||||||
DM.conc(drgCnt) = {raw(excLnNum,3)};
|
DM.conc(drgCnt) = {raw(excLnNum,3)};
|
||||||
excLnNum=excLnNum+1;
|
excLnNum=excLnNum+1;
|
||||||
end
|
end
|
||||||
|
|
||||||
while (~isequal(txt{excLnNum,4},'###'))
|
while (~isequal(txt{excLnNum,4},'###'))
|
||||||
medCnt=medCnt+1;
|
medCnt=medCnt+1;
|
||||||
DM.media(medCnt) = {raw(excLnNum,4)};
|
DM.media(medCnt) = {raw(excLnNum,4)};
|
||||||
excLnNum=excLnNum+1;
|
excLnNum=excLnNum+1;
|
||||||
end
|
end
|
||||||
else %else if not PC (Then linux or other)
|
else %else if not PC (Then linux or other)
|
||||||
excLnNum=1;
|
excLnNum=1;
|
||||||
while (~isequal(DMcell{excLnNum+1,2},'###'))
|
while (~isequal(DMcell{excLnNum+1,2},'###'))
|
||||||
drgCnt=drgCnt+1;
|
drgCnt=drgCnt+1;
|
||||||
DM.drug(drgCnt) = {DMtbl(excLnNum,2)};
|
DM.drug(drgCnt) = {DMtbl(excLnNum,2)};
|
||||||
DM.conc(drgCnt) = {DMtbl(excLnNum,3)};
|
DM.conc(drgCnt) = {DMtbl(excLnNum,3)};
|
||||||
excLnNum=excLnNum+1;
|
excLnNum=excLnNum+1;
|
||||||
end
|
end
|
||||||
|
|
||||||
while (~isequal(DMcel{excLnNum+1,4},'###'))
|
while (~isequal(DMcel{excLnNum+1,4},'###'))
|
||||||
medCnt=medCnt+1;
|
medCnt=medCnt+1;
|
||||||
DM.media(medCnt) = {DMtbl(excLnNum,4)};
|
DM.media(medCnt) = {DMtbl(excLnNum,4)};
|
||||||
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');
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ function output_txt = datatipp(~,event_obj)
|
|||||||
% obj Currently not used (empty)
|
% obj Currently not used (empty)
|
||||||
% event_obj Handle to event object
|
% event_obj Handle to event object
|
||||||
% output_txt Data cursor text string (string or cell array of strings).
|
% output_txt Data cursor text string (string or cell array of strings).
|
||||||
pos=get(event_obj,'Position');
|
pos=get(event_obj,'Position');
|
||||||
output_txt={['X: ',num2str(pos(1),4)],['Y: ',num2str(pos(2),4)]};
|
output_txt={['X: ',num2str(pos(1),4)],['Y: ',num2str(pos(2),4)]};
|
||||||
|
|
||||||
% If there is a Z-coordinate in the position, display it as well
|
% If there is a Z-coordinate in the position, display it as well
|
||||||
if length(pos) > 2
|
if length(pos) > 2
|
||||||
output_txt{end+1}=['Z: ',num2str(pos(3),4)];
|
output_txt{end+1}=['Z: ',num2str(pos(3),4)];
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user