Skip to content

BRENDA: filter implausible SA-derived kcats; default top_origin_limit 6 -> 4 - #58

Merged
edkerk merged 4 commits into
developfrom
investigate/brenda-2026-1-pipeline-delta
Sep 23, 2026
Merged

edkerk merged 4 commits into
developfrom
investigate/brenda-2026-1-pipeline-delta

Conversation

@edkerk

@edkerk edkerk commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

BRENDA's specific-activity x molecular-weight join can produce a kcat many orders of magnitude below anything else reported for the same EC -- almost always a unit/transcription error upstream, not a real slow enzyme. Case in point: EC 2.3.1.297's only molecular-weight row is for a different organism than its lowest specific-activity row; the derived kcat (~4e-7 1/s) is 8 orders of magnitude below a same-EC yeast measurement that has no matching MW row and gets silently dropped instead. Once assigned, a kcat that small makes the enzyme-usage coefficient enormous and can make a model untunable (CMA-ES distance 4.19 vs 0.80 for an otherwise-identical model).

Two changes, meant to ship together:

  • load_brenda_data gains filter_outlier_kcats (default True): drops a kcat more than 4 orders of magnitude below the median of its own EC family, widening to a broader EC prefix when fewer than 5 reference values are available. The reference pool is the union of the plain kcat table and the SA-derived table, built once from the unfiltered tables.
  • merge_kcats's (and merge_dlkcat_and_fuzzy_kcats's) top_origin_limit default changes from 6 to 4, so a specific-activity-derived match no longer automatically outranks a prediction. Mostly redundant with the filter when a predictor's coverage is broad, but still needed where it's patchier -- pairing the filter with the old default on a DLKcat-predicted model instead reproduces a different failure (systematic under-prediction of the Crabtree/overflow response at high growth rate).

Both are opt-out, not removed (filter_outlier_kcats=False, top_origin_limit=6).

Validation: re-ran the kcat-assignment-through-tuning pipeline on the June-2026 ecYeastGEM build and on mainline today, isolating each change (screen + CMA-ES, top-112 free parameters, 3 seeds, budget 6800). These two changes take an otherwise-broken model back to June's level or better. Write-up: docs/internal/pipeline_deltas_since_june.md.

Full test suite passes unchanged (1435 passed, 1 xfailed, 0 failed); added tests for the new filter and updated the one test whose assertion encoded the old default.

…eraction

Investigates every difference between the June-2026 ecYeastGEM build and
mainline geckopy today: matcher bug fixes, standard-kcat scope, OKP
tiering, BRENDA 2026.1, and prediction source (CatPred/DLKcat/EITLEM).
Six changes tune to the same place as June within noise; DLKcat and
EITLEM both improve on it. BRENDA 2026.1 breaks tuning outright via a
specific-activity/molecular-weight data trap (EC 2.3.1.297), traced to
a mouse row surviving a dropped yeast row in the SA-MW join. Two
mitigations compared (top_origin_limit=4, and a relative floor on
derived kcats); the floor alone gives the best results for three of
four predictors but breaks DLKcat via a Crabtree-effect/overflow
mismatch, traced by comparing per-condition simulated vs measured
ethanol secretion. Combining both mitigations is clean for every
predictor tested.
c3_fl4 vs c3_o4 differ in only 34 of 4834 kcats; b26_fl4 vs b26_o4 are
byte-identical. Not a bug: top_origin_limit=4 already demotes every
origin-5/6 BRENDA match below any prediction, and CatPred's coverage
is broad enough that almost every such reaction already has a CatPred
prediction to fall back to. The floor only has room to matter where a
predictor's coverage is patchier (DLKcat, EITLEM).
Two changes, meant to ship together (see docs/internal/pipeline_deltas_since_june.md):

- load_brenda_data gains filter_outlier_kcats (default True): drops a
  kcat more than 4 orders of magnitude below the median of its own EC
  family (widening to a broader EC prefix when fewer than 5 reference
  values are available), computed from the union of the plain-kcat and
  SA-derived tables. Catches cases like EC 2.3.1.297, where the only
  molecular-weight row available is for the wrong organism and the
  resulting SA x MW join gives a kcat 8 orders of magnitude below a
  same-EC measurement that has no MW row and would otherwise be
  silently dropped instead of used.

- merge_kcats' and merge_dlkcat_and_fuzzy_kcats' top_origin_limit
  default changes from 6 to 4, so a specific-activity-derived BRENDA
  match (origin 5-6) no longer automatically outranks a prediction.
  Redundant with the filter above when a predictor's coverage is
  broad (e.g. CatPred), but still needed on its own where coverage is
  patchier (DLKcat, EITLEM) -- see the doc for the Crabtree-effect
  mismatch this prevents when paired with the floor alone.

Both changes are opt-out (filter_outlier_kcats=False,
top_origin_limit=6 explicit) rather than removed, so the pre-existing
behaviour stays reachable. Full test suite passes (1435 passed, 1
xfailed, 0 failed); added dedicated tests for the floor filter and
updated the one test whose name and assertion encoded the old
top_origin_limit default as intentional behaviour.
Investigation notes, not part of the public change.
@edkerk
edkerk merged commit fcfb0b8 into develop Sep 23, 2026
5 checks passed
@edkerk
edkerk deleted the investigate/brenda-2026-1-pipeline-delta branch September 23, 2026 16:00
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