Repository navigation
BRENDA: filter implausible SA-derived kcats; default top_origin_limit 6 -> 4 - #58
Merged
Merged
Conversation
…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.
edkerk
force-pushed
the
investigate/brenda-2026-1-pipeline-delta
branch
from
September 23, 2026 10:17
b9d0f98 to
79b75a0
Compare
This was referenced Sep 23, 2026
Investigation notes, not part of the public change.
This was referenced Oct 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_datagainsfilter_outlier_kcats(defaultTrue): 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 (andmerge_dlkcat_and_fuzzy_kcats's)top_origin_limitdefault 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.