Restrict importModel to SBML L3V1 FBCv2 and drop legacy format handling#633
Merged
Conversation
importModel now supports only SBML Level 3 Version 1 with the FBC v2 package, which is what RAVEN itself writes. An early check rejects other formats with a message to convert the file or use an older RAVEN version. With that guarantee, the legacy/non-FBC code paths are removed: - genes and complexes stored as species (E_/Cx_ prefixes), including the complex-forming-reaction skip and the gene-as-species collectors - the Yeast 7.6 systematic-gene-name resolution workaround - non-FBC reaction bounds (kineticLaw parameters) - gene associations from notes (GENE_ASSOCIATION) and from modifiers - reaction compartment, metabolite charge and formula read from notes - EC codes and MIRIAM/taxonomy in urn:miriam: and http://identifiers.org/ form (https://identifiers.org/ is retained) Genes are now taken solely from fbc_geneProduct (or grRules). Behaviour on valid L3V1 FBCv2 models is unchanged, verified by identical imports of empty.xml, iAL1006 and a round-tripped model. importModel.m drops from 1157 to 891 lines.
Restricting MIRIAM, EC-code and taxonomy parsing to https://identifiers.org/ made importModel fragile: a model annotated with the equally-valid http://identifiers.org/ scheme would silently lose all its cross-references. Restore detection of both http and https (still dropping the long-obsolete urn:miriam: form). Verified that an http-converted copy of iAL1006 yields identical metMiriams, rxnMiriams, geneMiriams and eccodes to the https original.
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.
Summary
importModelnow supports only SBML Level 3 Version 1 with the FBC v2 package — the format RAVEN itself writes. An early check rejects anything else with a clear message (convert the file elsewhere, or use an older RAVEN version). With that guarantee, the legacy/non-FBC branches that made the function a 1157-line monolith are removed.Removed (all legacy / non-FBCv2)
E_/Cx_prefixes), the complex-forming-reaction skip, and the gene-as-species collector variableskineticLawparameters)GENE_ASSOCIATION) and from modifiersurn:miriam:andhttp://identifiers.org/form (https://identifiers.org/retained)Genes now come solely from
fbc_geneProduct(orgrRules). RAVEN conventions that are not legacy — reaction notes for SUBSYSTEM/Confidence Level/AUTHORS/NOTES,groups_groupsubsystems, SBO handling, InChI/fbc_charge/fbc_chemicalFormula, ID unescaping, prefix removal — are kept.Verification
Behaviour on valid L3V1 FBCv2 models is unchanged, checked with
isequalnagainst pre-refactor imports ofempty.xml,iAL1006 v1.00.xml(1632 reactions) and a round-tripped model — all identical. The format check correctly rejects a non-FBCv2 file.tIO(18/19, 1 filtered for missing pyyaml) andimportExportTests(7/7) pass with no failures.io/importModel.m: 1157 → 891 lines (−266).