Skip to content

Commit 67c9e1c

Browse files
committed
fix: avoid cd within main enhance_cellLine script
1 parent 3e10f02 commit 67c9e1c

File tree

1 file changed

+15
-25
lines changed

1 file changed

+15
-25
lines changed
Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function [ecModel,ecModel_batch] = enhanceGEM_cellLine(cellName)
1+
function [ecModel,ecModel_batch] = enhanceGEM_cellLine(cellName,GECKO_path)
22
%enhanceGEM_cellLine
33
%
44
% Function that loads a cell-line or tissue specific human metabolism model
@@ -16,50 +16,40 @@
1616
%
1717
% Usage: [ecModel,ecModel_batch] = enhanceGEM_cellLine(cellName)
1818
%
19-
% Ivan Domenzain. Last edited: 2019-05-15
19+
% Ivan Domenzain. Last edited: 2019-11-20
2020

2121
current = pwd;
2222
org_name = 'homo sapiens';
2323
%Load original model
24-
model = load(['../models/' cellName '/' cellName '.mat']);
24+
model = load(['../models/' cellName '/' cellName '.mat']);
2525
eval(['model = model.' cellName])
26-
%model = model.model;
27-
%%%%%%%%%%%%%%%%%%%%%%%% model preprocessing %%%%%%%%%%%%%%%%%%%%%%%%%%
28-
%model_modified = ravenCobraWrapper(model);
26+
%% model preprocessing
2927
model_modified = modelModifications(model);
3028
% Save models
31-
cd (['../models/' cellName])
32-
save('model.mat','model')
33-
save('model_modified.mat','model_modified')
34-
%%%%%%%%%%%%%%%%%%%%%%%% GECKO modifications %%%%%%%%%%%%%%%%%%%%%%%%%%
29+
save(['../models/' cellName '/model.mat'],'model')
30+
save(['../models/' cellName '/model_modified.mat'],'model_modified')
31+
%% GECKO pipeline
3532
% Retrieve kcats & MWs for each rxn in the model from Uniprot database:
36-
cd ([GECKO_path '/geckomat/get_enzyme_data'])
33+
cd GECKO/geckomat/get_enzyme_data
3734
model_data = getEnzymeCodes(model_modified);
3835
%Tries to Match kinetic coefficients to every reaction with a non empty
3936
%grRule
4037
kcats = matchKcats(model_data,org_name);
4138
%Save ecModel data
42-
cd (current)
43-
cd (['../models/' cellName])
44-
mkdir Data
45-
cd Data
46-
save('enzData.mat','model_data','kcats');
47-
cd (current)
39+
newDir = ['../../../../models/' cellName '/Data'];
40+
mkdir(newDir)
41+
save([newDir '/enzData.mat'],'model_data','kcats');
4842
%GEt ecModel matlab structure
4943
model_data = removeFields(model_data);
50-
cd ([GECKO_path '/geckomat/change_model'])
44+
cd ../change_model
5145
ecModel = readKcatData(model_data,kcats);
5246
% Save output models:
53-
cd (current)
54-
cd (['../models/' cellName])
55-
save('ecModel.mat','ecModel')
56-
cd ([GECKO_path '/geckomat/limit_proteins'])
47+
save(['../../../../models/' cellName '/ecModel.mat'],'ecModel')
48+
cd ../limit_proteins
5749
% Constrain total protein pool
5850
Ptotal = 0.609; %HepG2 total protein content [g prot/gDw]
5951
protCoverage = 0.5;
6052
sigma = 0.5;
6153
[ecModel_batch,~,~] = constrainEnzymes(ecModel,Ptotal,sigma,protCoverage);
62-
cd (['../../../../models/' cellName])
63-
save('ecModel_batch.mat','ecModel_batch')
64-
cd (current)
54+
save(['../../../../models/' cellName '/ecModel_batch.mat'],'ecModel_batch')
6555
end

0 commit comments

Comments
 (0)