etfba


Nameetfba JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/Chaowu88/etfba
SummaryETFBA is a package for constraints-based metabolic flux analysis
upload_time2024-09-11 21:12:05
maintainerNone
docs_urlNone
authorChao Wu
requires_python>=3.8
licenseGNU General Public License v3.0
keywords metabolic flux thermodynamics enzyme protein allocation variability metabolism biology mixed-integer linear programming variability analysis
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =====
ETFBA
=====

ETFBA is a Python package designed for performing **e**\ nzyme protein allocation and **t**\ hermodynamics constraint-based **f**\ lux **b**\ alance **a**\ nalysis. 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 <https://etfba.readthedocs.io/en/latest/index.html>`__.

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:

.. code-block:: python

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

Alternatively, you can install it from source (assuming `git <https://git-scm.com/>`__ is installed):

.. code-block:: python

  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 <https://docs.python.org/3.8/tutorial/venv.html>`__.

Solver installation
===================

ETFBA uses the modeling language `Pyomo <https://www.pyomo.org/>`__ to formulate linear programming (LP) and mixed integer linear programming (MILP) problems. You can install the freely available solver GLPK via conda:

.. code-block:: python

  conda install -c conda-forge glpk

For larger models, such as genome scale models, it is highly recommended to use the commercial optimizer `Gurobi <https://www.gurobi.com/>`__ and install the Python support:

.. code-block:: python

  conda install -c gurobi gurobi

Example Usage
=============

You can build an ETFBA model from scratch or convert it from a `COBRA <https://cobrapy.readthedocs.io/en/latest/io.html>`__ model (refer to `here <https://etfba.readthedocs.io/en/latest/building_model.html>`__ for more details). Below is an example of estimating the flux distribution constrained by enzyme protein allocation and thermodynamics:

.. code-block:: python

  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:

