Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/migrating_from_gecko_matlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,10 @@ Each row maps a MATLAB function to its geckopy equivalent. The
| `kcatsFromOKP` | `kcats_from_okp` | One OpenKineticsPredictor method, kept as `data/kcats/okp_<method>.tsv`; submits a job when there is none, writes the file once it is done. Returns `(kcat_list, done)`. |
| `saveKcatSource`, `loadKcatSource` | `save_kcat_source`, `load_kcat_source`, `read_kcat_source` | Kcat source files: one per source, keyed by conventional reaction and enzyme set, the same file format in both tools. `load_kcat_source` maps a file to the current model and reports rows that fit no reaction. **`[Py]`** `read_kcat_source` reads a file without a model; GECKO gives the same in `loadKcatSource`'s `report.header` and `report.records`. |
| `getEcRxnKeys` | `ec_rxn_keys` | Conventional reaction and enzyme set per `ec.rxns` entry. |
| `collectKcats` | `collect_kcats` | Decides one kcat per reaction from the source files, as `[kcat_assignment]` in model_adapter.toml sets (preset `gecko_median`, the default, or `gecko_classic`, or stages), without changing the model. Writes `output/<model id>_kcatDecisions.tsv`. |
| `kcatsFromECTree` | `kcats_from_ec_tree` | EC median of the BRENDA measurement table, shrunk toward the EC's 3- and 2-digit classes (weight n / (n + k)), kept as `data/kcats/ec_tree.tsv`. |
| `ecTreeEstimate` | `ECTree.estimate` (`geckopy.gather_kcats.ec_tree`) | The EC-tree value for one or more EC numbers. |
| `loadBrendaMeasurements` | `load_brenda_measurements` | The BRENDA measurement table (`measurements.tsv`): wild-type kcats with an EC number, after the outlier screen. |
| `collectKcats` | `collect_kcats` | Decides one kcat per reaction from the source files, as `[kcat_assignment]` in model_adapter.toml sets (preset `brenda_ec_tree`, the default, `gecko_median` or `gecko_classic`, or stages), without changing the model. Writes `output/<model id>_kcatDecisions.tsv`. |
| `assignKcats` | `assign_kcats` | `collect_kcats`, then sets `ec.kcat` and `ec.source` and applies the kcat constraints; replaces `merge_kcats` → `apply_kcat_list` → `apply_custom_kcats` → `fill_kcats_from_isozymes` → `assign_standard_kcat` → `apply_kcat_constraints`. In place. |
| `updateKcatSources` | `update_kcat_sources` | Gathers the source files the configuration needs that are missing, or outdated against `[kcat_sources.<name>]`; `dry_run` only reports. |

Expand Down
2 changes: 1 addition & 1 deletion hatch_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from hatchling.builders.hooks.plugin.interface import BuildHookInterface

_BRENDA_FILES = ("kcat.tsv", "sa.tsv", "mw.tsv")
_BRENDA_FILES = ("kcat.tsv", "sa.tsv", "mw.tsv", "measurements.tsv")


class BrendaCompressHook(BuildHookInterface):
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,13 @@ geckopy = "geckopy.cli:main"

[tool.hatch.build.targets.wheel]
packages = ["src/geckopy"]
# kcat.tsv/sa.tsv/mw.tsv are shipped xz-compressed instead -- see
# kcat.tsv/sa.tsv/mw.tsv/measurements.tsv are shipped xz-compressed instead -- see
# hatch_build.py and src/geckopy/databases/brenda_loader.py.
exclude = [
"src/geckopy/data/brenda/kcat.tsv",
"src/geckopy/data/brenda/sa.tsv",
"src/geckopy/data/brenda/mw.tsv",
"src/geckopy/data/brenda/measurements.tsv",
]

[tool.hatch.build.targets.wheel.hooks.custom]
Expand Down
2 changes: 2 additions & 0 deletions src/geckopy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
get_standard_kcat, # deprecated; alias of assign_standard_kcat
kcats_from_brenda,
kcats_from_dlkcat,
kcats_from_ec_tree,
kcats_from_okp,
load_kcat_source,
merge_dlkcat_and_fuzzy_kcats, # deprecated; alias of merge_kcats
Expand Down Expand Up @@ -205,6 +206,7 @@
"fuzzy_kcat_matching",
"kcats_from_brenda",
"kcats_from_dlkcat",
"kcats_from_ec_tree",
"kcats_from_okp",
"load_kcat_source",
"merge_dlkcat_and_fuzzy_kcats", # deprecated; alias of merge_kcats
Expand Down
2 changes: 1 addition & 1 deletion src/geckopy/adapter/adapterParameters.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ okp.method okp.method "CataPro" OpenKineticsPredictor method
okp.handle_long_sequences okp.handleLongSequences "truncate" How OpenKineticsPredictor handles sequences that are too long
okp.include_similarity_columns okp.includeSimilarityColumns true Return similarity to the method's training data
okp.canonicalize_substrates okp.canonicalizeSubstrates true Canonicalize substrate SMILES before prediction
kcat_assignment.preset Kcat assignment preset: gecko_median (used when neither preset nor stages are given) or gecko_classic
kcat_assignment.preset Kcat assignment preset: brenda_ec_tree (used when neither preset nor stages are given), gecko_median or gecko_classic
kcat_assignment.isozymes true Fill reactions without a kcat from their isozymes after the stages
kcat_assignment.standard true Give the remaining reactions the standard kcat
kcat_assignment.stage Stages instead of a preset: action, sources, criteria and BRENDA limits ([[kcat_assignment.stage]])
Expand Down
4 changes: 2 additions & 2 deletions src/geckopy/adapter/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ class KcatAssignmentParams(BaseModel):
"""How kcats are assigned from the kcat source files (``collect_kcats``)."""
model_config = ConfigDict(extra="forbid")

preset: Optional[Literal["gecko_classic", "gecko_median"]] = Field(
preset: Optional[Literal["gecko_classic", "gecko_median", "brenda_ec_tree"]] = Field(
default=None,
description=(
"Kcat assignment preset; gecko_median is used when neither a preset nor "
"Kcat assignment preset; brenda_ec_tree is used when neither a preset nor "
"stages are given."
),
)
Expand Down
Loading
Loading