-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PreProcess class for reactions removal #100
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
It needs to make clear some definitions.
Parts of the code can be simplified.
For the test, are you sure that this is actually the number of each case or is this the number your function returned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, thanks!
Aim of this PR is to provide a "PreProcess" class to dingo that identifies and removes certain reactions.
This removal is achieved by setting the lower and upper bounds of reactions to 0.
3 types of reactions are identified and removed from the metabolic models:
The metabolic model given as an input to the "PreProcess" class must be in a cobra format. A list with the removed reactions ids and a reduced dingo model are returned from the "reduce" function of this class.
from cobra.io import load_json_model
cobra_model = load_json_model("ext_data/e_coli_core.json")
obj = PreProcess(cobra_model)
removed_reactions, dingo_model = obj.reduce(extend=0)
In addition, reactions that do not affect the objective function when sequentially knocked-down can be removed from the model.
To perform this additional removal of reactions, the "extend" parameter from the "reduce" function is set to 1.
removed_reactions, dingo_model = obj.reduce(extend=1)
However, this may lead to infesible solutions in large models. When this happens, these reactions are restored to their initial bounds.
This unittest shows how the PreProcess class works with the E.coli core model. It removes 46 reactions with "extend" set to 0 and 47 reactions with "extend" set to 1. An FBA is also called after reactions removal and the value of the objective function is the same, as the initial one.
This new script in the dingo/ directory contains the code for the PreProcess class.