EcmOptmization

Optimization support for enzyme constraint models (ECM), e.g. GECKO or TGECKO.

class f2xba.EcmOptimization(fname, cobra_model=None)[source]

Optimization support for enzyme constraint models (ECM) like GECKO.

Using the gurobipy interface requires that GUROBI and gurobipy being installed on your system.

Ref: Sánchez, B. J., Zhang, C., Nilsson, A., Lahtvee, P. J., Kerkhoven, E. J., & Nielsen, J. (2017). Improving the phenotype predictions of a yeast genome‐scale metabolic model by incorporating enzymatic constraints. Molecular Systems Biology, 13(8), 935. https://doi.org/https://doi.org/10.15252/msb.20167411

Using the gurobipy interface requires that GUROBI and gurobipy being installed on your system:

When using this class with COBRApy instead, supply the reference of the COBRApy model during instantiation. While strictly, this class is not required when using the COBRApy interface, it provides access to features implemented in f2xba, like optimization results analysis.

Using the gurobipy interface for optimization of enzyme constraint models, like GECKO or TGECKO. Note: GUROBI optimizer with gurobipy (https://www.gurobi.com) needs to be installed on your system.

Using the COBRApy interface for optimization of enzyme constraint models, like GECKO or TGECKO: Use of EcmOptimization is optional, but it can provide access to additional features, e.g. results analysis, and ensures correct configuration of variables and constraints for thermodynamics constraint variants.

import cobrapy

cobra_model = cobra.io.read_sbml_model('iML1515_GECKO.xml')
eo = EcmOptimization('iML1515_GECKO.xml', cobra_model)
cobra_model.medium = {rid: 1000.0 for rid in lb_medium}
solution = cobra_model.optimize()

Using the gurobipy interface for optimization of enzyme constraint models, like GECKO or TGECKO: Note: GUROBI optimizer with gurobipy (https://www.gurobi.com) needs to be installed on your system.

eo = EcmOptimization('iML1515_GECKO.xml')
eo.medium = {rid: 1000.0 for rid in lb_medium}
solution = eo.optimize()
property medium

Mimic medium property of COBRApy to set and retrieve medium.

Returns:

exchange reaction ids with (positive valued) uptake rates

Return type:

dict

scale_kcats(scale_kcats)[source]

Scale turnover numbers in GECKO models to support manual parameter tuning.

Use unscale_kcats() to return to original values.

eo = EcmOptimization('iML1515_GECKO.xml)
scale_kcats= {'BPNT': 0.2, 'TMPK': 0.2, 'TMPK_REV': 0.2, 'CLPNS': 0.25}
eo.scale_kcats(scale_kcats)
solution = eo.optimize()
eo.unscale_kcats()
Parameters:

scale_kcats (dict(str, float)) – reaction ids (without prefix R_) with scaling factor

unscale_kcats()[source]

Reset previously scaled turnover numbers.

see scale_kcats().

single_gene_deletion(genes=None, method='ecm', solution=None, **kwargs)[source]

Perform a single gene deletion analysis for enzyme constraint models using gurobipy interface.

Interface aligned to COBRApy single_gene_deletion() method. Perform single gene deletion simulations for provided list of gene in genes. If genes is not provided, perform gene deletion for all genes that may be active in the wild type solution. In case a gene is not required in the wild type solution, a knockout simulation is not performed for this gene. Its growth rate value is set to the wild type value and its optimization status is set to wt_solution. A wild type solution can be provided with parameter solution, alternatively a wild type solution is determined automatically.

When method is set to room or linear room, following keyword arguments can be added: delta: relative tolerance range (default: 0.03), epsilon: absolute tolerance range (default: 1e-3), time_limit: in seconds for single gene deletion simulation, used for ‘room’ (default: 30.0).

eo = EcmOptimization('iML1515_GECKO.xml')
eo.medium = {rid: 1000.0 for rid in lb_medium}
df_sgko = eo.single_gene_deletion()

Example for MOMA based SGKO analysis for selected genes with wild type solution provided:

wt_solution = eo.optimize()
eo.single_gene_deletion(genes = ['b0002', 'b0003', 'b0007', 'b0025'], method='moma', solution=wt_solution)
Parameters:
  • genes (list or set) – (optional) gene ids

  • method (str) – (optional) alternative methods ‘moma’, ‘linear moma’, ‘room’ or ‘linear room’

  • solution (Solution) – (optional) wild type ECM solution

  • kwargs – keyword arguments passed on to ‘room’ and ‘linear room’ methods

Returns:

table with SGKO results, containing growth rate in h-1, optimization status and fitness

Return type:

pandas.DataFrame