PET-FBA (pH-, Enzyme allocation-, and Thermodynamics-constrained Flux Balance Analysis) is a computational framework that integrates catalytic enzyme protein availability and reaction themodynamic feasibility, conveniently incorporating the pH effect on them. It provides a more comprehensive mechanistically grounded approach to modeling metabolic fluxes.
This repository host the Python implementation, released as etfba, which allows applying these constraints either individually or jointly within a 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 is supported, allowing users 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, please refer to our documentation. For example of applying pH-dependent flux analysis, see the script.
The package 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 etfbaAlternatively, 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/etfbaNote: It is recommended to install within a virtual environment.
The package 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 glpkFor 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 gurobiYou can build a 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_fluxesTo 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_rangesFor more detailed information, please refer to the complete documentation.