Repository navigation
Keep gathered kcats as kcat source files, one per source - #64
Merged
Merged
Conversation
edkerk
force-pushed
the
feat/kcat-source-files
branch
2 times, most recently
from
October 16, 2026 10:43
fc86422 to
b2dbe52
Compare
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. GECKO reads and writes the same files. - kcats_from_brenda, kcats_from_dlkcat and kcats_from_okp 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. - save_kcat_source writes any kcat list; read_kcat_source reads a file; load_kcat_source 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. - ec_rxn_keys gives the conventional reaction and enzyme set of every model.ec reaction. - fuzzy_kcat_matching takes an explicit adapter, and fetch_open_kinetics_predictor the file to store the result in.
edkerk
force-pushed
the
feat/kcat-source-files
branch
from
October 16, 2026 10:47
b2dbe52 to
9d04f8e
Compare
This was referenced Oct 16, 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.
Gathered kcats are kept in the project as kcat source files, one per source:
data/kcats/<source>.tsv. Rows are keyed by conventional reaction and enzyme set, not bymodel.ec.rxns, so a file stays valid when the ecModel is rebuilt and applies to full and light models alike. GECKO reads and writes the same files (SysBioChalmers/GECKO#488). This is step K1 of the plan in CompMetEng/raven-gecko-parity#134.Gathering, one function per source
kcats_from_brendaaggregation,force_wildcard_level,ec_rxns. It loads the BRENDA data and KEGG distances from the adapter unlessbrendaandphyl_distare given, and passes the adapter on tofuzzy_kcat_matching(newadapterargument)kcats_from_dlkcatrun=Trueit writes the input and runs the Docker image; otherwise it reads an earlier output. A run records the reactions it covered indata/DLKcat_run.txtkcats_from_okp(kcat_list, done)OKP jobs per method
data/OKP_job_<method>.txtand its own result indata/OKP_output_<method>.csv; the file isokp_<method>.tsv.use_stored=Trueonly uses a result of the current job, andresubmit=Trueremoves the earlier result.fetch_open_kinetics_predictorstored by itself (data/OKP_output.csv) is taken over only when its job is for the method and its predictions are labelled with that method.fetch_open_kinetics_predictorgets anout_fileargument for this.Writing, for all three
save=Falsewrites nothing;save_asnames another file.ec_rxns) that replaces the file logs a warning.File functions
save_kcat_source(model, kcat_list, name)writes any kcat list:It never writes
custom.tsv, or a file whose header sayskind: curatedorsource: custom, in any case.read_kcat_source(path)reads a file without a model:5,5reads as missing;load_kcat_source(model, name)maps rows tomodel.ec: by reaction and enzyme set, by enzyme set only, or by reaction only. It reports, with the file's line number:ec_rxn_keys(model)gives the conventional reaction and enzyme set of everymodel.ecreaction.All are exported from
geckopyandgeckopy.gather_kcats;docs/migrating_from_gecko_matlab.mdlists them with their GECKO names.Limit: for nested gene rules such as
A and (B or C), the light model splits enzymes differently from the full model, so a file written from one may fit the other only partly; the unmatched rows are reported.Tests:
tests/test_kcat_sources.py:ec_rxnswithout a new job.The full suite passes (1,476 passed;
develophas 1,447).The functions that combine the source files into
ec.kcat(collect_kcats,assign_kcats,update_kcat_sources) follow in K2.