Skip to content

fix: isozyme kcat selection and EC-annotation overwrite bugs - #463

Merged
edkerk merged 3 commits into
develop4from
fix/isozyme-kcat-and-ec-overwrite
Aug 30, 2026
Merged

fix: isozyme kcat selection and EC-annotation overwrite bugs#463
edkerk merged 3 commits into
develop4from
fix/isozyme-kcat-and-ec-overwrite

Conversation

@edkerk

@edkerk edkerk commented Aug 30, 2026

Copy link
Copy Markdown
Member

Summary

Two independent correctness fixes, both confirmed against geckopy's already-correct behavior and decided in raven-gecko-parity#57 / raven-gecko-parity#79:

applyKcatConstraints (light formulation) — when a reaction had both a kcat-assigned isozyme and an unassigned one, the unassigned isozyme's Inf cost (kcat==0) was corrected to 0 before min() was taken across isozymes, so that fabricated zero always won over any real kcat — silently leaving the reaction under-constrained by enzyme usage, with no warning. Isozymes with no usable kcat (or unresolved MW) are now excluded before the comparison instead, matching geckopy's apply_kcat_constraints. A reaction with no valid isozyme at all is still left uncosted, same as before.

copyECtoGEMoverwrite=true copied ec.eccodes verbatim, including empty entries, so a real, populated ecModel.eccodes annotation could be silently erased just because the corresponding ec-structure entry happened to be empty. An empty source entry is now never copied, whether or not overwrite is set — matching geckopy's copy_ec_to_gem, which already documents this exact MATLAB behavior as a divergence it deliberately didn't replicate.

Both fixes and their four new regression tests (geckoCoreFunctionTests.m tc0047–tc0050) were reviewed with @eduardk before implementation — see raven-gecko-parity#57 and raven-gecko-parity#79 for the discussion.

Fixes raven-gecko-parity#57
Fixes raven-gecko-parity#79

Test plan

  • geckoCoreFunctionTests: 50 passed, 0 failed (full suite, RAVEN develop3 on path, glpk solver)
  • New tests specifically exercise: a mixed valid/invalid-isozyme reaction picks the real kcat; an all-invalid reaction stays uncosted; overwrite=true no longer erases a populated annotation with an empty source; overwrite=false still only fills empty entries

edkerk added 2 commits August 31, 2026 00:00
…igned isozymes' fabricated zero cost

In the light formulation, an isozyme with no kcat assigned (kcat==0,
giving an Inf MW/kcat) had its cost corrected to zero before taking
min() across a reaction's isozymes, so that fabricated zero always won
over any real kcat on another isozyme of the same reaction -- silently
leaving the reaction under-constrained by enzyme usage. Isozymes with
no usable kcat (or unresolved MW) are now dropped before the min()
instead, matching geckopy's apply_kcat_constraints; a reaction with no
valid isozyme at all is still left uncosted, as before.

raven-gecko-parity#57
…ty sources

overwrite=true copied ecModel.ec.eccodes verbatim, including empty
entries, so an existing populated ecModel.eccodes annotation could be
silently erased just because the corresponding ec-structure entry
happened to be empty. An empty source entry is now never copied,
whether or not overwrite is set, matching geckopy's copy_ec_to_gem
(which already treats an empty ec.eccodes entry as "no info to
propagate").

raven-gecko-parity#79
@edkerk
edkerk force-pushed the fix/isozyme-kcat-and-ec-overwrite branch from af098ef to 870c96b Compare August 30, 2026 22:00
@edkerk
edkerk changed the base branch from main to develop4 August 30, 2026 22:07
@github-actions

Copy link
Copy Markdown

Unit test results

50 tests   50 ✅  10s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit e440d08.

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