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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file etfba-0.2.0.tar.gz.

File metadata

  • Download URL: etfba-0.2.0.tar.gz
  • Upload date:
  • Size: 36.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.19

File hashes

Hashes for etfba-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2d575a88eecbfa7febc6421148e6f6b661db080a442237168167d725d9ce9e15
MD5 8326880c74dc66b87bf35612a0df76ab
BLAKE2b-256 331ca490a49ccf34adcccf947c31eaf31b3f20a501b293a72355f13d0a9cba72

See more details on using hashes here.

Provenance

File details

Details for the file etfba-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: etfba-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 36.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.19

File hashes

Hashes for etfba-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f1b8e945e33388d3a431632553e73fe6d513acaa790117db8b3aeed4da19ab35
MD5 50da165ccd58cbd0a6108c3808755d76
BLAKE2b-256 59c08b980888ae788762c037977d131c02ab148411ec86ebbe481a5df316f0b0

See more details on using hashes here.

Provenance

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