.. code-block:: python

  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 <https://etfba.readthedocs.io/en/latest/index.html>`__.




            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Chaowu88/etfba",
    "name": "etfba",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "metabolic flux, thermodynamics, enzyme protein allocation, variability, metabolism, biology, mixed-integer linear programming, variability analysis",
    "author": "Chao Wu",
    "author_email": "chaowu09@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/33/1c/a490a49ccf34adcccf947c31eaf31b3f20a501b293a72355f13d0a9cba72/etfba-0.2.0.tar.gz",
    "platform": null,
    "description": "=====\r\nETFBA\r\n=====\r\n\r\nETFBA is a Python package designed for performing **e**\\ nzyme protein allocation and **t**\\ hermodynamics constraint-based **f**\\ lux **b**\\ alance **a**\\ nalysis. 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.\r\n\r\nETFBA 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:\r\n\r\n- FBA: Traditional flux balance analysis.\r\n- EFBA: FBA with enzyme protein allocation constraints.\r\n- TFBA: FBA with thermodynamic constraints.\r\n- ETFBA: FBA with both enzyme protein allocation and thermodynamic constraints.\r\n\r\nVariability 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:\r\n\r\n- FVA: Flux variability analysis.\r\n- EFVA: Enzyme-constrained FVA.\r\n- TFVA: Thermodynamic FVA.\r\n- EVA: Enzyme variability analysis.\r\n- TEVA: Thermodynamic EVA.\r\n- TVA: Thermodynamic variability analysis.\r\n- ETVA: Enzyme-constrained TVA.\r\n\r\nFor further details, refer to our `documentation <https://etfba.readthedocs.io/en/latest/index.html>`__.\r\n\r\nInstallation\r\n============\r\n\r\nETFBA has been tested with Python versions 3.8, 3.9, 3.10 and 3.11. It can be installed using *pip* from PyPI:\r\n\r\n.. code-block:: python\r\n\r\n  python -m pip install --upgrade pip\r\n  pip install etfba\r\n\r\nAlternatively, you can install it from source (assuming `git <https://git-scm.com/>`__ is installed):\r\n\r\n.. code-block:: python\r\n\r\n  git clone https://github.com/Chaowu88/etfba.git /path/to/etfba\r\n  pip install /path/to/etfba\r\n\r\nNote: It is recommended to install ETFBA within a `virtual environment <https://docs.python.org/3.8/tutorial/venv.html>`__.\r\n\r\nSolver installation\r\n===================\r\n\r\nETFBA uses the modeling language `Pyomo <https://www.pyomo.org/>`__ to formulate linear programming (LP) and mixed integer linear programming (MILP) problems. You can install the freely available solver GLPK via conda:\r\n\r\n.. code-block:: python\r\n\r\n  conda install -c conda-forge glpk\r\n\r\nFor larger models, such as genome scale models, it is highly recommended to use the commercial optimizer `Gurobi <https://www.gurobi.com/>`__ and install the Python support:\r\n\r\n.. code-block:: python\r\n\r\n  conda install -c gurobi gurobi\r\n\r\nExample Usage\r\n=============\r\n\r\nYou can build an ETFBA model from scratch or convert it from a `COBRA <https://cobrapy.readthedocs.io/en/latest/io.html>`__ model (refer to `here <https://etfba.readthedocs.io/en/latest/building_model.html>`__ for more details). Below is an example of estimating the flux distribution constrained by enzyme protein allocation and thermodynamics:\r\n\r\n.. code-block:: python\r\n\r\n  from etfba import Model\r\n\r\n  model = Model.load('/path/to/model.bin')\r\n  \r\n  res = model.optimize(\r\n      'etfba',\r\n      objective=objective,      # typically the growth rate\r\n      flux_bound=flux_bound,    # bounds for metabolic fluxes \r\n      conc_bound=conc_bound,    # bounds for metabolite concentrations\r\n      preset_flux=preset_flux,  # preset values for specific metabolic fluxes\r\n      preset_conc=preset_conc,  # preset values for specific metabolite concentrations\r\n      ex_thermo_cons=ex_rxns,   # reactions excluded from thermodynamic constraint\r\n      inc_enz_cons=eff_rxns,    # reactions included in enzyme protein constraint\r\n      enz_prot_lb=enz_ub,       # upper bound on enzyme protein allocation\r\n      parsimonious=True         # to obtain parsimonious flux distributions\r\n  ).solve(solver='gurobi')\r\n\r\n  opt_growth_rate = res.opt_objective\r\n  opt_metabolic_fluxes = res.opt_fluxes\r\n\r\nTo estimate the variability of fluxes:\r\n\r\n.. code-block:: python\r\n\r\n  res = model.evaluate_variability(\r\n      'etfva',\r\n      objective=objective,\r\n      obj_value=obj_value,   # optimal objective value obtained by \"optimize\"\r\n      gamma=gamma,           # fraction of the optimum objective to achieve\r\n      flux_bound=flux_bound,\r\n      conc_bound=conc_bound,\r\n      preset_flux=preset_flux,\r\n      preset_conc=preset_conc,\r\n      ex_thermo_cons=ex_rxns,\r\n      inc_enz_cons=eff_rxns,\r\n      enz_prot_lb=enz_ub\r\n  ).solve(solver='gurobi', n_jobs=100)\r\n\r\n  metabolic_flux_ranges = res.flux_ranges\r\n\r\nFor more detailed information, please refer to the complete `documentation <https://etfba.readthedocs.io/en/latest/index.html>`__.\r\n\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "GNU General Public License v3.0",
    "summary": "ETFBA is a package for constraints-based metabolic flux analysis",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "https://github.com/Chaowu88/etfba"
    },
    "split_keywords": [
        "metabolic flux",
        " thermodynamics",
        " enzyme protein allocation",
        " variability",
        " metabolism",
        " biology",
        " mixed-integer linear programming",
        " variability analysis"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "59c08b980888ae788762c037977d131c02ab148411ec86ebbe481a5df316f0b0",
                "md5": "50da165ccd58cbd0a6108c3808755d76",
                "sha256": "f1b8e945e33388d3a431632553e73fe6d513acaa790117db8b3aeed4da19ab35"
            },
            "downloads": -1,
            "filename": "etfba-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "50da165ccd58cbd0a6108c3808755d76",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 36832,
            "upload_time": "2024-09-11T21:12:04",
            "upload_time_iso_8601": "2024-09-11T21:12:04.169147Z",
            "url": "https://files.pythonhosted.org/packages/59/c0/8b980888ae788762c037977d131c02ab148411ec86ebbe481a5df316f0b0/etfba-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "331ca490a49ccf34adcccf947c31eaf31b3f20a501b293a72355f13d0a9cba72",
                "md5": "8326880c74dc66b87bf35612a0df76ab",
                "sha256": "2d575a88eecbfa7febc6421148e6f6b661db080a442237168167d725d9ce9e15"
            },
            "downloads": -1,
            "filename": "etfba-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "8326880c74dc66b87bf35612a0df76ab",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 35969,
            "upload_time": "2024-09-11T21:12:05",
            "upload_time_iso_8601": "2024-09-11T21:12:05.687672Z",
            "url": "https://files.pythonhosted.org/packages/33/1c/a490a49ccf34adcccf947c31eaf31b3f20a501b293a72355f13d0a9cba72/etfba-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-11 21:12:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Chaowu88",
    "github_project": "etfba",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "etfba"
}
        
Elapsed time: 2.33953s