DMPexcel2mat.m refactor
This commit is contained in:
@@ -90,8 +90,8 @@ end
|
|||||||
% The input files should be csv, not xlsx
|
% The input files should be csv, not xlsx
|
||||||
% This whole file could be much better and more portable
|
% This whole file could be much better and more portable
|
||||||
if ispc
|
if ispc
|
||||||
[num, txt, raw] = xlsread(masterPlateFile); %,'Yor1HitsMPsetFinal');
|
[num, txt, raw]=xlsread(masterPlateFile); %,'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(masterPlateFile);
|
opts=detectImportOptions(masterPlateFile);
|
||||||
@@ -186,7 +186,7 @@ if ~exist(drugMediaFile, 'file') || isempty(drugMediaFile)
|
|||||||
disp(strcat('Using matching DrugMedia file: ', drugMediaFile, ', skipping directory selection'));
|
disp(strcat('Using matching DrugMedia file: ', drugMediaFile, ', skipping directory selection'));
|
||||||
else
|
else
|
||||||
% Try to find the DrugMedia file automatically (newest created first)
|
% Try to find the DrugMedia file automatically (newest created first)
|
||||||
files=dir(matDir)
|
files=dir(matDir);
|
||||||
dmFiles={files(strncmp(files.name, 'DrugMedia_', 10)).name};
|
dmFiles={files(strncmp(files.name, 'DrugMedia_', 10)).name};
|
||||||
if isempty(dmFiles)
|
if isempty(dmFiles)
|
||||||
throw (MException('MATLAB:dir', 'No DrugMedia_ files in directory'));
|
throw (MException('MATLAB:dir', 'No DrugMedia_ files in directory'));
|
||||||
@@ -210,7 +210,7 @@ if ~exist(drugMediaFile, 'file') || isempty(drugMediaFile)
|
|||||||
questdlg('Select DrugMedia directory','Directory Selection','OK',...
|
questdlg('Select DrugMedia directory','Directory Selection','OK',...
|
||||||
struct('Default','OK','Interpreter','tex'))
|
struct('Default','OK','Interpreter','tex'))
|
||||||
dirToScan=uigetdir();
|
dirToScan=uigetdir();
|
||||||
files=dir(dirToScan)
|
files=dir(dirToScan);
|
||||||
dmFiles={files(strncmp(files.name, 'DrugMedia_', 10)).name};
|
dmFiles={files(strncmp(files.name, 'DrugMedia_', 10)).name};
|
||||||
if isempty(dmFiles)
|
if isempty(dmFiles)
|
||||||
throw (MException('MATLAB:dir', 'No DrugMedia_ files in directory'));
|
throw (MException('MATLAB:dir', 'No DrugMedia_ files in directory'));
|
||||||
@@ -220,11 +220,10 @@ if ~exist(drugMediaFile, 'file') || isempty(drugMediaFile)
|
|||||||
sortedFiles=dmFiles{sortedIndices};
|
sortedFiles=dmFiles{sortedIndices};
|
||||||
drugMediaFile=sortedFiles{1};
|
drugMediaFile=sortedFiles{1};
|
||||||
catch ME
|
catch ME
|
||||||
h = msgbox(ME.message, 'Error', 'error');
|
h=msgbox(ME.message, 'Error', 'error');
|
||||||
uiwait(h);
|
uiwait(h);
|
||||||
disp('Rerunning directory selection')
|
disp('Rerunning directory selection');
|
||||||
% I don't know what else we'll need to do here
|
% I don't know what else we'll need to do here
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user