Skip to content

Commit

Permalink
docs: update docstring and test description to reflect implementation (
Browse files Browse the repository at this point in the history
…#620)

* docs: update docstring and test description to reflect the implementation
  • Loading branch information
ChristianLieven committed Mar 11, 2019
1 parent f50986c commit fec22ee
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ History

Next Release
------------
* Update docstring of test_find_duplicate_reactions.

0.9.6 (2019-03-06)
------------------
Expand Down
17 changes: 8 additions & 9 deletions memote/suite/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,15 +640,14 @@ def test_find_duplicate_reactions(model):
Implementation:
Compare reactions in a pairwise manner.
First, if there are duplicate metabolites in the set of
metabolites of each reaction, add them to the set belonging to each
reaction respectively. Then, if the sets for each reaction are
identical, check the reversibility of each reaction:
- If both reactions differ in reversibility they are assumed to be
different.
- If both are reversible they are assumed to be identical.
- If both are irreversible, the upper bound and product metabolites
have to be identical for the reactions to be assumed to be identical.
For each reaction, the metabolite annotations are checked for a description
of the structure (via InChI and InChIKey).If they exist, substrates and
products as well as the stoichiometries of any reaction pair are compared.
Only reactions where the substrates, products, stoichiometry and
reversibility are identical are considered to be duplicates.
This test will not be able to identify duplicate reactions if there are no
structure annotations. Further, it will report reactions with
differing bounds as equal if they otherwise match the above conditions.
"""
ann = test_find_duplicate_reactions.annotation
Expand Down
17 changes: 8 additions & 9 deletions memote/support/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,15 +417,14 @@ def find_duplicate_reactions(model):
This can be useful to curate merged models or to clean-up bulk model
modifications. The heuristic compares reactions in a pairwise manner.
First, if there are duplicate metabolites in the set of
metabolites of each reaction, they are added to the set of each reaction
respectively. Then, if the sets for each reaction are
identical the reversibility of each reaction is checked:
- If both reactions differ in reversibility they are assumed to be
different.
- If both are reversible they are assumed to be identical.
- If both are irreversible, the upper bound and product metabolites
have to be identical for the reactions to be assumed to be identical.
For each reaction, the metabolite annotations are checked for a description
of the structure (via InChI and InChIKey).If they exist, substrates and
products as well as the stoichiometries of any reaction pair are compared.
Only reactions where the substrates, products, stoichiometry and
reversibility are identical are considered to be duplicates.
This test will not be able to identify duplicate reactions if there are no
structure annotations. Further, it will report reactions with
differing bounds as equal if they otherwise match the above conditions.
Parameters
----------
Expand Down

0 comments on commit fec22ee

Please sign in to comment.