Closed cfrioux closed 1 year ago
What do you mean by unstable? Uniqueness in FBA is only guaranteed for the objective values, not for the variables/fluxes. There may be many possible flux solutions giving you the same objective value. You can run loopless FVA to investigate the possible spread in that particular reaction flux in the absence of cycles.
Yes I agree about the uniqueness but the reaction flux I am looking at is the objective value.
So sorry, should have read your code more carefully. Looks like there is a bug in loopless_solution where it does not constrain the objective when not passing in reference fluxes.
One thing to note is that the "fast" method will not remove fluxes from the objective itself.
The way I looked as the results with loopless.fluxes['GLCptspp']
could be misleading at first sight. It is because loopless.objective_value
gives values of 0, which is already documented in https://github.com/opencobra/cobrapy/issues/935.
Thanks for the explanation. So if I understand correctly, the "fast" method constrains the objective to have the nominal flux, and the other reactions fluxes will be modified by removing loops, while the exact Schellenberger implementation is likely to have a reduced objective value should no loopless solution permit the nominal flux?
Yes exactly. The CycleFreeFlux used in loopless_solution
algorithm essentially locks in the objective and all exchanges to its previous flux value, constrains the direction of internal fluxes to its previous direction, and then minimizes the absolute sum of internal fluxes.
Yep, exactly, the Schellenberger implementation adds in constraints that make loops infeasible. That will also apply to the objective. But it is really slow (can take hours for larger models).
I will try to send in a PR for this issue and #935.
Problem description
Hi all, I am running loopless FBA and I noticed that when I run several times the optimisation I get different results. This does not occur systematically though: some model objective functions seem to give constant results.
I observed this behaviour using glpk and cplex solvers. The differences between the results seem worse in cplex - at least in the tests I performed.
I would have expected the results of loopless FBA to be stable - or more stable at least - since for some tests I can get a positive value right after a 0 value.
Am I doing something wrong?
Code Sample
Create a minimal, complete, verifiable example.
Gives the following output with cplex 22.1.0.0:
And this output with the default glpk solver:
Context