Skip to content

Restrict importModel to SBML L3V1 FBCv2 and drop legacy format handling#633

Merged
edkerk merged 2 commits into
develop3from
refactor/importmodel-l3v1-fbcv2
Jun 11, 2026
Merged

Restrict importModel to SBML L3V1 FBCv2 and drop legacy format handling#633
edkerk merged 2 commits into
develop3from
refactor/importmodel-l3v1-fbcv2

Conversation

@edkerk

@edkerk edkerk commented Jun 11, 2026

Copy link
Copy Markdown
Member

Summary

importModel now 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)

  • Genes and complexes stored as species (E_/Cx_ prefixes), the complex-forming-reaction skip, and the gene-as-species collector variables
  • 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/ retained)

Genes now come solely from fbc_geneProduct (or grRules). RAVEN conventions that are not legacy — reaction notes for SUBSYSTEM/Confidence Level/AUTHORS/NOTES, groups_group subsystems, SBO handling, InChI/fbc_charge/fbc_chemicalFormula, ID unescaping, prefix removal — are kept.

Verification

Behaviour on valid L3V1 FBCv2 models is unchanged, checked with isequaln against pre-refactor imports of empty.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) and importExportTests (7/7) pass with no failures.

io/importModel.m: 1157 → 891 lines (−266).

edkerk added 2 commits June 11, 2026 18:50
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.
@edkerk edkerk merged commit 7d74921 into develop3 Jun 11, 2026
1 check failed
@edkerk edkerk deleted the refactor/importmodel-l3v1-fbcv2 branch June 11, 2026 17:23
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