Skip to content

fix: metabolite names starting with a number, and a spurious addRxns warning - #682

Merged
edkerk merged 1 commit into
develop3from
fix/parity-constructs-addrxns
Jul 17, 2026
Merged

fix: metabolite names starting with a number, and a spurious addRxns warning#682
edkerk merged 1 commit into
develop3from
fix/parity-constructs-addrxns

Conversation

@edkerk

@edkerk edkerk commented Jul 17, 2026

Copy link
Copy Markdown
Member

Main improvements in this PR:

  • fix:
    • constructS read the leading number of a metabolite whose name starts with a digit as a stoichiometric coefficient: 2 oxoglutarate => succinate gave S = [-2 1] over a metabolite oxoglutarate. An entry that matches the supplied metabolite list in full is now taken as a name. Ordinary coefficients are unaffected.
    • addRxns raised its "metabolites both as substrate and product" warning on every call, with an empty list of reactions, because it never checked whether any equation had the problem.
  • documentation:
    • Tests in tQueries.m and tManipulation.m.

Instructions on merging this PR:

  • This PR has develop3 as target branch, and will be resolved with a squash-merge.

…warning

Both found by comparing the raven-toolbox test suite against RAVEN's.

constructS read the leading number of every "number name" entry as a
coefficient, so an equation using a metabolite whose name starts with a digit
was silently mis-stoichiometried: "2 oxoglutarate => succinate" produced
S = [-2 1] over a metabolite "oxoglutarate" rather than [-1 1] over
"2 oxoglutarate". When the caller supplies a metabolite list, an entry that
matches it in full is now taken as a name. A list derived from the equations
cannot disambiguate, so that path is unchanged, as is the ordinary coefficient
reading.

addRxns raised its "metabolites both as substrate and product" warning outside
any check of whether any equation had that problem, so every call warned, with
an empty list of offending reactions.
@github-actions

Copy link
Copy Markdown

Function test results

243 tests   221 ✅  1m 1s ⏱️
 23 suites   22 💤
  1 files      0 ❌

Results for commit 4d94392.

@edkerk
edkerk merged commit 31d5887 into develop3 Jul 17, 2026
4 checks passed
@edkerk
edkerk deleted the fix/parity-constructs-addrxns branch July 17, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant