Skip to content

Commit

Permalink
Merge pull request #601 from gregmedlock/develop
Browse files Browse the repository at this point in the history
fix: biomass SBO annotation test
  • Loading branch information
Midnighter committed Jan 28, 2019
2 parents 34679e3 + 1ed56d0 commit 3915f09
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Next Release
0.9.1 (2019-01-28)
------------------
* Add ``seed.reaction`` namespace to the reaction annotation databases.
* Fix bug that would lead to biomass SBO annotations not being reported.

0.9.0 (2019-01-28)
------------------
Expand Down
2 changes: 1 addition & 1 deletion memote/suite/tests/test_sbo.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,4 +418,4 @@ def test_biomass_specific_sbo_presence(model):
'biomass production': {}""".format(
len(ann["data"]), ann["metric"], truncate(ann["data"])
))
assert len(ann["data"]) == len(biomass), ann["message"]
assert len(ann["data"]) == 0, ann["message"]
13 changes: 13 additions & 0 deletions tests/test_for_support/test_for_sbo.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def specific_sbo_term(base):
base.add_reactions([rxn])
return base


@register_with(MODEL_REGISTRY)
def multiple_sbo_terms(base):
met = cobra.Metabolite(id='met_c', name="Met")
Expand All @@ -65,6 +66,17 @@ def multiple_sbo_terms(base):
base.add_reactions([rxn])
return base


@register_with(MODEL_REGISTRY)
def biomass_sbo_term(base):
met = cobra.Metabolite(id='met_c', name="Met")
rxn = cobra.Reaction(id='RXN', name="Rxn")
rxn.add_metabolites({met: -1})
rxn.annotation = {'sbo': 'SBO:0000629'}
base.add_reactions([rxn])
return base


@pytest.mark.parametrize("model, num, components", [
("no_annotations", 2, "metabolites"),
("no_annotations", 1, "reactions"),
Expand All @@ -81,6 +93,7 @@ def test_find_components_without_sbo_terms(model, num, components):
("specific_sbo_term", 0, "metabolites", "SBO:1"),
("specific_sbo_term", 1, "reactions", "SBO:1"),
("specific_sbo_term", 1, "genes", "SBO:1"),
("biomass_sbo_term", 0, "reactions", "SBO:0000629"),
("multiple_sbo_terms", 0, "metabolites", ["SBO:1","SBO:2","SBO:3"]),
("multiple_sbo_terms", 1, "reactions", ["SBO:1","SBO:2","SBO:3"]),
("multiple_sbo_terms", 1, "genes", ["SBO:1","SBO:2","SBO:3"])
Expand Down

0 comments on commit 3915f09

Please sign in to comment.