Skip to content

Commit 3d3f67f

Browse files
committed
Merge branch 'main' of https://github.com/cshenry/ModelSEEDpy into main
# Conflicts: # modelseedpy/core/mseditorapi.py
2 parents 7c1d107 + 74ee6e4 commit 3d3f67f

File tree

3 files changed

+252
-117
lines changed

3 files changed

+252
-117
lines changed

examples/build_metabolic_model.ipynb

Lines changed: 137 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"outputs": [],
88
"source": [
99
"import modelseedpy\n",
10-
"from modelseedpy.core.msgenome import MSGenome\n",
11-
"from modelseedpy.core.msbuilder import build_metabolic_model"
10+
"from modelseedpy import MSBuilder, MSGenome"
1211
]
1312
},
1413
{
@@ -62,7 +61,7 @@
6261
"metadata": {},
6362
"outputs": [],
6463
"source": [
65-
"model = build_metabolic_model('ecoli.core', genome, core_template, allow_all_non_grp_reactions=True)"
64+
"model = MSBuilder.build_metabolic_model('ecoli.core', genome, core_template, allow_all_non_grp_reactions=True)"
6665
]
6766
},
6867
{
@@ -80,7 +79,7 @@
8079
" <td>ecoli.core</td>\n",
8180
" </tr><tr>\n",
8281
" <td><strong>Memory address</strong></td>\n",
83-
" <td>0x07feb71fa6510</td>\n",
82+
" <td>0x07faf31a00190</td>\n",
8483
" </tr><tr>\n",
8584
" <td><strong>Number of metabolites</strong></td>\n",
8685
" <td>190</td>\n",
@@ -92,15 +91,15 @@
9291
" <td>0</td>\n",
9392
" </tr><tr>\n",
9493
" <td><strong>Objective expression</strong></td>\n",
95-
" <td>0</td>\n",
94+
" <td>1.0*bio1 - 1.0*bio1_reverse_b18f7</td>\n",
9695
" </tr><tr>\n",
9796
" <td><strong>Compartments</strong></td>\n",
9897
" <td>c0, e0</td>\n",
9998
" </tr>\n",
10099
" </table>"
101100
],
102101
"text/plain": [
103-
"<Model ecoli.core at 0x7feb71fa6510>"
102+
"<Model ecoli.core at 0x7faf31a00190>"
104103
]
105104
},
106105
"execution_count": 6,
@@ -113,15 +112,15 @@
113112
]
114113
},
115114
{
116-
"cell_type": "markdown",
115+
"cell_type": "code",
116+
"execution_count": null,
117117
"metadata": {},
118-
"source": [
119-
"### TODO: add biomass/exchanges"
120-
]
118+
"outputs": [],
119+
"source": []
121120
},
122121
{
123122
"cell_type": "code",
124-
"execution_count": 16,
123+
"execution_count": 7,
125124
"metadata": {},
126125
"outputs": [],
127126
"source": [
@@ -130,7 +129,7 @@
130129
},
131130
{
132131
"cell_type": "code",
133-
"execution_count": 25,
132+
"execution_count": 8,
134133
"metadata": {},
135134
"outputs": [],
136135
"source": [
@@ -152,7 +151,7 @@
152151
},
153152
{
154153
"cell_type": "code",
155-
"execution_count": 26,
154+
"execution_count": 9,
156155
"metadata": {},
157156
"outputs": [
158157
{
@@ -227,10 +226,10 @@
227226
"</table>"
228227
],
229228
"text/plain": [
230-
"<cobra.summary.model_summary.ModelSummary at 0x7feb84437490>"
229+
"<cobra.summary.model_summary.ModelSummary at 0x7faf4344bd90>"
231230
]
232231
},
233-
"execution_count": 26,
232+
"execution_count": 9,
234233
"metadata": {},
235234
"output_type": "execute_result"
236235
}
@@ -241,7 +240,119 @@
241240
},
242241
{
243242
"cell_type": "code",
244-
"execution_count": 7,
243+
"execution_count": 17,
244+
"metadata": {},
245+
"outputs": [
246+
{
247+
"data": {
248+
"text/html": [
249+
"<h3>Objective</h3><p>1.0 bio1 = 0.1229368143626848</p><h4>Uptake</h4><table border=\"1\" class=\"dataframe\">\n",
250+
" <thead>\n",
251+
" <tr style=\"text-align: right;\">\n",
252+
" <th>Metabolite</th>\n",
253+
" <th>Reaction</th>\n",
254+
" <th>Flux</th>\n",
255+
" <th>C-Number</th>\n",
256+
" <th>C-Flux</th>\n",
257+
" </tr>\n",
258+
" </thead>\n",
259+
" <tbody>\n",
260+
" <tr>\n",
261+
" <td>cpd00007_e0</td>\n",
262+
" <td>EX_cpd00007_e0</td>\n",
263+
" <td>1.371</td>\n",
264+
" <td>0</td>\n",
265+
" <td>0.00%</td>\n",
266+
" </tr>\n",
267+
" <tr>\n",
268+
" <td>cpd00009_e0</td>\n",
269+
" <td>EX_cpd00009_e0</td>\n",
270+
" <td>0.5182</td>\n",
271+
" <td>0</td>\n",
272+
" <td>0.00%</td>\n",
273+
" </tr>\n",
274+
" <tr>\n",
275+
" <td>cpd00027_e0</td>\n",
276+
" <td>EX_cpd00027_e0</td>\n",
277+
" <td>1</td>\n",
278+
" <td>6</td>\n",
279+
" <td>100.00%</td>\n",
280+
" </tr>\n",
281+
" </tbody>\n",
282+
"</table><h4>Secretion</h4><table border=\"1\" class=\"dataframe\">\n",
283+
" <thead>\n",
284+
" <tr style=\"text-align: right;\">\n",
285+
" <th>Metabolite</th>\n",
286+
" <th>Reaction</th>\n",
287+
" <th>Flux</th>\n",
288+
" <th>C-Number</th>\n",
289+
" <th>C-Flux</th>\n",
290+
" </tr>\n",
291+
" </thead>\n",
292+
" <tbody>\n",
293+
" <tr>\n",
294+
" <td>cpd00001_e0</td>\n",
295+
" <td>EX_cpd00001_e0</td>\n",
296+
" <td>-2.812</td>\n",
297+
" <td>0</td>\n",
298+
" <td>0.00%</td>\n",
299+
" </tr>\n",
300+
" <tr>\n",
301+
" <td>cpd00011_e0</td>\n",
302+
" <td>EX_cpd00011_e0</td>\n",
303+
" <td>-0.5044</td>\n",
304+
" <td>1</td>\n",
305+
" <td>100.00%</td>\n",
306+
" </tr>\n",
307+
" <tr>\n",
308+
" <td>cpd00067_e0</td>\n",
309+
" <td>EX_cpd00067_e0</td>\n",
310+
" <td>-1.749</td>\n",
311+
" <td>0</td>\n",
312+
" <td>0.00%</td>\n",
313+
" </tr>\n",
314+
" <tr>\n",
315+
" <td>cpd11416_c0</td>\n",
316+
" <td>SK_cpd11416_c0</td>\n",
317+
" <td>-0.1229</td>\n",
318+
" <td>0</td>\n",
319+
" <td>0.00%</td>\n",
320+
" </tr>\n",
321+
" </tbody>\n",
322+
"</table>"
323+
],
324+
"text/plain": [
325+
"<cobra.summary.model_summary.ModelSummary at 0x7faf31083d10>"
326+
]
327+
},
328+
"execution_count": 17,
329+
"metadata": {},
330+
"output_type": "execute_result"
331+
}
332+
],
333+
"source": [
334+
"model.objective = 'bio1'\n",
335+
"model.medium = {\n",
336+
" 'EX_cpd00067_e0': 1000,\n",
337+
" 'EX_cpd00027_e0': 1,\n",
338+
" 'EX_cpd00007_e0': 1000,\n",
339+
" 'EX_cpd00001_e0': 1000,\n",
340+
" 'EX_cpd00009_e0': 1000,\n",
341+
" \n",
342+
"}\n",
343+
"model.summary()"
344+
]
345+
},
346+
{
347+
"cell_type": "code",
348+
"execution_count": null,
349+
"metadata": {},
350+
"outputs": [],
351+
"source": []
352+
},
353+
{
354+
"cell_type": "code",
355+
"execution_count": 10,
245356
"metadata": {},
246357
"outputs": [],
247358
"source": [
@@ -251,7 +362,7 @@
251362
},
252363
{
253364
"cell_type": "code",
254-
"execution_count": 8,
365+
"execution_count": 11,
255366
"metadata": {},
256367
"outputs": [
257368
{
@@ -271,7 +382,7 @@
271382
},
272383
{
273384
"cell_type": "code",
274-
"execution_count": 9,
385+
"execution_count": 12,
275386
"metadata": {},
276387
"outputs": [
277388
{
@@ -284,7 +395,7 @@
284395
" <td>GCF_000005845.2.RAST.mdl</td>\n",
285396
" </tr><tr>\n",
286397
" <td><strong>Memory address</strong></td>\n",
287-
" <td>0x07feb922dea90</td>\n",
398+
" <td>0x07fa6819dee50</td>\n",
288399
" </tr><tr>\n",
289400
" <td><strong>Number of metabolites</strong></td>\n",
290401
" <td>190</td>\n",
@@ -304,10 +415,10 @@
304415
" </table>"
305416
],
306417
"text/plain": [
307-
"<FBAModel GCF_000005845.2.RAST.mdl at 0x7feb922dea90>"
418+
"<FBAModel GCF_000005845.2.RAST.mdl at 0x7fa6819dee50>"
308419
]
309420
},
310-
"execution_count": 9,
421+
"execution_count": 12,
311422
"metadata": {},
312423
"output_type": "execute_result"
313424
}
@@ -318,7 +429,7 @@
318429
},
319430
{
320431
"cell_type": "code",
321-
"execution_count": 10,
432+
"execution_count": 13,
322433
"metadata": {},
323434
"outputs": [],
324435
"source": [
@@ -328,7 +439,7 @@
328439
},
329440
{
330441
"cell_type": "code",
331-
"execution_count": 11,
442+
"execution_count": 14,
332443
"metadata": {},
333444
"outputs": [
334445
{
@@ -337,7 +448,7 @@
337448
"set()"
338449
]
339450
},
340-
"execution_count": 11,
451+
"execution_count": 14,
341452
"metadata": {},
342453
"output_type": "execute_result"
343454
}
@@ -348,7 +459,7 @@
348459
},
349460
{
350461
"cell_type": "code",
351-
"execution_count": 12,
462+
"execution_count": 15,
352463
"metadata": {},
353464
"outputs": [
354465
{
@@ -357,7 +468,7 @@
357468
"set()"
358469
]
359470
},
360-
"execution_count": 12,
471+
"execution_count": 15,
361472
"metadata": {},
362473
"output_type": "execute_result"
363474
}

0 commit comments

Comments
 (0)