Skip to content

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

Merged
edkerk merged 11 commits into
developfrom
feat/kcat-ec-tree
Oct 17, 2026
Merged

edkerk merged 11 commits into
developfrom
feat/kcat-ec-tree

Conversation

@edkerk

@edkerk edkerk commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

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. geckopy has the same (CompMetEng/geckopy#67). This is step K4a of the plan in CompMetEng/raven-gecko-parity#134.

BRENDA measurement table

databases/measurements.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).

loadBrendaMeasurements reads it from the BRENDA folder of the model adapter.

EC tree

ecTreeEstimate 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.

kcatsFromECTree 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. saveKcatSource takes further detail pairs from a detail field.

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 and in adapterTemplate.toml; gecko_median and gecko_classic stay available, and the full_ecModel tutorial keeps gecko_classic. updateKcatSources 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

ecTreeTests (tc0084–tc0087):

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

ecTreeEstimate gives the same values as geckopy's ECTree on 4,885 EC numbers and combinations from the measurement table.

edkerk added 10 commits October 16, 2026 12:43
Gathered kcats are written to data/kcats/<source>.tsv in the project,
keyed by conventional reaction and enzyme set rather than model.ec.rxns,
so a file stays valid when the ecModel is rebuilt and applies to full and
light models alike. geckopy reads and writes the same files.

- kcatsFromBrenda, kcatsFromDLKcat and kcatsFromOKP gather one source each,
  with that source's own options, and write its file. OKP keeps a job and
  a result per method, and only uses a stored result of the current job.
- saveKcatSource writes any kcat list; readKcatSource reads a file;
  loadKcatSource maps a file to a model and reports rows with an invalid
  kcat, rows that fit no reaction, and rows that match only part of an
  enzyme set.
- getEcRxnKeys gives the conventional reaction and enzyme set of every
  model.ec reaction.
- fetchOpenKineticsPredictor takes the file to store the result in.

Original-commit: SysBioChalmers/GECKO@f3a696c
collectKcats decides one kcat per reaction from the files in data/kcats,
in the stages of [kcat_assignment] (a preset, or [[kcat_assignment.stage]]
tables), without changing the model, and writes
output/<model id>_kcatDecisions.tsv. assignKcats applies the decisions and
the kcat constraints. updateKcatSources gathers the source files the
configuration needs that are missing, or outdated against
[kcat_sources.<name>].

The default preset, gecko_median, orders custom kcats, the BRENDA median
of matches without EC wildcards at origins 1 to 4, DLKcat, then the other
BRENDA matches. gecko_classic keeps the GECKO 3 order with the BRENDA
maximum; the full_ecModel tutorial uses it and gives the same model as
before.
…iles

# Conflicts:
#	test/VerificationMatrix.tsv
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. kcatsFromECTree 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 (ecTreeEstimate,
loadBrendaMeasurements). saveKcatSource takes further detail pairs from a
detail field.

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.
updateKcatSources gathers ec_tree.tsv and marks it outdated for another k
or BRENDA release.
loadKcatSource reads the file itself and returns the header lines and the
rows as read in report.header and report.records; readKcatSource is gone.
The helpers of src/gather_kcats/private are local functions of the
functions that use them. kcatsFrom<Source> no longer check the file name
before gathering; saveKcatSource does when it writes.
…t/kcat-assignment

# Conflicts:
#	test/VerificationMatrix.tsv
# Conflicts:
#	src/gather_kcats/kcatAssignmentConfig.m
#	test/VerificationMatrix.tsv
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Unit test results

61 tests   61 ✅  11s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit 776e9fd.

♻️ This comment has been updated with latest results.

Base automatically changed from feat/kcat-assignment to develop October 17, 2026 21:40
# Conflicts:
#	src/gather_kcats/collectKcats.m
#	src/gather_kcats/kcatAssignmentConfig.m
#	src/gather_kcats/updateKcatSources.m
#	src/model_adapter/adapterParameters.tsv
#	src/model_adapter/adapterTemplate.toml
#	test/VerificationMatrix.tsv
#	test/unit_tests/kcatAssignmentTests.m
@edkerk
edkerk merged commit 8807941 into develop Oct 17, 2026
2 checks passed
@edkerk
edkerk deleted the feat/kcat-ec-tree branch October 17, 2026 21:44
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