From 5dc6021582378624662716b2f6e148c3a17f242c Mon Sep 17 00:00:00 2001 From: Bryan Roessler Date: Sat, 27 Jul 2024 01:26:58 -0400 Subject: [PATCH] DMPexcel2mat.m refactor --- workflow/templates/easy/DMPexcel2mat.m | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/workflow/templates/easy/DMPexcel2mat.m b/workflow/templates/easy/DMPexcel2mat.m index 9502ce4d..7da63863 100755 --- a/workflow/templates/easy/DMPexcel2mat.m +++ b/workflow/templates/easy/DMPexcel2mat.m @@ -90,8 +90,8 @@ end % The input files should be csv, not xlsx % This whole file could be much better and more portable if ispc - [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 + [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 else clear MPtbl opts=detectImportOptions(masterPlateFile); @@ -186,7 +186,7 @@ if ~exist(drugMediaFile, 'file') || isempty(drugMediaFile) disp(strcat('Using matching DrugMedia file: ', drugMediaFile, ', skipping directory selection')); else % Try to find the DrugMedia file automatically (newest created first) - files=dir(matDir) + files=dir(matDir); dmFiles={files(strncmp(files.name, 'DrugMedia_', 10)).name}; if isempty(dmFiles) 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',... struct('Default','OK','Interpreter','tex')) dirToScan=uigetdir(); - files=dir(dirToScan) + files=dir(dirToScan); dmFiles={files(strncmp(files.name, 'DrugMedia_', 10)).name}; if isempty(dmFiles) throw (MException('MATLAB:dir', 'No DrugMedia_ files in directory')); @@ -220,11 +220,10 @@ if ~exist(drugMediaFile, 'file') || isempty(drugMediaFile) sortedFiles=dmFiles{sortedIndices}; drugMediaFile=sortedFiles{1}; catch ME - h = msgbox(ME.message, 'Error', 'error'); + h=msgbox(ME.message, 'Error', 'error'); uiwait(h); - disp('Rerunning directory selection') + disp('Rerunning directory selection'); % I don't know what else we'll need to do here - end end end end