-
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
support of medium modification and cobra model loading #76
Conversation
Hey, @hariszaf, thanks a lot for this PR! Could you plz add one unit-test per new function to check for correctness? |
@TolisChal here's a test for editing a reaction that is already part of the medium. |
tests/fba.py
Outdated
model.medium = new_media | ||
|
||
if model.lb[glc_index] != -1.5: | ||
self.assertTrue(model.lb[glc_index] == -1.5) |
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.
How this can be true if model.lb[glc_index] != -1.5
?
@@ -40,6 +40,26 @@ def test_fba_sbml(self): | |||
|
|||
self.assertTrue(abs(res[1] - 0.8739215067486387) < 1e-03) | |||
|
|||
def test_modify_medium(self): |
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.
Does this test that the medium are extracted correctly?
How many medium reaction does ecoli has?
I was thinking something like:
known_medium = {"medium_reaction1": medium_reaction1_index, .... }
and then check if the extracted medium reactions and its indices matches with the already known medium reactions and indices
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.
Do you mean something like that?
The check for the number of exchange reactions is in case in the future we enable to add an exchange reaction, rather than just editing its boundaries.
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.
Yes, exactly. Thanks!
Aim of this PR is to address issues #74 and #75 .
The
MetabolicNetwork
class has been modified now it keeps the exchange reactions of a model asmodel.exchanges
and its medium asmodel.medium
.The user may modify the medium as in cobra.
On top of that,
dingo
can also now build a dingo-model based on a cobra-model.For example:
This allows for further modifications of the model, e.g. adding reactions, through the
convenient interface of cobra and an easier integration with dingo.