Skip to content
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

Cycles met ids #756

Merged
merged 3 commits into from
Nov 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/memote/suite/tests/test_consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import memote.support.consistency as consistency
import memote.support.consistency_helpers as con_helpers
import memote.support.helpers as helpers
from memote.utils import annotate, get_ids, truncate, wrapper


Expand Down Expand Up @@ -153,11 +154,18 @@ def test_detect_energy_generating_cycles(model, met):

"""
ann = test_detect_energy_generating_cycles.annotation
if met not in model.metabolites:
# Test if the metabolite is present in the model.
main_comp = helpers.find_compartment_id_in_model(model, "c")
Midnighter marked this conversation as resolved.
Show resolved Hide resolved
try:
helpers.find_met_in_model(model, met, main_comp)[0]
except ValueError:
pytest.skip("Metabolite {} is not in the MetaNetX shortlist.".format(met))
except (RuntimeError, IndexError):
pytest.skip(
"This test has been skipped since metabolite {} could "
"not be found in the model.".format(met)
)
# If the metabolite is present, carry out the test.
ann["data"][met] = consistency.detect_energy_generating_cycles(model, met)
# Report the number of cycles scaled by the number of reactions.
ann["metric"][met] = len(ann["data"][met]) / len(model.reactions)
Expand Down