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
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
*.txt text eol=lf
*.xml text eol=lf
*.md text eol=lf

# A fixture that must keep its byte-order mark and CRLF line endings.
tests/data/kcatSourceFixture.tsv -text
5 changes: 5 additions & 0 deletions docs/migrating_from_gecko_matlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ Each row maps a MATLAB function to its geckopy equivalent. The
| `fetchOpenKineticsPredictor` | `fetch_open_kinetics_predictor` | **`[3→4]`** New REST-based fetch (replaced `readOpenKineticsPredictorOutput`); per-row `kcatSource` reports actual provenance (CataPro / BRENDA / Sabio-RK). |
| `writeOpenKineticsPredictorInput` | *(removed)* | **`[3→4]`** Replaced by `submit_open_kinetics_predictor`. |
| `readOpenKineticsPredictorOutput` | *(removed)* | **`[3→4]`** Replaced by `fetch_open_kinetics_predictor`. |
| `kcatsFromBrenda` | `kcats_from_brenda` | Fuzzy BRENDA matching, kept as `data/kcats/brenda.tsv`. Loads the BRENDA data and KEGG distances from the adapter unless passed in. |
| `kcatsFromDLKcat` | `kcats_from_dlkcat` | DLKcat (run in Docker with `run=True`, or an earlier output), kept as `data/kcats/dlkcat.tsv`. |
| `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`, `readKcatSource`, `loadKcatSource` | `save_kcat_source`, `read_kcat_source`, `load_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. |
| `getEcRxnKeys` | `ec_rxn_keys` | Conventional reaction and enzyme set per `ec.rxns` entry. |

### 5.3 Get enzyme data (`src/geckomat/get_enzyme_data`)

Expand Down
12 changes: 12 additions & 0 deletions src/geckopy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,17 @@
fetch_open_kinetics_predictor,
fuzzy_kcat_matching,
get_standard_kcat, # deprecated; alias of assign_standard_kcat
kcats_from_brenda,
kcats_from_dlkcat,
kcats_from_okp,
load_kcat_source,
merge_dlkcat_and_fuzzy_kcats, # deprecated; alias of merge_kcats
merge_kcats,
read_dlkcat_output,
read_kcat_source,
remove_standard_kcat,
run_dlkcat,
save_kcat_source,
select_kcat_value, # deprecated; alias of apply_kcat_list
submit_open_kinetics_predictor,
write_dlkcat_input,
Expand Down Expand Up @@ -186,11 +192,17 @@
"assign_standard_kcat",
"fetch_open_kinetics_predictor",
"fuzzy_kcat_matching",
"kcats_from_brenda",
"kcats_from_dlkcat",
"kcats_from_okp",
"load_kcat_source",
"merge_dlkcat_and_fuzzy_kcats", # deprecated; alias of merge_kcats
"merge_kcats",
"read_dlkcat_output",
"read_kcat_source",
"remove_standard_kcat",
"run_dlkcat",
"save_kcat_source",
"submit_open_kinetics_predictor",
"write_dlkcat_input",
# get_enzyme_data
Expand Down
9 changes: 9 additions & 0 deletions src/geckopy/gather_kcats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
Mirrors GECKO MATLAB's `src/geckomat/gather_kcats/` directory.
"""
from .fuzzy_kcat_matching import fuzzy_kcat_matching
from .kcat_sources import ec_rxn_keys, load_kcat_source, read_kcat_source, save_kcat_source
from .kcats_from import kcats_from_brenda, kcats_from_dlkcat, kcats_from_okp
from .get_standard_kcat import assign_standard_kcat, get_standard_kcat
from .merge_dlkcat_and_fuzzy_kcats import merge_dlkcat_and_fuzzy_kcats
from .merge_kcats import merge_kcats, normalize_source
Expand All @@ -27,17 +29,24 @@
"OKPError",
"apply_kcat_list",
"assign_standard_kcat",
"ec_rxn_keys",
"extract_enzyme_substrate_pairs",
"fetch_open_kinetics_predictor",
"format_kcat_source",
"fuzzy_kcat_matching",
"get_standard_kcat", # deprecated; alias of assign_standard_kcat
"kcats_from_brenda",
"kcats_from_dlkcat",
"kcats_from_okp",
"load_kcat_source",
"merge_dlkcat_and_fuzzy_kcats", # deprecated; use merge_kcats
"merge_kcats",
"normalize_source",
"read_kcat_source",
"read_dlkcat_output",
"remove_standard_kcat",
"run_dlkcat",
"save_kcat_source",
"select_kcat_value", # deprecated; alias of apply_kcat_list
"submit_open_kinetics_predictor",
"write_dlkcat_input",
Expand Down
7 changes: 6 additions & 1 deletion src/geckopy/gather_kcats/fuzzy_kcat_matching/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
from ._organism import filter_by_organism, resolve_organism_index

if TYPE_CHECKING:
from ...adapter import ModelAdapter
from ...databases import BrendaData, PhylDist
from ...ec_model.ec_model import EcModel

Expand Down Expand Up @@ -81,6 +82,7 @@ def fuzzy_kcat_matching(
ec_rxns: Optional[Iterable[str]] = None,
force_wildcard_level: int = 0,
aggregate: Optional[str] = None,
adapter: Optional["ModelAdapter"] = None,
) -> pd.DataFrame:
"""Match each ec reaction to BRENDA kcat data with progressive
relaxation of EC, substrate, and organism specificity.
Expand Down Expand Up @@ -161,6 +163,9 @@ def fuzzy_kcat_matching(
across whichever rows survive the EC + organism + substrate
gates. See ``docs/kcat_aggregation.md`` for the empirical
rationale.
adapter
Model adapter for ``org_name`` and the aggregation default
(default: ``model.adapter``).

Returns
-------
Expand All @@ -182,7 +187,7 @@ def fuzzy_kcat_matching(
"""
from ...adapter import resolve_adapter
adapter = resolve_adapter(
model,
model, adapter,
purpose="fuzzy_kcat_matching reads params.org_name from the adapter",
)
if force_wildcard_level < 0:
Expand Down
Loading
Loading