Skip to content

fix: four EC-code and kcat data-quality bugs - #446

Merged
edkerk merged 1 commit into
develop4from
fix/ec-kcat-data-quality-bugs
Aug 28, 2026
Merged

fix: four EC-code and kcat data-quality bugs#446
edkerk merged 1 commit into
develop4from
fix/ec-kcat-data-quality-bugs

Conversation

@edkerk

@edkerk edkerk commented Aug 28, 2026

Copy link
Copy Markdown
Member

Summary

Four small, independent bug fixes to EC-code handling and kcat gathering, each with its own tracking issue and regression test:

All four were originally diagnosed and fixed on the long-abandoned feat/geckopy-compat branch (84 commits ahead of develop4, but also 99 behind it — not mergeable as-is), while building out raven-gecko-parity's MATLAB/Python behavioural parity tests. Re-verified against current develop4 and re-implemented here rather than merging that branch.

In three of the four cases, geckopy's own port already documents (or simply implements) the corrected behavior, which was used to confirm the fix matches the intended cross-language behaviour rather than just silencing an error.

Test plan

  • Added testGetECfromGEMRejectsMalformedComponents_tc0031, testFindECInDBIntersectionDedupesWildcardPair_tc0032, testFuzzyKcatMatchingWildcardExhaustionDoesNotCrash_tc0033, testGetStandardKcatUsesSubsystemKcatWheneverAnyMatches_tc0034 to geckoCoreFunctionTests.m.
  • Verified each new test fails against the pre-fix code (including reproducing the actual crash for tc0033) and passes against the fix.
  • Full local suite: 34/34 passed.

Closes #442, #443, #444, #445.

- fuzzyKcatMatching.m: the wildcard-escalation loop had no termination
  guard, so an EC class with zero BRENDA coverage at every wildcard
  level crashed instead of reporting no match (#442).
- getECfromGEM.m: the EC validation regex used \w instead of \d+ per
  component, so malformed codes containing letters or underscores
  (e.g. "1.1.1.n12", "1_2_3_4") passed validation instead of being
  rejected (#443).
- findECInDB.m: the intersection() helper didn't dedupe its output,
  so a specific EC code and its own wildcard parent could both
  resolve to the same code and get appended twice (#444).
- getStandardKcat.m: kcatSubSystemIdx is a one-hot vector, so
  all(kcatSubSystemIdx) only ever succeeds for a model with exactly
  one subSystem; any() is the correct test. With more than one
  subSystem, every reaction silently fell back to the model-wide
  standardKcat instead of its own subSystem-specific value (#445).

Each is covered by a new regression test (tc0031-tc0034), verified to
fail against the pre-fix code and pass against the fix.

Closes #442, #443, #444, #445.
@github-actions

Copy link
Copy Markdown

Unit test results

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

Results for commit e7ec543.

@edkerk
edkerk merged commit 0f8612b into develop4 Aug 28, 2026
2 checks passed
@edkerk
edkerk deleted the fix/ec-kcat-data-quality-bugs branch August 28, 2026 11:08
edkerk added a commit to SysBioChalmers/raven-gecko-parity that referenced this pull request Aug 28, 2026
findECInDB, fuzzyKcatMatching, getECfromGEM, and getStandardKcat each
had a real, confirmed-live MATLAB bug, originally diagnosed and fixed
on the long-abandoned feat/geckopy-compat branch (84 ahead of develop4
but also 99 behind it, so not directly mergeable). Filed as
SysBioChalmers/GECKO#442-445, fixed and re-verified against current
develop4 in SysBioChalmers/GECKO#446 (open).

Three of the four already had their corrected behaviour documented or
implemented on the Python side (geckopy's own MATLAB-COMPAT notes, or
just correct-by-construction code), used here to confirm each fix
brings MATLAB in line rather than just silencing an error. The
getECfromGEM fix also closes an already-documented ledger divergence
(malformed EC codes like "1.1.1.n12" on yeast-GEM).
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