You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now removing reactions from a model will still reatin in them in the objective even when using remove_orphans=True. They are kind of handled correctly there because they appear as diconnected variables, meaning they are fixed to zero.
In [2]: fromcobra.ioimportload_modelIn [3]: mod=load_model("textbook")
In [4]: mod.objectiveOut[4]: <optlang.cplex_interface.Objectiveat0x7fb641a6d790>In [5]: mod.objective.expressionOut[5]: 1.0*Biomass_Ecoli_core-1.0*Biomass_Ecoli_core_reverse_2cdbaIn [6]: mod.remove_reactions([mod.reactions.Biomass_Ecoli_core], True)
In [7]: mod.objective.expressionOut[7]: 1.0*Biomass_Ecoli_core-1.0*Biomass_Ecoli_core_reverse_2cdbaIn [8]: mod.optimize()
Out[8]: <Solution0.000at0x7fb641a74590>
But it is still a bit confusing to have removed reactions appear there.
Solution
I don't have a definitive solution. It is challenging because the objective can be arbitrary non-linear functions so it is not trivial to correctly remove terms. Removing individual reactions in theory also breaks the scaling to 1gDW.
Alternatives
Other approaches:
leave it as is and document the behavior
don't touch the objective but raise a warning
remove the objective if any included variables are removed, forcing the user to set a new objective by hand
Anything else?
Happy to hear the thoughts of the community!
The text was updated successfully, but these errors were encountered:
Checklist
Problem
Right now removing reactions from a model will still reatin in them in the objective even when using
remove_orphans=True
. They are kind of handled correctly there because they appear as diconnected variables, meaning they are fixed to zero.But it is still a bit confusing to have removed reactions appear there.
Solution
I don't have a definitive solution. It is challenging because the objective can be arbitrary non-linear functions so it is not trivial to correctly remove terms. Removing individual reactions in theory also breaks the scaling to 1gDW.
Alternatives
Other approaches:
Anything else?
Happy to hear the thoughts of the community!
The text was updated successfully, but these errors were encountered: