コード例 #1
0
    def test_dict_with_predecessors(self):
        model = map_iJR904()

        solver = RepresentationRedundantCaseSolver(model, "BiGG")
        res = solver.get_targets_to_replace_by_type(300374)

        print()
コード例 #2
0
    def test_identification_of_biosynthesis_pathway_ecoli(self):
        model = map_iJR904()

        solver = RepresentationRedundantCaseSolver(model, "BiGG")

        reactions, other = solver.identify_biosynthesis_pathway(12)

        assert len(reactions) == 10
コード例 #3
0
def redundant_granulator_ecoli():
    model = map_iJR904()

    components = ["cpd00214", "cpd01080", "cpd03847", "cpd05274"]

    solver = RepresentationRedundantCaseSolver(model, "BiGG")

    solver.swap_from_generic(["cpd22513", "cpd15649"], components, True, True)

    cobra.io.write_sbml_model(solver.model,
                              "enhanced_model_ecoli_latest_version.xml")
    cobra.io.save_json_model(solver.model, "enhanced_model_ecoli.json")
コード例 #4
0
def redundant_granulator_ecoli_all():
    start = time.time()
    model = map_iJR904()

    components = ["cpd00214", "cpd01080", "cpd03847", "cpd05274"]

    solver = RepresentationRedundantCaseSolver(model, "BiGG")

    solver.swap_from_generic(["cpd22513", "cpd15649"], components, False, True)

    cobra.io.write_sbml_model(solver.model, "enhanced_model_ecoli_all.xml")
    cobra.io.save_json_model(solver.model, "enhanced_model_ecoli_all.json")

    end = time.time()

    print("time")
    print(end - start)
コード例 #5
0
    def test_algae_model(self):
        model = cobra.io.read_sbml_model("../models/cvulgaris.xml")

        model.objective = model.reactions.get_by_id("e_Biomass__cytop")

        r_acyl = model.reactions.get_by_id("e_Fatty_acid__cytop")
        reactants = r_acyl.reactants

        components_list = []
        for reactant in reactants:

            if "kegg.compound" in reactant.annotation:
                compound = reactant.annotation.get("kegg.compound")
                components_list.append(compound)

        ### confirmar se há alguma reação com fatty acid

        solver = RepresentationRedundantCaseSolver(model, "KEGG")

        # components = ["lgnc","arach","C06427","clpnd"]

        solver.swap_from_generic(["C00422", "C06037"], components_list, True)

        cobra.io.write_sbml_model(model, "very_nice_algae_model.xml")
コード例 #6
0
def redundant_granulator_ecoli_without_components_isa_reactions_for_all():
    model = map_iJR904()

    components = ["cpd00214", "cpd03847", "cpd05274", "cpd25615", "cpd05237"]

    solver = RepresentationRedundantCaseSolver(model, "BiGG")

    solver.swap_from_generic(["cpd22513", "cpd15649"], components, True)
    solver.generateTestISAreactions()

    cobra.io.write_sbml_model(
        solver.model,
        "enhanced_model_ecoli_without_components_isa_reactions_for_all.xml")
    cobra.io.save_json_model(solver.model, "enhanced_model_ecoli.json")
コード例 #7
0
    def test_components_reactions_solver(self):
        model = map_iJR904()

        solver = RepresentationRedundantCaseSolver(model, "BiGG")

        solver.solve_components_reactions(True)