1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- % Get the files used by each script to export minimal repository for
- % publication
- files = mfilename('fullpath')
- mainDir = 'W:\lramos\Documents\MATLAB\shako-copy\Luis\Papers\Tm9RFs\';
- files = dir([mainDir '*.m'])
- for iFile = 1: numel(files)
- fList{iFile} = matlab.codetools.requiredFilesAndProducts(...
- fullfile(files(iFile).folder, ...
- files(iFile).name));
- end
- %%
- minimalCodeBase = unique([fList{:}])';
- %%
- minimalCodeDir = [mainDir 'minimalCodeBase'];
- if ~exist(minimalCodeDir, 'dir'); mkdir(minimalCodeDir); end
- plottingSubDir = [minimalCodeDir filesep 'plotting'];
- if ~exist(plottingSubDir, 'dir'); mkdir(plottingSubDir); end
- paperSubDir = [minimalCodeDir filesep 'figures'];
- if ~exist(paperSubDir, 'dir'); mkdir(paperSubDir); end
- rfSubDir = [minimalCodeDir filesep 'receptiveFields'];
- if ~exist(rfSubDir, 'dir'); mkdir(rfSubDir); end
- ffSubDir = [minimalCodeDir filesep 'fullfield'];
- if ~exist(ffSubDir, 'dir'); mkdir(ffSubDir); end
- utilsSubDir = [minimalCodeDir filesep 'utils'];
- if ~exist(utilsSubDir, 'dir'); mkdir(utilsSubDir); end
- statsSubDir = [minimalCodeDir filesep 'stats'];
- if ~exist(statsSubDir, 'dir'); mkdir(statsSubDir); end
- %%
- orphanFiles = {};
- for iFile = 1: numel(minimalCodeBase)
- [~, fileName, fileExt] = fileparts(minimalCodeBase{iFile});
- if contains(minimalCodeBase{iFile}, ...
- ["Plotting", "plotErrorPatch", "suptitle"])
- copyfile(minimalCodeBase{iFile}, ...
- fullfile(plottingSubDir, [fileName fileExt]));
- elseif contains(minimalCodeBase{iFile}, 'OnOffAnalysis')
- copyfile(minimalCodeBase{iFile}, ...
- fullfile(ffSubDir, [fileName fileExt]));
- elseif contains(minimalCodeBase{iFile}, ...
- ["BarsReceptiveFields", "GluCla", "IndependentRFs", ...
- "Noise", "T4T5_Tm9"])
- copyfile(minimalCodeBase{iFile}, ...
- fullfile(rfSubDir, [fileName fileExt]));
- elseif contains(minimalCodeBase{iFile}, ...
- ["TableAnalysis", "Stimulus_Analysis", ...
- "createRFsTable", "parseDatasetVars"])
- copyfile(minimalCodeBase{iFile}, ...
- fullfile(utilsSubDir, [fileName fileExt]));
- elseif contains(minimalCodeBase{iFile}, ["Make"])
- copyfile(minimalCodeBase{iFile}, ...
- fullfile(paperSubDir, [fileName fileExt]));
- elseif contains(minimalCodeBase{iFile}, ["permutation"], 'IgnoreCase', true)
- copyfile(minimalCodeBase{iFile}, ...
- fullfile(statsSubDir, [fileName fileExt]));
- elseif contains(minimalCodeBase{iFile}, ["dependencymapping"], 'IgnoreCase', true)
- copyfile(minimalCodeBase{iFile}, ...
- fullfile(statsSubDir, [fileName fileExt]));
- else
- copyfile(minimalCodeBase{iFile}, ...
- fullfile(utilsSubDir, [fileName fileExt]));
- end
- end
|