fix: read compartment annotations in readYAMLmodel - #676
Merged
Conversation
writeYAMLmodel emits an annotation block per compartment, but the reader's compartment section had no switch: every annotation line became a compartment of its own. Reproduced on tutorial/iAL1006 v1.00.xml, where a YAML round-trip turned 4 compartments into 12 (p, annotation, go, m, annotation, go, ...) with compNames of !!omap and GO:0005777, after which exportModel hard-errored on duplicate compartment IDs. The reader now recognises the annotation key and gathers the entries into compMiriams, mirroring the metabolite/reaction/gene sections. Annotation entries are indented deeper than the compartment they belong to, which is what separates them from the next compartment. Adds a round-trip test asserting comps, compNames and compMiriams; the existing YAML test only asserted a reaction count, which is why this survived.
Function test results241 tests 219 ✅ 1m 2s ⏱️ Results for commit cfc153d. |
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:
readYAMLmodelread each compartment's annotation block as additional compartments, so a YAML round-trip of the tutorial model turned 4 compartments into 12 andexportModelthen failed on duplicate compartment IDs. Annotations are now read intocompMiriams.tIO.massertingcomps,compNamesandcompMiriams.Instructions on merging this PR:
develop3as target branch, and will be resolved with a squash-merge.