Skip to content

Estimate kcats from the EC tree; make brenda_ec_tree the default preset - #67

Merged
edkerk merged 1 commit into
developfrom
feat/kcat-ec-tree
Oct 17, 2026
Merged

edkerk merged 1 commit into
developfrom
feat/kcat-ec-tree

Conversation

@edkerk

@edkerk edkerk commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Kcats can now come from the EC tree, and the default kcat assignment preset is brenda_ec_tree: custom kcats, the organism's own BRENDA value, the EC tree, then DLKcat. GECKO has the same (CompMetEng/GECKO#10). This is step K4a of the plan in CompMetEng/raven-gecko-parity#134.

BRENDA measurement table

src/geckopy/data/brenda/measurements.tsv (xz-compressed in the wheel, as kcat.tsv) holds one row per wild-type kcat measurement in BRENDA 2026.1 with an EC number:

  • 57,037 rows, with EC number, substrate (name and InChIKey), organism, UniProt accession and sequence id, kcat, temperature, pH and PubMed id;
  • kcat in 1/s, the geometric midpoint for a range;
  • values more than four orders of magnitude below their EC class, and clusters of values below 0.01 /s that sit three orders of magnitude under the other values of their EC number, are left out as unit errors (423 values).

load_brenda_measurements reads it. kcats_from_ec_tree uses the table of the adapter's BRENDA folder, and geckopy's own when a project's data/brenda has none.

EC tree

geckopy.gather_kcats.ec_tree.ECTree gives an EC number the median log10 kcat of its measurements, from any organism and substrate, pulled toward its parent EC classes with weight n / (n + k):

value = median of all measurements
for level in (2-digit, 3-digit, 4-digit EC):
    w     = n / (n + k)               # n = measurements at that level, k = 5
    value = w * median(level) + (1 - w) * value

A well-measured EC keeps its own median; a sparsely measured one leans on its class. A reaction with several EC numbers uses the one with most measurements.

kcats_from_ec_tree writes the values to data/kcats/ec_tree.tsv, with the number of measurements and the deepest EC level used in the detail column. Reactions without an EC number, or whose EC classes have no measurements, get no value. save_kcat_source takes further detail pairs from a detail column.

Preset brenda_ec_tree, now the default

Order Source
1 custom kcats
2 BRENDA median of measurements of the organism on the reaction's substrate (origin 1, no EC wildcard)
3 EC tree
4 DLKcat, for reactions without an EC number
then isozymes, standard kcat

It is the default when [kcat_assignment] is left out; gecko_median and gecko_classic stay available, and the full_ecModel tutorial keeps its own stages. update_kcat_sources gathers ec_tree.tsv and marks it outdated for another k or another BRENDA release.

Why this order

Against measured kcats hidden from the search (enzyme–substrate pairs whose own measurements and those of sequences at ≥ 95% identity are hidden), the EC tree was closer than the GECKO median at origins 2 and 4 and with EC wildcards, by 0.13 to 0.18 log10, and as close at origins 1 and 3. DLKcat was not closer than the BRENDA median at any origin. The organism's own measurement comes first because, in a model, it is often a measurement of that very enzyme. The figures are in CompMetEng/raven-gecko-parity#134.

On the yeast tutorial model before tuning:

Preset Geometric mean kcat (/s) Standard kcat Maximum growth (/h)
gecko_classic 12.7 259 0.082
gecko_median 3.8 259 0.081
brenda_ec_tree 5.3 259 0.082

With brenda_ec_tree, 3,574 reactions take the EC tree, 577 DLKcat and 210 the organism's own BRENDA value.

Tests

tests/test_ec_tree.py:

  • a worked example whose values are computed by hand, the same as GECKO's;
  • the shipped measurement table;
  • the file kcats_from_ec_tree writes, also from geckopy's own table;
  • the default preset, its order of sources, and update_kcat_sources for another k.

ECTree gives the same values as the kcat benchmark's EC tree on all 2,114 EC numbers of its queries, and as GECKO's ecTreeEstimate on 4,885 EC numbers and combinations.

measurements.tsv, next to the BRENDA kcat, sa and mw files, holds the
wild-type BRENDA kcats with an EC number after the outlier screen, one row
per measurement. kcats_from_ec_tree gives each reaction the median kcat of
its EC number, shrunk toward its 3- and 2-digit EC classes with weight
n / (n + k), and keeps it as data/kcats/ec_tree.tsv (ECTree,
load_brenda_measurements). save_kcat_source takes further detail pairs from a
detail column.

The brenda_ec_tree preset, now the default, orders custom kcats, the
BRENDA median of measurements of the organism on the reaction's substrate
(origin 1), the EC tree, then DLKcat for reactions without an EC number.
update_kcat_sources gathers ec_tree.tsv and marks it outdated for another k
or BRENDA release.
@edkerk
edkerk merged commit 7a2e4fc into develop Oct 17, 2026
5 checks passed
@edkerk
edkerk deleted the feat/kcat-ec-tree branch October 17, 2026 21:42
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