-
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ee173d7
remove commented line
hariszaf 2495399
address issues #74 and #75
hariszaf c0855cf
import Dict type
hariszaf a9e3ddf
test for boundary change and decreasing of fba when glc goes down
hariszaf 8acfb5f
edit test for media indices
hariszaf a722447
Merge branch 'GeomScale:develop' into develop
hariszaf 0f4024d
edit test for modify_medium()
hariszaf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,26 @@ def test_fba_sbml(self): | |
|
||
self.assertTrue(abs(res[1] - 0.8739215067486387) < 1e-03) | ||
|
||
def test_modify_medium(self): | ||
|
||
input_file_sbml = os.getcwd() + "/ext_data/e_coli_core.xml" | ||
model = MetabolicNetwork.from_sbml(input_file_sbml) | ||
model.set_slow_mode() | ||
|
||
initial_medium = model.medium | ||
initial_fba = model.fba()[-1] | ||
glc_index = model.reactions.index("EX_glc__D_e") | ||
|
||
new_media = initial_medium.copy() | ||
new_media["EX_glc__D_e"] = 1.5 | ||
|
||
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 commentThe reason will be displayed to describe this comment to others. Learn more. How this can be true if |
||
|
||
self.assertTrue(initial_fba - model.fba()[-1] > 0) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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!