def build_model(): m = SolverBasedModel("Blazier et al 2012") m1_e = Metabolite("M1_e") m1 = Metabolite("M1") m2 = Metabolite("M2") m3 = Metabolite("M3") m4_e = Metabolite("M4_e") m4 = Metabolite("M4") m5 = Metabolite("M5") r1 = Reaction("R1") r1.add_metabolites({m1_e: -1, m1: 1}) r2 = Reaction("R2") r2.add_metabolites({m1: -1, m2: 1}) r2.gene_reaction_rule = "Gene2" r3 = Reaction("R3") r3.add_metabolites({m2: -1, m3: 1}) r3.gene_reaction_rule = "Gene3" r4 = Reaction("R4") r4.add_metabolites({m3: -1}) r5 = Reaction("R5") r5.add_metabolites({m4_e: -1, m4: 1}) r6 = Reaction("R6") r6.add_metabolites({m4: -1, m5: 1}) r6.gene_reaction_rule = "Gene6" r7 = Reaction("R7") r7.add_metabolites({m5: -1, m2: 1}) r7.lower_bound = -r7.upper_bound r7.gene_reaction_rule = "Gene7" r8 = Reaction("R8") r8.add_metabolites({m5: -1}) m.add_reactions([r1, r2, r3, r4, r5, r6, r7, r8]) EX_M1_e = m.add_demand(m1_e, "EX_") EX_M1_e.lower_bound = -10 EX_M4_e = m.add_demand(m4_e, "EX_") EX_M4_e.lower_bound = -10 m.objective = r4 return m
def build_model(): m = SolverBasedModel("Zur et al 2012") m1 = Metabolite("M1") m2 = Metabolite("M2") m3 = Metabolite("M3") m4 = Metabolite("M4") m5 = Metabolite("M5") m6 = Metabolite("M6") m7 = Metabolite("M7") m8 = Metabolite("M8") m9 = Metabolite("M9") m10 = Metabolite("M10") r1 = Reaction("R1") r1.add_metabolites({m3: 1}) r2 = Reaction("R2") r2.add_metabolites({m1: 1}) r2.gene_reaction_rule = "G1 or G2" r3 = Reaction("R3") r3.add_metabolites({m2: 1}) r3.gene_reaction_rule = "G5" r4 = Reaction("R4") r4.add_metabolites({m1: -1, m10: 1}) r4.lower_bound = -r4.upper_bound r5 = Reaction("R5") r5.add_metabolites({m10: -1, m4: 1}) r5.lower_bound = -r5.upper_bound r6 = Reaction("R6") r6.add_metabolites({m1: -1, m4: 1}) r7 = Reaction("R7") r7.add_metabolites({m1: -1, m2: -1, m5: 1, m6: 1}) r7.gene_reaction_rule = "G6" r8 = Reaction("R8") r8.add_metabolites({m3: -1, m4: -1, m7: 1, m8: 1}) r8.gene_reaction_rule = "G3" r9 = Reaction("R9") r9.add_metabolites({m5: -1}) r10 = Reaction("R10") r10.add_metabolites({m6: -1, m9: 1}) r10.gene_reaction_rule = "G7" r11 = Reaction("R11") r11.add_metabolites({m7: -1}) r12 = Reaction("R12") r12.add_metabolites({m8: -1}) r12.gene_reaction_rule = "G4" r13 = Reaction("R13") r13.add_metabolites({m9: -1}) m.add_reactions([r1, r2, r3, r4, r5, r6, r7, r8]) m.objective = r4 return m