Repository navigation
Estimate kcats from the EC tree; make brenda_ec_tree the default preset - #10
Merged
Merged
Conversation
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
…t-assignment Original-commit: SysBioChalmers/GECKO@ed138e1
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
# Conflicts: # test/VerificationMatrix.tsv
Unit test results61 tests 61 ✅ 11s ⏱️ Results for commit 776e9fd. ♻️ This comment has been updated with latest results. |
# 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
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.
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.tsvholds one row per wild-type kcat measurement in BRENDA 2026.1 with an EC number:loadBrendaMeasurementsreads it from the BRENDA folder of the model adapter.EC tree
ecTreeEstimategives 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):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.
kcatsFromECTreewrites the values todata/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.saveKcatSourcetakes further detail pairs from adetailfield.Preset
brenda_ec_tree, now the defaultIt is the default when
[kcat_assignment]is left out and inadapterTemplate.toml;gecko_medianandgecko_classicstay available, and thefull_ecModeltutorial keepsgecko_classic.updateKcatSourcesgathersec_tree.tsvand marks it outdated for anotherkor 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:
gecko_classicgecko_medianbrenda_ec_treeWith
brenda_ec_tree, 3,574 reactions take the EC tree, 577 DLKcat and 210 the organism's own BRENDA value.Tests
ecTreeTests(tc0084–tc0087):kcatsFromECTreewrites;updateKcatSourcesfor anotherk.ecTreeEstimategives the same values as geckopy'sECTreeon 4,885 EC numbers and combinations from the measurement table.