Skip to main content

ETFBA is a package for constraints-based metabolic flux analysis

Project description

ETFBA is a Python package designed for performing enzyme protein allocation and thermodynamics constraint-based flux balance analysis. It extends traditional flux balance analysis (FBA) by incorporating constraints based on the availability of catalytic enzyme proteins and the second law of thermodynamics, offering a more comprehensive approach to modeling metabolic fluxes.

ETFBA allows for the application of enzyme protein allocation and thermodynamic constraints either individually or jointly within the model. This flexibility enables users to solve various optimization problems, including:

  • FBA: Traditional flux balance analysis.

  • EFBA: FBA with enzyme protein allocation constraints.

  • TFBA: FBA with thermodynamic constraints.

  • ETFBA: FBA with both enzyme protein allocation and thermodynamic constraints.

Variability analysis allows you to evaluate the potential ranges of metabolic fluxes, enzyme protein costs, and reaction Gibbs energy changes while ensuring that the objective function remains within a specified level of optimality. This analysis includes:

  • FVA: Flux variability analysis.

  • EFVA: Enzyme-constrained FVA.

  • TFVA: Thermodynamic FVA.

  • EVA: Enzyme variability analysis.

  • TEVA: Thermodynamic EVA.

  • TVA: Thermodynamic variability analysis.

  • ETVA: Enzyme-constrained TVA.

For further details, refer to our documentation.

Installation

ETFBA has been tested with Python versions 3.8, 3.9, 3.10 and 3.11. It can be installed using pip from PyPI:

python -m pip install --upgrade pip
pip install etfba

Alternatively, you can install it from source (assuming git is installed):

git clone https://github.com/Chaowu88/etfba.git /path/to/etfba
pip install /path/to/etfba

Note: It is recommended to install ETFBA within a virtual environment.

Solver installation

ETFBA uses the modeling language Pyomo to formulate linear programming (LP) and mixed integer linear programming (MILP) problems. You can install the freely available solver GLPK via conda:

conda install -c conda-forge glpk

For larger models, such as genome scale models, it is highly recommended to use the commercial optimizer Gurobi and install the Python support:

conda install -c gurobi gurobi

Example Usage

You can build an ETFBA model from scratch or convert it from a COBRA model (refer to here for more details). Below is an example of estimating the flux distribution constrained by enzyme protein allocation and thermodynamics:

from etfba import Model

model = Model.load('/path/to/model.bin')

res = model.optimize(
    'etfba',
    objective=objective,      # typically the growth rate
    flux_bound=flux_bound,    # bounds for metabolic fluxes
    conc_bound=conc_bound,    # bounds for metabolite concentrations
    preset_flux=preset_flux,  # preset values for specific metabolic fluxes
    preset_conc=preset_conc,  # preset values for specific metabolite concentrations
    ex_thermo_cons=ex_rxns,   # reactions excluded from thermodynamic constraint
    inc_enz_cons=eff_rxns,    # reactions included in enzyme protein constraint
    enz_prot_lb=enz_ub,       # upper bound on enzyme protein allocation
    parsimonious=True         # to obtain parsimonious flux distributions
).solve(solver='gurobi')

opt_growth_rate = res.opt_objective
opt_metabolic_fluxes = res.opt_fluxes

To estimate the variability of fluxes:

res = model.evaluate_variability(
    'etfva',
    objective=objective,
    obj_value=obj_value,   # optimal objective value obtained by "optimize"
    gamma=gamma,           # fraction of the optimum objective to achieve
    flux_bound=flux_bound,
    conc_bound=conc_bound,
    preset_flux=preset_flux,
    preset_conc=preset_conc,
    ex_thermo_cons=ex_rxns,
    inc_enz_cons=eff_rxns,
    enz_prot_lb=enz_ub
).solve(solver='gurobi', n_jobs=100)

metabolic_flux_ranges = res.flux_ranges

For more detailed information, please refer to the complete documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

etfba-0.2.0.tar.gz (36.0 kB view hashes)

Uploaded Source

Built Distribution

etfba-0.2.0-py3-none-any.whl (36.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page