0001 function startGECKOproject(name, path)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 if nargin < 1 || isempty(name)
0017 prompt = {'Please provide a project name (e.g. ecYeastGEM)'};
0018 dlgtitle = 'Project name';
0019 dims = [1 100];
0020 definput = {'ecModelGEM'};
0021 opts.Interpreter = 'tex';
0022 name = inputdlg(prompt,dlgtitle,dims,definput,opts);
0023 name = char(name);
0024 end
0025
0026 if nargin < 2 || isempty(path)
0027 path = uigetdir('Project Folder path');
0028 end
0029
0030 fullPath = fullfile(path, name);
0031
0032 if ~exist(fullPath, 'dir')
0033
0034 dir = {'code', 'data', 'models', 'output'};
0035 for i = 1:length(dir)
0036 status = mkdir(fullPath, dir{i});
0037 fid = fopen(fullfile(fullPath, dir{i}, '.keep'), 'w');
0038 fclose(fid);
0039 end
0040
0041
0042 fid = fopen(fullfile(findGECKOroot, 'src', 'geckomat', ...
0043 'model_adapter', 'adapterTemplate.m'));
0044 f = fread(fid, '*char')';
0045 fclose(fid);
0046
0047
0048 f = strrep(f, 'KEY_CLASSNAME', [name 'Adapter']);
0049 f = strrep(f, 'KEY_PATH', path);
0050 f = strrep(f, 'KEY_NAME', name);
0051
0052
0053 filename = fullfile(path, name, [name 'Adapter.m']);
0054 fid = fopen(filename, 'w');
0055 fwrite(fid, f);
0056 fclose(fid);
0057 else
0058 printOrange('WARNING: A project with the same name exits at the same location. The project was not created.\n');
0059 end
0060 cd(fullPath)
0061 end