Skip to content

Commit d00a09d

Browse files
committed
feat: functions run from matlab path
1 parent c959be1 commit d00a09d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

code/otherChanges/fitGAM.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44

55
function model = fitGAM(model)
66

7+
funcDir = dbstack('-completenames');
8+
funcDir = regexprep(funcDir(1).file,[funcDir(1).name '\.m'],'')
9+
710
%Load chemostat data:
8-
fid = fopen('../../data/physiology/chemostatData_VanHoek1998.tsv','r');
11+
fid = fopen(fullfile(funcDir,'../../data/physiology/chemostatData_VanHoek1998.tsv','r'));
912
exp_data = textscan(fid,'%f32 %f32 %f32 %f32','Delimiter','\t','HeaderLines',1);
1013
exp_data = [exp_data{1} exp_data{2} exp_data{3} exp_data{4}];
1114
fclose(fid);

code/otherChanges/sumBioMass.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,19 @@
2323
dispOutput = true;
2424
end
2525

26+
funcDir = dbstack('-completenames');
27+
funcDir = regexprep(funcDir(1).file,[funcDir(1).name '\.m'],'')
28+
2629
%Load original biomass component MWs:
2730
%TODO: compute MW automatically from chemical formulas (check that all components have them first)
28-
fid = fopen('../../data/physiology/biomassComposition_Forster2003.tsv');
31+
fid = fopen(fullfile(funcDir,'../../data/physiology/biomassComposition_Forster2003.tsv'));
2932
Forster2003 = textscan(fid,'%s %s %f32 %f32 %s','Delimiter','\t','HeaderLines',1);
3033
data.mets = Forster2003{1};
3134
data.MWs = double(Forster2003{4});
3235
fclose(fid);
3336

3437
%load additional cofactor/ion MWs:
35-
fid = fopen('../../data/physiology/biomassComposition_Cofactor_Ion.tsv');
38+
fid = fopen(fullfile(funcDir,'../../data/physiology/biomassComposition_Cofactor_Ion.tsv'));
3639
CofactorsIons = textscan(fid,'%s %s %f32 %f32 %s %s','Delimiter','\t','HeaderLines',1);
3740
data_new.mets = CofactorsIons{1};
3841
data_new.MWs = double(CofactorsIons{4});

0 commit comments

Comments
 (0)