Skip to main content

ETFBA

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.

Metadata

Release files for etfba 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for etfba 0.2.0
File Size Uploaded Provenance Actions
etfba-0.2.0.tar.gz 36.0 kB Without provenance Details for etfba-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for etfba 0.2.0
File Interpreter ABI Platform Actions
etfba-0.2.0-py3-none-any.whl Python 3 none any Details for etfba-0.2.0-py3-none-any.whl

Total release size: 72.8 kB

Release files / etfba-0.2.0.tar.gz

Download URL etfba-0.2.0.tar.gz
Size 36.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2d575a88eecbfa7febc6421148e6f6b661db080a442237168167d725d9ce9e15
BLAKE2b-256 checksum
How to use checksums
331ca490a49ccf34adcccf947c31eaf31b3f20a501b293a72355f13d0a9cba72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.19

Release files / etfba-0.2.0-py3-none-any.whl

Download URL etfba-0.2.0-py3-none-any.whl
Size 36.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f1b8e945e33388d3a431632553e73fe6d513acaa790117db8b3aeed4da19ab35
BLAKE2b-256 checksum
How to use checksums
59c08b980888ae788762c037977d131c02ab148411ec86ebbe481a5df316f0b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.19

Security for etfba 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page