Repository navigation
Conversation
GECKO (MATLAB) now reads model_adapter.toml as well. Two sections make that possible without code in an adapter class: - [spontaneous]: name_contains and/or file set which reactions are spontaneous; the default get_spontaneous_reactions reads them. - [matlab]: settings that only GECKO reads (function names for anaerobic conditions and protein content, and [matlab.params]); geckopy accepts and ignores them. adapterParameters.tsv, the table GECKO uses to map keys to its MATLAB field names and defaults, is shipped here too, and a test checks it against the schema.
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.
…eat/kcat-assignment
collect_kcats 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. assign_kcats applies the decisions and the kcat constraints. update_kcat_sources 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 gives the same model as before, with the gecko_median stages and the BRENDA maximum.
This branch has not been deployed
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 are assigned from the kcat source files in
data/kcats(#64), in an order thatmodel_adapter.tomlsets. GECKO has the same functions and settings (CompMetEng/GECKO#9). This is step K2 of the plan in CompMetEng/raven-gecko-parity#134.Builds on #61 (shared
model_adapter.toml) and #64 (kcat source files); the diff shows their changes until they are merged.Functions
collect_kcatsoutput/<model id>_kcatDecisions.tsv(stage, source, kcat, number of values and their spread per reaction)assign_kcatsmerge_kcats→apply_kcat_list→apply_custom_kcats→fill_kcats_from_isozymes→assign_standard_kcat→apply_kcat_constraints, which stay callableupdate_kcat_sourceskcats_from_brenda,kcats_from_dlkcat,kcats_from_okp) when they are missing, or when their header records other settings or another BRENDA release than asked;dry_run=Trueonly reportsConfiguration
[kcat_assignment]and[kcat_sources.<name>]inmodel_adapter.toml, validated byKcatAssignmentParamsandKcatStageParams;adapterParameters.tsvis the same file as GECKO's.merge_kcats). Sources are source file names and the BRENDA tiersdatabase_exact,database_topanddatabase_bottom, which readbrenda.tsv.data/kcats/custom.tsv,data/customKcats.tsvis applied as before.Presets
gecko_median(default)gecko_classicThe order of
gecko_mediancomes from comparing each BRENDA tier with DLKcat on measured kcats hidden from the search: the BRENDA median was as close or closer at every origin without wildcards, and the maximum was further off than the median in every tier. Specific-activity matches rank below DLKcat as in #58. The figures are in CompMetEng/raven-gecko-parity#134.Tutorial
full_ecModeluseskcats_from_brenda,kcats_from_dlkcatandassign_kcatsfor STEP 18–31. Itsmodel_adapter.tomlgives thegecko_medianstages, andkcats_from_brendatakes the BRENDA maximum fromkcat_aggregate_brenda, so the ecModel is identical to the one the previous steps gave: 4842ec.rxns, the sameec.kcat,ec.sourceand stoichiometry.Tests
tests/test_kcat_assignment.py: both presets against the chain of functions they replace,collect_kcatsleaving the model unchanged,custom.tsvdeciding first, stages from TOML and their errors, andupdate_kcat_sourcesgathering missing and outdated files only. The new functions are exported fromgeckopyandgeckopy.gather_kcatsand listed indocs/migrating_from_gecko_matlab.md.