-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTomato_2015.py
44 lines (29 loc) · 1.75 KB
/
Tomato_2015.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import os
import cobra
from tests import TEST_DIR
import pandas as pd
from diel_models.diel_models_creator import diel_models_creator
def diel_model(model):
diel_models_creator(model, ["x_Starch"], ['EX_x_Photon'], ['EX_x_NO3'], 'biomass_reaction')
model.reactions.get_by_id("EX_x_CO2_Day").bounds = (-1000000, 0)
model.reactions.get_by_id("EX_x_CO2_Night").bounds = (0, 1000000)
model.reactions.get_by_id("EX_x_O2_Day").bounds = (0, 1000000)
model.reactions.get_by_id("EX_x_O2_Night").bounds = (-1000000, 0)
model.reactions.get_by_id("EX_x_SUCROSE_Day").bounds = (0, 1000000)
model.reactions.get_by_id("EX_x_SUCROSE_Night").bounds = (0, 1000000)
model.reactions.get_by_id("EX_x_Cellulose_Day").bounds = (0, 1000000)
model.reactions.get_by_id("EX_x_Cellulose_Night").bounds = (0, 1000000)
model.reactions.get_by_id("Starch_bm_tx_Day").bounds = (-1000000, 0)
model.reactions.get_by_id("Starch_bm_tx_Night").bounds = (0, 1000000)
model.reactions.get_by_id("EX_x_UMP_Day").bounds = (0, 1000000)
model.reactions.get_by_id("EX_x_UMP_Night").bounds = (0, 0)
model.reactions.get_by_id("EX_x_Starch_Day").bounds = (-1000000, 0)
model.reactions.get_by_id("EX_x_Starch_Night").bounds = (0, 1000000)
df = pd.read_excel(os.path.join(TEST_DIR, 'data', 'Photoautotrophic conditions.xlsx'))
for reaction in df.iterrows():
model.reactions.get_by_id(reaction[1]['Reaction']).bounds = (reaction[1]['lb'], reaction[1]['ub'])
cobra.io.write_sbml_model(model, os.path.join(TEST_DIR, 'data', 'diel_tomato_model.xml'))
if __name__ == '__main__':
tomato_model_path = os.path.join(TEST_DIR, 'data', 'functional_tomato_model.xml')
tomato_model = cobra.io.read_sbml_model(tomato_model_path)
diel_model(tomato_model)