def testRun(self): model = load_sbml_model(SMALL_TEST_MODEL, kind=GPR_CONSTRAINED) fix_bigg_model(model) make_irreversible(model) self.assertTrue(all([not reaction.reversible for reaction in model.reactions.values()])) solution = FBA(model) self.assertEqual(solution.status, Status.OPTIMAL) self.assertAlmostEqual(solution.fobj, GROWTH_RATE, places=2)
def transform(model, inplace=True): if not inplace: model = model.copy() mapping_rev = make_irreversible(model) mapping_iso = split_isozymes(model) u_reactions = genes_to_species(model) model.convert_fluxes = lambda x, net=True: merge_fluxes(x, mapping_rev, mapping_iso, net) model.convert_constraints = lambda x: convert_constraints(x, mapping_rev, mapping_iso) return model
def testRun(self): model = load_sbml_model(SMALL_TEST_MODEL, kind=GPR_CONSTRAINED) fix_bigg_model(model) simplify(model) make_irreversible(model) simplify(model) #remove directionally blocked reactions model2 = load_sbml_model(SMALL_TEST_MODEL, kind=GPR_CONSTRAINED) fix_bigg_model(model2) make_irreversible(model2) simplify(model2) self.assertEqual(model.id, model2.id) self.assertListEqual(model.metabolites.keys(), model2.metabolites.keys()) self.assertListEqual(model.reactions.keys(), model2.reactions.keys()) self.assertDictEqual(model.stoichiometry, model2.stoichiometry) self.assertDictEqual(model.bounds, model2.bounds) self.assertListEqual(model.genes.keys(), model2.genes.keys()) self.assertDictEqual(model.rules, model2.rules)
def transform(model, inplace=True): if not inplace: model = model.copy() mapping_rev = make_irreversible(model) mapping_iso = split_isozymes(model) u_reactions = genes_to_species(model) model.convert_fluxes = lambda x, net=True: merge_fluxes( x, mapping_rev, mapping_iso, net) model.convert_constraints = lambda x: convert_constraints( x, mapping_rev, mapping_iso) return model