Skip to content

fix: yaml eccode annotation handling#613

Merged
edkerk merged 1 commit into
develop3from
fix/yaml-eccode-annotation
Jun 7, 2026
Merged

fix: yaml eccode annotation handling#613
edkerk merged 1 commit into
develop3from
fix/yaml-eccode-annotation

Conversation

@edkerk

@edkerk edkerk commented Jun 7, 2026

Copy link
Copy Markdown
Member

Main improvements in this PR:

  • fix:
    • YAML file handling of ec-codes

Instructions on merging this PR:

  • This PR has develop3 as target branch, and will be resolved with a squash-merge.
  • This PR has main as target branch, and will be resolved as descriped here.

@edkerk edkerk force-pushed the fix/yaml-eccode-annotation branch from d092fa1 to 0fc2fd0 Compare June 7, 2026 18:39
EC numbers are a standard MIRIAM cross-reference, so cobrapy and geckopy
read them from annotation['ec-code'] (a list). RAVEN wrote them as a
top-level reaction `eccodes` key, which plain cobra.io ignores -- so
EC codes never reached the annotation['ec-code'] location geckopy reads
from, and raven-python had to special-case the top-level key.

writeYAMLmodel now emits EC numbers inside the per-reaction `annotation`
block as `ec-code`, fused with rxnMiriams the same way metabolite SMILES
already is (writeAnnotation generalised to 'met' and 'rxn'); always a
list, even for a single code, to match cobrapy/raven-python/geckopy.
readYAMLmodel gains a `case 'ec-code'` that captures the annotation form
into model.eccodes; the legacy top-level `eccodes` key is still read for
older files.

Verified end-to-end on yeast-GEM (MATLAB R2024b): read old top-level
eccodes -> write annotation ec-code -> read back keeps all 2411/4102
reactions' EC codes unchanged. A permanent EC-code case in
importExportTests.m would lock this in. Pairs with raven-python io.yaml
(same change there).
@edkerk edkerk force-pushed the fix/yaml-eccode-annotation branch from 0fc2fd0 to c997cc1 Compare June 7, 2026 18:39
@edkerk edkerk merged commit a977a53 into develop3 Jun 7, 2026
1 check failed
@edkerk edkerk deleted the fix/yaml-eccode-annotation branch June 7, 2026 18:42
@edkerk edkerk changed the title Fix/yaml eccode annotation fix: yaml eccode annotation handling Jun 7, 2026
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