Beispiel #1
0
    def test_production_envelope_with_constraints(self):
        r_target = 'R_EX_ac_e'
        r_biomass = ec_core_model.detect_biomass_reaction()

        xvals0, ymins0, ymaxs0 = production_envelope(ec_core_model, r_target, steps=5,
                                                     constraints={'R_EX_o2_e': (0, 0)})

        ec_core_model.bounds['R_EX_o2_e'] = (0, 0)
        xvals1, ymins1, ymaxs1 = production_envelope(ec_core_model, r_target, steps=5)

        self.assertEqual(xvals0, xvals1)
        self.assertEqual(ymins0, ymins1)
        self.assertEqual(ymaxs0, ymaxs1)
Beispiel #2
0
    def test_production_envelope(self):
        r_target = 'R_EX_ac_e'
        r_biomass = ec_core_model.detect_biomass_reaction()

        xvals0, ymins0, ymaxs0 = production_envelope(ec_core_model, r_target, steps=5)
        xvals1, ymins1, ymaxs1 = flux_envelope(ec_core_model, r_x=r_biomass, r_y=r_target, steps=5)

        self.assertEqual(xvals0, xvals1)
        self.assertEqual(ymins0, ymins1)
        self.assertEqual(ymaxs0, ymaxs1)
Beispiel #3
0
Example: Flux Envelope Analysis

@Author: Kai Zhuang
"""
__author__ = 'kaizhuang'

from framed.analysis.variability import production_envelope, flux_envelope
from framed.io_utils.sbml import load_sbml_model, CONSTRAINT_BASED
from framed.core.fixes import fix_bigg_model

import matplotlib.pyplot as plt

### Basic Setup
SMALL_TEST_MODEL = 'models/ecoli_core_model.xml'
ec_core_model = load_sbml_model(SMALL_TEST_MODEL, kind=CONSTRAINT_BASED)
fix_bigg_model(ec_core_model)


### Make the production envelope, and plot it
biomass, target_mins2, target_maxs2 = production_envelope(ec_core_model, 'R_EX_ac_e', steps=10, constraints={'R_EX_o2_e': (0, 0)})

print target_maxs2

plt.figure(1)
plt.hold(True)
plt.plot(biomass, target_maxs2)
plt.plot(biomass, target_mins2)
plt.ylim(ymin=-0.1)
plt.show()