fix: metabolite names starting with a number, and a spurious addRxns warning - #682
Merged
Conversation
…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.
Function test results243 tests 221 ✅ 1m 1s ⏱️ Results for commit 4d94392. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Main improvements in this PR:
constructSread the leading number of a metabolite whose name starts with a digit as a stoichiometric coefficient:2 oxoglutarate => succinategaveS = [-2 1]over a metaboliteoxoglutarate. An entry that matches the supplied metabolite list in full is now taken as a name. Ordinary coefficients are unaffected.addRxnsraised 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.tQueries.mandtManipulation.m.Instructions on merging this PR:
develop3as target branch, and will be resolved with a squash-merge.