{ "info": { "author": "David S. Tourigny, Moritz E. Beber", "author_email": "dst2156@cumc.columbia.edu, morbeb@biosustain.dtu.dk", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Natural Language :: English", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering :: Bio-Informatics" ], "description": "=============================\nDynamic Flux Balance Analysis\n=============================\n\n.. image:: https://img.shields.io/pypi/v/dfba.svg\n :target: https://pypi.org/project/dfba/\n :alt: Current PyPI Version\n\n.. image:: https://img.shields.io/pypi/pyversions/dfba.svg\n :target: https://pypi.org/project/dfba/\n :alt: Supported Python Versions\n\n.. image:: https://img.shields.io/pypi/l/dfba.svg\n :target: http://www.gnu.org/licenses/\n :alt: GPLv3+\n\n.. image:: https://img.shields.io/travis/davidtourigny/dynamic-fba/master.svg?label=Travis%20CI\n :target: https://travis-ci.org/davidtourigny/dynamic-fba\n :alt: Travis CI\n\n.. image:: https://codecov.io/gh/davidtourigny/dynamic-fba/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/davidtourigny/dynamic-fba\n :alt: Codecov\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/ambv/black\n :alt: Black\n\n.. _`Harwood et al., 2016`: https://link.springer.com/article/10.1007/s00211-015-0760-3\n.. _GLPK: https://www.gnu.org/software/glpk/\n.. _SUNDIALS: https://computation.llnl.gov/projects/sundials\n.. _Python: https://www.python.org/\n.. _cobrapy: https://github.com/opencobra/cobrapy\n.. _optlang: https://github.com/biosustain/optlang\n.. _symengine: https://github.com/symengine/symengine\n\nThis project provides an object-oriented software package for dynamic\nflux-balance analysis (DFBA) simulations using implementations of the direct\nmethod or Algorithm 1 described in the paper `Harwood et al., 2016`_. The main\nalgorithms for solving embedded LP problems are written in *C++* and use the GNU\nLinear Programming Kit (GLPK_) and the Suite of Nonlinear and\nDifferential/Algebraic Equation Solvers (SUNDIALS_) CVODE or IDA. Extension\nmodules to cobrapy_ are provided for easy generation and simulation of DFBA\nmodels.\n\nInstall\n=======\n\nIt's as simple as:\n\n.. code-block:: console\n\n pip install dfba\n\nOverview\n========\n\n.. _`Boost.Python`: https://github.com/boostorg/python\n.. _examples: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/examples\n.. _example1: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/examples/example1\n.. _example2: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/examples/example2\n.. _example3: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/examples/example3\n.. _example4: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/examples/example4\n.. _example5: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/examples/example5\n.. _Dockerfile: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/Dockerfile\n.. _`example1.py`: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/examples/example1/example1.py\n\nUsers are not expected to interact directly with the lower-level *C++* interface\nand once installed the package should ideally remain untouched. Instead, the\nclasses and functions for solving embedded LP problems have been exposed to\n*Python* using `Boost.Python`_. Combined with the provided cobrapy_ extension\nmodules, this provides the user with the ability to build their own DFBA model\nexclusively in *Python*. The *Python* class *DfbaModel* intuitively encapsulates\nall the data required for a full definition of a DFBA model by combining an\nunderlying cobrapy_ object with instances of the *KineticVariable* and\n*ExchangeFlux* classes. The *DfbaModel* class instance ensures all user data are\nconsistent with the initialization and simulation requirements of an embedded LP\nproblem. User data are passed directly to the algorithms and symbolic functions\nare dynamically compiled and loaded prior to simulation. The directory\nexamples_ also contains scripts for the examples described below, and details on\nhow the user can adapt these to build and simulate their own model are outlined\nat the end of this section.\n\nExample DFBA models provided with current version\n-------------------------------------------------\n\nThe current version is distributed with several examples_ related to Examples\n6.2.1 and 6.3 in `Harwood et al., 2016`_. example1_ and example2_ are based on\n`Hanly & Henson, 2011\n`_ and also Example 1\nin `DFBAlab\n`_.\nThe genome-scale metabolic network model of the *Escherichia coli* bacterium\n`iJR904 `_ contains 761 metabolites and 1075\nreaction fluxes. example3_ and example4_ are based on `Hjersted, Henson, &\nMahadevan, 2007 `_.\nThe genome-scale metabolic network model of the *Saccharomyces cerevisiae*\nstrain S288C `iND750 `_ contains 1059\nmetabolites and 1266 reaction fluxes. The above examples all use the default\nsolver options (see below). example5_ implements the same model as example1_,\nbut uses the direct method in place of Algorithm 1 from Harwood *et al*.\n\nPrerequisites for building from source\n--------------------------------------\n\nCurrently this package is compatible with most UNIX-like operating systems. A\nDockerfile_ is provided for building a `Docker `_\nimage to run the software from an interactive container. The Docker image can be\nbuilt in one step by issuing the command:\n\n.. code-block:: console\n\n make build\n\nfrom the root of this repository. It can then be started using ``make run``.\n\nAlternatively, provided the following dependencies are installed, the module can\nthen be installed from the root of the repository using the command:\n\n.. code-block:: console\n\n pip install .\n\nDependencies\n~~~~~~~~~~~~\n\n* A version of Python_ 3.6 or higher is required.\n* GLPK_ version 4.65 is required or can be installed using\n ``scripts/build_glpk.sh``.\n* SUNDIALS_ version 5.0.0-dev.1 is required or can be installed using\n ``scripts/build_sundials.sh``.\n* `Boost.Python`_ version 1.68.0 is required or can be installed using\n ``scripts/build_boost.sh``.\n\n\n\nInstructions for creating and simulating a DFBA model\n-----------------------------------------------------\n\nThe following modifications to the script `example1.py`_ will enable the user to\ndefine and simulate their own DFBA model:\n\n* specify path for loading file containing genome-scale metabolic model as\n cobrapy_ model object (line 29)\n* instantiate object of class *DfbaModel* with cobrapy_ model (line 30)\n* instantiate kinetic variables as objects of class *KineticVariable* (lines\n 33-37)\n* add kinetic variables to the model using the *DfbaModel* method\n *add_kinetic_variables* (line 40)\n* instantiate exchange fluxes using the class *ExchangeFlux* (lines 43-47)\n* add exchange fluxes to the model using the *DfbaModel* method\n *add_exchange_fluxes* (line 50)\n* provide symbolic expression for the time derivative of each kinetic variable\n using the *DfbaModel* method *add_rhs_expression* (lines 53-57)\n* add symbolic expressions for upper/lower bounds of selected exchange fluxes\n using the *DfbaModel* methods *add_exchange_flux_ub*/*add_exchange_flux_lb*\n (lines 60-64). In many applications, vector components (e.g., concentrations)\n in the true solution are always positive or non-negative, though at times very\n small. In the numerical solution, however, small negative (hence unphysical)\n values can then occur. To prevent these from interfering with the simulation,\n the user can supply a symbolic expression that must be non-negative for\n correct evaluation of upper/lower bounds\n* add initial conditions for the kinetic variables in the model using the\n *DfbaModel* method *add_initial_conditions* (line 74)\n* provide desired simulation times *tstart*, *tstop*, *tout* (simulation start,\n stop, and output times, respectively) to the *DfbaModel* method *simulate*\n (line 85). Optionally, the user can also provide a list of reaction ids whose\n flux values will be appended to those of the kinetic variables in the\n simulation output file\n\nThere are a number of additional features not covered in example1_, but\nwhose usages are illustrated in other example scripts. These are outlined below.\n\nThe module *SolverData* accessed through the *solver_data* attribute of class\n*DfbaModel* allows users to select their preferred algorithm and solver\nspecifications prior to simulation:\n\n* Custom tolerances (default values are all *1.0e-4*) can be set using the methods\n *set_rel_tolerance* and *set_abs_tolerances*. The former takes a positive\n float value and sets the relative tolerance. The latter takes a list of\n positive floats and uses this to set absolute tolerance values for each\n dynamic variable. The convention for setting absolute tolerance values is that\n the first of how ever many floats are supplied in the list are set to those\n values, while any remaining are set equal to the last. See example2_ for\n illustration\n* The choice of SUNDIALS_ *SunMatrix* type (default *dense*) can be set using\n the method *set_sunmatrix*. The choice of SUNDIALS_ *SunLinSolver* (default\n *dense*) can be set using the method *set_sunlinsolver*. See SUNDIALS_\n documentation for details. Currently, the only compatible matrix and linear\n solver combination implemented is the default setting\n* If using the direct method (see below), the choice of ODE solver method (ADAMS\n or BDF, default ADAMS) can be set using the method *set_ode_method*. See\n example5_ for illustration\n* The choice of DFBA algorithm, Harwood et al. or direct method (default\n *Harwood*), can be set using the method *set_algorithm*. If using the direct\n method, the third parameter of the *DfbaModel* method *simulate* also\n indicates the frequency of calls to the LP solver, and some trial and error\n may be required to establish its optimal value. See\n example5_ for illustration\n* The simulation display settings (default *full*) can be set to *full*,\n *glpk_only*, *sundials_only*, or *none* using the method *set_display*. See\n example5_ for illustration\n\nThe class *ControlParameter* allows discontinuous parameters, such as model\nparameters controlled by an experimentalist, to appear in the symbolic\nexpressions for derivatives of kinetic variables and upper/lower bounds of\nexchange fluxes. Objects of class *ControlParameter* are to be instantiated with\ntheir symbolic expression, an ordered list of times corresponding to\ndiscontinuous change points in the value of the control parameter, and the\ncorresponding values the control parameter takes at each of the intervals\nbetween change points. *ControlParameter* objects can then can be included in\nany symbolic expression added to a *DfbaModel* object using the methods\n*add_rhs_expression*, *add_exchange_flux_ub*, and *add_exchange_flux_lb*. A list\nof *ControlParameter* objects appearing in each symbolic expression must also be\nsupplied at this stage. See example3_ for illustration.\n\nAwaiting implementation\n-----------------------\n\n.. _`Scott et al., 2018`: https://www.sciencedirect.com/science/article/pii/S0098135418309190\n\nSome additional features listed below are awaiting a full implementation:\n\n* Lexicographic optimization as described in `Harwood et al., 2016`_. Although\n the *DfbaModel* method *add_objectives* will direct the selected algorithms to\n perform lexicographic optimization using the supplied objectives during\n simulation, interactions between the LP and ODE/DAE integration routines do\n not appear robust. Users are therefore advised not to use this feature until\n the matter is resolved in a future version\n\n* An algorithm for simulating DFBA models based on an interior point formulation\n has recently been proposed in `Scott et al., 2018`_. Implementation of this\n algorithm as a choice for the user is work in progress\n\nAuthors\n=======\n\n* David S. Tourigny\n* Moritz E. Beber\n\nFunding\n=======\n\n* David S. Tourigny is a Simons Foundation Fellow of the Life Sciences Research\n Foundation.\n\nCopyright\n=========\n\n* Copyright \u00a9 2018,2019 Columbia University Irving Medical Center, New York, USA\n* Copyright \u00a9 2019 Novo Nordisk Foundation Center for Biosustainability,\n Technical University of Denmark\n* Free software distributed under the `GNU General Public License v3 or later\n (GPLv3+) `_.\n\nSource Files\n============\n\n.. _src: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/src\n.. _extension: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/src/extension\n.. _`dfba_utils.cpp`: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/src/extension/dfba_utils.cpp\n.. _emblp: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/src/extension/emblp\n.. _methods: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/src/extension/methods\n.. _`solver_data.h`: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/src/extension/solver_data.h\n.. _`user_data.h`: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/src/extension/user_data.h\n.. _dfba: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/src/dfba\n.. _`control.py`: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/src/dfba/control.py\n.. _`exchange.py`: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/src/dfba/exchange.py\n.. _`helpers.py`: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/src/dfba/helpers.py\n.. _`jit.py`: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/src/dfba/jit.py\n.. _`model.py`: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/src/dfba/model.py\n.. _`library.py`: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/src/dfba/library.py\n.. _`variables.py`: https://gitlab.com/davidtourigny/dynamic-fba/tree/master/src/dfba/variables.py\n\n\nSource files contained within the directory src_ are split between two\nsub-directories separated by their language of implementation.\n\n*C++*\n-------\n\nThe sub-directory extension_ contains the following content:\n\n* `dfba_utils.cpp`_: contains source code for exposing module to *Python*\n* emblp_: contains class and function declarations for embedded LP problems\n* methods_: contains algorithms for integration of embedded LP problems\n* `solver_data.h`_: struct exposed to *Python* for solver options\n* `user_data.h`_: struct exposed to *Python* for model specification\n\n*Python*\n----------\n\nThe directory dfba_ contains the following content:\n\n* `control.py`_: definition of class *ControlParameter*\n* `exchange.py`_: definition of class *ExchangeFlux*\n* `helpers.py`_: general helper functions\n* `jit.py`_: tools for JIT compilation of dynamic library\n* `model.py`_: definition of class *DfbaModel*\n* `library.py`_: methods for writing dynamic library\n* `variables.py`_: definition of class *KineticVariable*", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "https://pypi.org/project/dfba/", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/davidtourigny/dynamic-fba", "keywords": "dynamic,flux-balance analysis,FBA,DFBA,DAE", "license": "GNU GPL v3+", "maintainer": "", "maintainer_email": "", "name": "dfba", "package_url": "https://pypi.org/project/dfba/", "platform": "", "project_url": "https://pypi.org/project/dfba/", "project_urls": { "Download": "https://pypi.org/project/dfba/", "Homepage": "https://gitlab.com/davidtourigny/dynamic-fba" }, "release_url": "https://pypi.org/project/dfba/0.1.1/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Object-oriented software for dynamic flux-balance simulations.", "version": "0.1.1" }, "last_serial": 5557289, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "66dd49449ebc2bb3fdb829f404b9fa5b", "sha256": "b59a27b16f4b76dd15941c68aa8ce755c3d223a871f1cd428a696071789d7224" }, "downloads": -1, "filename": "dfba-0.1.1.tar.gz", "has_sig": false, "md5_digest": "66dd49449ebc2bb3fdb829f404b9fa5b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 70495, "upload_time": "2019-07-19T15:48:36", "url": "https://files.pythonhosted.org/packages/6e/7a/682f2f6b6444964e96e6b778b2232015dd19681b42c74348fcfb3d6bb468/dfba-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "66dd49449ebc2bb3fdb829f404b9fa5b", "sha256": "b59a27b16f4b76dd15941c68aa8ce755c3d223a871f1cd428a696071789d7224" }, "downloads": -1, "filename": "dfba-0.1.1.tar.gz", "has_sig": false, "md5_digest": "66dd49449ebc2bb3fdb829f404b9fa5b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 70495, "upload_time": "2019-07-19T15:48:36", "url": "https://files.pythonhosted.org/packages/6e/7a/682f2f6b6444964e96e6b778b2232015dd19681b42c74348fcfb3d6bb468/dfba-0.1.1.tar.gz" } ] }