These are chat archives for opencobra/cobrapy

Jul 2017
Bhushan Dhamale
Jul 13 2017 12:26

Guys, I need a little help here.

I've been attempting to delete a reaction, and then get flux value through the objective function Biomass_Ecoli_core by FBA and pFBA. However I am not able to obtain the correct value for pFBA.
This is what I do

print ("Model: ", model.optimize().objective_value) 
with model:
    print ("\nKnocking out PFK reaction......")
    print ("Objective value by FBA: ", model.optimize().objective_value)
    print ("Objective value by pFBA: ", pfba_solution["Biomass_Ecoli_core"])

and I get

Model:  0.8739215069684296

Knocking out PFK reaction......
Objective value by FBA:  0.7040369478590217
Objective value by pFBA:  0.873921506968

What am I doing wrong?

Moritz E. Beber
Jul 13 2017 12:28
pfba_solution seems to be an old solution stored before knocking out the reaction. You need to re-compute pFBA inside the context.