Top-level (Python)#

geckopy objects in geckopy.

Functions#

Function

Summary

cmd_brenda_refresh

cmd_init

cmd_kegg_download

cmd_uniprot_download

cmd_upgrade

List, or with --apply carry out, the steps that bring a GECKO 3

convert_custom_kcats

Convert data/customKcats.tsv into data/kcats/custom.tsv.

main

upgrade_ec_model

Turn the protein usage and pool reactions of a GECKO 3 ecModel forward.

upgrade_project

Bring a GECKO 3 project to the GECKO 4 layout (geckopy upgrade).

Reference#

cmd_brenda_refresh#

cmd_brenda_refresh(args: argparse.Namespace)

cmd_init#

cmd_init(args: argparse.Namespace)

cmd_kegg_download#

cmd_kegg_download(args: argparse.Namespace)

cmd_uniprot_download#

cmd_uniprot_download(args: argparse.Namespace)

cmd_upgrade#

cmd_upgrade(args: argparse.Namespace)

List, or with --apply carry out, the steps that bring a GECKO 3

project to the GECKO 4 layout (see geckopy.upgrade.upgrade_project).

convert_custom_kcats#

convert_custom_kcats(model: 'EcModel', *, custom_kcats: Optional[str | Path]=None, out_file: Optional[str | Path]=None, adapter: Optional['ModelAdapter']=None)

Convert data/customKcats.tsv into data/kcats/custom.tsv.

The kcats are those geckopy.ec_model.pipeline.apply_custom_kcats gives the ecModel, including which of two entries for the same reaction wins: one row per reaction, keyed by conventional reaction and enzyme set (see geckopy.gather_kcats.ec_rxn_keys), with the entry's notes in the note column. The stoicho column is left out: complex stoichiometry comes from apply_complex_data. Unlike apply_custom_kcats, custom.tsv also applies to light ecModels.

Parameters

model

The full ecModel the custom kcats are for.

custom_kcats, out_file

The file to convert and the file to write (default: data/customKcats.tsv and data/kcats/custom.tsv in the project). An existing out_file is not overwritten.

adapter

Model adapter (default: model.adapter).

Returns

(path, report)

The file written, and a report with rows (rows written).

main#

main(argv: list[str] | None=None)

upgrade_ec_model#

upgrade_ec_model(model: 'EcModel')

Turn the protein usage and pool reactions of a GECKO 3 ecModel forward.

GECKO 3 defined usage_prot_<id> (prot_<id> -> prot_pool) and prot_pool_exchange (prot_pool ->) in the reverse direction, used with negative flux; GECKO 4 defines them forward. Each reaction that is still reverse gets the opposite stoichiometry, bounds and objective coefficient; calling it again changes nothing. In place. geckopy.load_ec_model already does this for the files it reads; this is for models from other sources, such as SBML.

Returns

list of str

The reactions that were turned.

upgrade_project#

upgrade_project(project: str | Path, *, dry_run: bool=True, ec_model: Optional['EcModel']=None)

Bring a GECKO 3 project to the GECKO 4 layout (geckopy upgrade).

Lists, and with dry_run=False carries out:

  1. custom kcats: data/customKcats.tsv becomes data/kcats/custom.tsv (convert_custom_kcats);

  2. stored predictions: data/DLKcat.tsv and stored OpenKineticsPredictor results become kcat source files (kcats_from_dlkcat, kcats_from_okp with use_stored), without running anything;

  3. saved ecModels: models/*.yml ecModels made with GECKO 3 get their protein reactions turned forward (upgrade_ec_model);

  4. project_format = 4 in model_adapter.toml;

  5. scripts: lines of the project's .py files that call renamed or replaced functions are listed, not changed.

Steps 1 and 2 need the full ecModel the custom kcats and predictions are for (ec_model); without it they are listed and skipped. A project with an adapter class instead of model_adapter.toml is converted by GECKO's upgradeGECKOproject. A file that is replaced or converted is first moved to legacy/<yyyy-mm-dd>/, keeping its place in the folder tree. Steps already done are left out, so it can run again.

Returns

pandas.DataFrame

One row per step: step, status (to do, done, skipped, failed, by hand) and note.