Model adapter parameters#
model_adapter.toml in the project folder holds the parameters of a GECKO 4 project. GECKO (MATLAB) and geckopy (Python) read the same file. The section overview is in Project format 4. The tables give the parameters, their defaults and the MATLAB name of each parameter. The defaults are those of src/model_adapter/adapterParameters.tsv of GECKO, which geckopy uses as well.
Reading the file#
Paths in the file are relative to the project folder. A key that is left out gets the default of the tables. A key that the tables do not list is an error in both toolboxes; a parameter that GECKO alone uses goes under [matlab.params]. The project folder is the folder of the file, so path is no key.
ModelAdapterManager.setDefault(projectPath);
from geckopy import ModelAdapter
adapter = ModelAdapter.from_folder(project_path)
ModelAdapterManager.setDefault makes the adapter the default of all GECKO functions that take the option modelAdapter. In geckopy, adapter.params holds the parameters under the TOML key names, and an ecModel made with make_ec_model carries the adapter as ec_model.adapter.
The full_ecModel tutorial uses these entries:
conv_gem = "models/yeast-GEM.yml"
org_name = "saccharomyces cerevisiae"
sigma = 0.5
p_tot = 0.5
f = 0.5
gr_exp = 0.41
c_source = "r_1714"
bio_rxn = "r_4041"
enzyme_comp = "cytoplasm"
[kegg]
id = "sce"
gene_id = "kegg"
[uniprot]
type = "proteome"
id = "UP000002311"
gene_id_field = "gene_oln"
reviewed = true
[complex]
taxonomic_id = 559292
[spontaneous]
name_contains = "spontaneous"
Model and protein pool#
TOML key |
MATLAB parameter |
Default |
Description |
|---|---|---|---|
|
|
none |
Layout version of the project folder. |
|
|
none (required in geckopy) |
Path to the starting conventional GEM file, for example |
|
|
none (required in geckopy) |
Scientific name of the organism, used by |
|
|
|
Average enzyme saturation factor |
|
|
|
Total protein content in the cell [g protein/gDW] |
|
|
|
Fraction of enzymes in the ecModel relative to all proteins (g enzyme/g protein). |
|
|
|
Reference (experimentally observed) maximum growth rate in h^-1, the default tuning target in Growth-rate tuning |
|
|
|
Identifier of the exchange reaction of glucose or of another preferred carbon source |
|
|
|
Identifier of the biomass or growth pseudoreaction, whose flux is the growth rate in h^-1 |
|
|
|
Name of the compartment of the added protein pseudometabolites; must match one of the compartment names of the ecModel |
Kcat aggregation#
TOML key |
MATLAB parameter |
Default |
Description |
|---|---|---|---|
|
|
|
BRENDA aggregate ( |
|
none |
|
Used by geckopy. Aggregation of several candidate kcats of one reaction in |
|
none |
|
Used by geckopy. Aggregation of the kcats of the isozymes in |
GECKO accepts the two geckopy keys in the file and does not use them. getKcatAcrossIsozymes uses the mean.
Database identifiers#
TOML key |
MATLAB parameter |
Default |
Description |
|---|---|---|---|
|
|
|
Organism code in the KEGG database, from the KEGG organism list |
|
|
|
Field of the KEGG entry that matches the gene identifiers of the ecModel. |
|
|
|
Whether |
|
|
|
Identifier of the UniProt data set (by taxonomy or proteome) with complete coverage of the genes of the ecModel |
|
|
|
UniProt field with the gene identifiers used in the ecModel; one of the "Returned Field" entries under "Names & Taxonomy" of the UniProt return fields |
|
|
|
Whether the data is limited to reviewed (Swiss-Prot) entries. Reviewed data has the highest confidence but can have low coverage for non-model organisms |
|
|
none |
Taxonomy identifier as available from the Complex Portal. Without it, no Complex Portal query is made |
Spontaneous reactions#
TOML key |
MATLAB parameter |
Default |
Description |
|---|---|---|---|
|
|
none |
Reactions whose name contains this text are spontaneous |
|
|
none |
TSV of spontaneous reactions, relative to the project folder: a header row, reaction identifiers in the first column and, optionally, a second column in which |
A reaction is spontaneous when either rule matches. getStandardKcat (Python: assign_standard_kcat) gives spontaneous reactions no standard kcat.
Kcat assignment#
TOML key |
MATLAB parameter |
Default |
Description |
|---|---|---|---|
|
|
|
One of |
|
|
|
Fill reactions without a kcat from their isozymes after the stages |
|
|
|
Give the remaining reactions the standard kcat |
|
|
none |
Stages in place of a preset, written as |
|
|
none |
Settings of one source file, for example |
A stage has the keys action (select, the default, or combine), sources, criteria (max, min, median or mean; default max), top_origin_limit (default 4), bottom_origin_limit (default 6) and wildcard_limit (default 3). Kcat assignment describes the presets and the stages.
Kcat tuning#
The [evotune] section holds the hyperparameters of the CMA-ES kcat tuning described in Tuning against experimental data.
TOML key |
MATLAB parameter |
Default |
Description |
|---|---|---|---|
|
|
|
Prior standard deviation (log) of the kcats whose source is in no group |
|
|
none |
Trust tiers: a table |
|
|
none |
Prior standard deviation (log) per group; the keys are the group names of |
|
|
|
The search stops when the best RMSE reaches this value |
|
|
|
Maximum number of CMA-ES generations |
|
|
|
Weight of the maximum-growth RMSE against the flux RMSE |
|
|
|
Weight of the prior term in the search objective |
|
|
|
Give the isozyme copies of one reaction a single kcat |
When [evotune] has no source_groups, the groups are dlkcat, brenda and custom, each with the source of the same name, and sigma0_log_source is 0.4, 0.2 and 0.1.
OpenKineticsPredictor#
TOML key |
MATLAB parameter |
Default |
Description |
|---|---|---|---|
|
|
|
OpenKineticsPredictor method |
|
|
|
How OpenKineticsPredictor handles sequences that are too long |
|
|
|
Return the similarity to the training data of the method |
|
|
|
Canonicalise substrate SMILES before the prediction |
The API key is no parameter. It is an argument of the functions, the environment variable OKP_API_KEY or the file data/okpApiKey.txt.
MATLAB functions#
TOML key |
MATLAB parameter |
Default |
Description |
|---|---|---|---|
|
|
none |
Name of a MATLAB function that constrains the ecModel to anaerobic growth |
|
|
none |
Name of a MATLAB function that changes the protein content of the biomass; it receives the ecModel and the protein content |
|
the parameter name |
none |
Parameters that GECKO uses and geckopy does not use, kept under their MATLAB names |
geckopy ignores the [matlab] section. The functions are searched on the MATLAB path, to which the code folder of the project is added.
Adapter classes#
A GECKO 3 adapter class keeps working. It sets obj.params with the MATLAB names of the tables above, and ModelAdapterManager.setDefault takes the path of its .m file. convertAdapterToToml writes the parameters of a class as model_adapter.toml and lists the methods that the class overrides and the file cannot carry. The option 'adapterFormat','class' of createGECKOproject creates a project with a class.
A class that needs code beyond the file can read its parameters from the file in the constructor:
obj.params = loadAdapterParams(fullfile(projectPath, 'model_adapter.toml'));
In geckopy, a subclass of ModelAdapter overrides get_spontaneous_reactions, get_uniprot_compatible_genes, get_uniprot_ids_from_table, get_kegg_compatible_genes, get_brenda_db_folder or get_phyl_dist_path. It is instantiated explicitly; from_folder does not discover it.
Troubleshooting#
Problem |
Possible reason |
Solution |
|---|---|---|
|
the key is not in the tables above, or is misspelled |
Correct the key, or place a parameter that GECKO alone uses under |
Error about a preset and stages |
|
Keep one of the two |
|
the folder given holds no |
Give the folder that holds the file |
See also#
Project format 4, the sections of
model_adapter.toml.Kcat assignment, the presets and stages of
[kcat_assignment].Getting started, where the model adapter is created and populated.
Files in the data folder, the other project-wide reference table.