Skip to content

assign_standard_kcat: median-vs-mean eligibility count and NaN handling - #49

Merged
edkerk merged 1 commit into
mainfrom
fix/standard-kcat-median-and-nan
Sep 7, 2026
Merged

edkerk merged 1 commit into
mainfrom
fix/standard-kcat-median-and-nan

Conversation

@edkerk

@edkerk edkerk commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Found while resolving CompMetEng/raven-gecko-parity#80 (parity ledger note on getStandardKcat/assign_standard_kcat).

  • _compute_subsystem_kcats: a NaN-kcat reaction counted toward a subsystem's threshold eligibility and was folded into np.median, silently turning that subsystem's computed kcat into NaN.
  • _fill_zero_kcats: a NaN kcat was left unset and unmarked after assign_standard_kcat returns, contrary to the docstring.

Companion MATLAB fix: SysBioChalmers/GECKO#475.

Matches the eligibility-count and NaN-handling fix landing on the
MATLAB side (SysBioChalmers/GECKO#475): a subsystem's threshold count
and its own median should only ever consider reactions with a real
kcat.

- `_compute_subsystem_kcats`: only skipped rows with a literal zero kcat,
  so a NaN-kcat row both counted toward a subsystem's threshold
  eligibility and got folded into `np.median`, silently turning the whole
  subsystem's computed kcat into NaN.
- `_fill_zero_kcats`: only replaced literal zero kcats, leaving a NaN
  kcat unset and unmarked after `assign_standard_kcat` returns, contrary
  to the docstring and to MATLAB `isnan` check in `fillZeroKcat`.
@edkerk
edkerk merged commit e5ca361 into main Sep 7, 2026
6 checks passed
@edkerk
edkerk deleted the fix/standard-kcat-median-and-nan branch September 7, 2026 05:49
edkerk added a commit to CompMetEng/raven-gecko-parity that referenced this pull request Sep 7, 2026
`ecFSEOF`/`ec_fseof`: floor now anchored to biomass-optimal target flux
and candidates restricted to gene-associated reactions
(CompMetEng/geckopy#50, CompMetEng/raven-toolbox#147); the
selection-criterion divergence is left as the same accepted difference
already tracked on the RAVEN pair's `FSEOF` row.

`getStandardKcat`/`assign_standard_kcat`: MATLAB now aggregates by
median, and both sides agree on threshold eligibility and NaN handling
(SysBioChalmers/GECKO#475, CompMetEng/geckopy#49).
edkerk added a commit that referenced this pull request Sep 8, 2026
Flattens the Keep-a-Changelog ### Added/Fixed/Changed subsections into
one bullet list (matching raven-toolbox's CHANGELOG.md format) and
drops the version header's brackets to match. Also folds in #49 and
#50, which had merged straight to main since 0.3.0 and were missing
from develop until the merge two commits back.
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