Fix addTransport crashing when a metabolite has no counterpart in the target compartment - #700
Merged
Merged
Conversation
… target compartment addedRxnsName was built from the full, unfiltered metNames while nRxns counted only the metabolites that actually exist in the target compartment (the onlyToExisting branch), so the two arrays concatenated onto model.rxns/model.rxnNames had different lengths whenever the requested set wasn't a subset of what exists in every target compartment -- the default call with no metNames given, transporting every metabolite from one compartment to another. A second, independent bug in the same line: strcat's result was transposed from a column into a row, incompatible with model.rxnNames' column shape, regardless of length. Introduces namesInComp, filtered identically to fromMetsInComp/toMets in each branch, and drops the erroneous transpose.
Function test results300 tests 274 ✅ 1m 1s ⏱️ Results for commit 0e7f2f9. |
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.
Fixes SysBioChalmers/raven-gecko-parity#10.
addedRxnsNamewas built from the full, unfilteredmetNames, whilenRxnscounted only the metabolites that actually exist in the target compartment
(the
onlyToExistingbranch). The two arrays concatenated ontomodel.rxns/
model.rxnNamesthen had different lengths whenever the requested set wasnot a subset of what exists in every target compartment — including the
default call with no
metNames, which transports every metabolite from onecompartment to another (the tutorial-model case in the parity issue).
A second, independent bug on the same line:
strcat's result was transposedfrom a column into a row, incompatible with
model.rxnNames' column shape,regardless of length.
Introduces
namesInComp, filtered identically tofromMetsInComp/toMetsin each branch, and drops the erroneous transpose.