Repository navigation
Keep gathered kcats as kcat source files, one per source - #3
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
Unit test results61 tests 61 ✅ 9s ⏱️ Results for commit 4f06b59. ♻️ This comment has been updated with latest results. |
edkerk
force-pushed
the
feat/kcat-source-files
branch
from
October 16, 2026 23:52
d4261f8 to
9f7a12f
Compare
…iles # Conflicts: # test/VerificationMatrix.tsv
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.
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.
Copied from SysBioChalmers/GECKO#488, opened by edkerk on 2026-10-16.
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. geckopy reads and writes the same files (CompMetEng/geckopy#64). This is step K1 of the plan in CompMetEng/raven-gecko-parity#134.Gathering, one function per source
kcatsFromBrendafuzzyKcatMatching)aggregation,forceWClvl,ecRxns; the BRENDA release goes in the file headerkcatsFromDLKcat'run', trueit writes the input and runs the Docker image (checking that Docker is there, with runDLKcat's macOS path fix); otherwise it reads an earlier output. A run records the reactions it covered indata/DLKcat_run.txtkcatsFromOKPOKP jobs per method
data/OKP_job_<method>.txtand its own result indata/OKP_output_<method>.csv; the file isokp_<method>.tsv.'useStored', trueonly uses a result of the current job, and'resubmit', trueremoves the earlier result.fetchOpenKineticsPredictorstored 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.fetchOpenKineticsPredictorgets anoutFileoption for this.Writing, for all three
'save', falsewrites nothing;'saveAs'names another file.ecRxns) and the default name, a warning says the file is replaced.File functions
saveKcatSource(model, kcatList, name)writes any kcat list:It never writes
custom.tsv, or a file whose header sayskind: curatedorsource: custom, in any case.loadKcatSource(model, name)reads a file and maps its rows tomodel.ec: by reaction and enzyme set, by enzyme set only, or by reaction only.5,5reads as missing instead of 55; a row with extra fields, or a duplicate or reserved column name, is an error.report.headerandreport.recordsgive the header lines and the rows as read.getEcRxnKeys(model)gives the conventional reaction and enzyme set of everymodel.ecreaction.Helpers are local functions of the functions that use them; there is no
privatefolder.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:
test/unit_tests/kcatSourceTests.m(tc0070–tc0078):kcatsFromOKP, including a result of another method and a result of an earlier job;All unit tests pass (MATLAB R2023a, RAVEN
develop, GLPK). At 60,000 reactions, getting the keys takes 0.8 s, saving 5.0 s and loading, reading included, 6.8 s. A file written by GECKO reads the same in geckopy and the other way round.The functions that combine the source files into
ec.kcat(collectKcats,assignKcats,updateKcatSources) follow in K2.