Skip to main content

COBRApy is a package for constraints-based modeling of biological networks

Project description

cobrapy - constraint-based reconstruction and analysis in python

Build Status Coverage Status Build status PyPI Gitter 'Stories in Ready'

What is cobrapy?

COBRA methods are widely used for genome-scale modeling of metabolic networks in both prokaryotes and eukaryotes. cobrapy is a constraint-based modeling package that is designed to accommodate the biological complexity of the next generation of COBRA models and provides access to commonly used COBRA methods, such as flux balance analysis, flux variability analysis, and gene deletion analyses.

Our aim with cobrapy is to provide useful, efficient infrastructure for:

  • creating and managing metabolic models

  • accessing popular solvers

  • analyzing models with methods such as FVA, FBA, pFBA, MOMA etc.

  • inspecting models and drawing conclusions on gene essentiality, testing consequences of knock-outs etc.

Our goal with cobrapy is for it to be useful on its own, and for it to be the natural choice of infrastructure for developers that want to build new COBRA related python packages for e.g. visualization, strain-design and data driven analysis. By re-using the same classes and design principles, we can make new methods both easier to implement and easier to use, thereby bringing the power of COBRA to more researchers.

The documentation is browseable online at readthedocs and can also be downloaded.

Please use the Google Group for help. Alternatively, you can use gitter.im for quick questions and discussions about cobrapy (faster response times).

More information about opencobra is available at the website.

If you use cobrapy in a scientific publication, please cite doi:10.1186/1752-0509-7-74

Installation

Use pip to install cobrapy from PyPI (we recommend doing this inside a virtual environment):

pip install cobra

In case you downloaded the source code, run:

pip install -e .

In the cobrapy directory. For further information, please follow the detailed installation instructions.

Contributing

Contributions are always welcome! Please read the contributions guideline to get started.

License

The cobrapy source is released under both the GPL and LGPL licenses. You may choose which license you choose to use the software under. However, please note that binary packages which include GLPK (such as the binary wheels distributed at https://pypi.python.org/pypi/cobra) will be bound by its license as well.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License or the Lesser GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Installation of cobrapy

For installation help, please use the Google Group. For usage instructions, please see the documentation.

All releases require Python 2.7+ or 3.4+ to be installed before proceeding. Mac OS X (10.7+) and Ubuntu ship with Python. Windows users without python can download and install python from the python website. Please note that though Anaconda and other python distributions may work with cobrapy, they are not explicitly supported (yet!).

Stable version installation

cobrapy can be installed with any recent installation of pip. Instructions for several operating systems are below:

Mac OS X or Linux

  1. install pip.

  2. In a terminal, run sudo pip install cobra

We highly recommend updating pip beforehand (pip install pip --upgrade).

Microsoft Windows

The preferred installation method on Windows is also to use pip. The latest Windows installers for Python 2.7 and 3.4 include pip, so if you use those you will already have pip.

  1. In a terminal, run C:\Python27\Scripts\pip.exe install cobra (you may need to adjust the path accordingly).

To install without pip, you will need to download and use the appropriate installer for your version of python from the python package index.

Installation for development

Get the detailed contribution instructions for contributing to cobrapy.

Installation of optional dependencies

Optional dependencies

On windows, these can downloaded from [this site] (http://www.lfd.uci.edu/~gohlke/pythonlibs/). On Mac/Linux, they can be installed using pip, or from the OS package manager (e.g brew, apt, yum).

  1. libsbml >= 5.10 to read/write SBML level 2 files

  2. lxml to speed up read/write of SBML level 3 files.

  3. scipy >= 0.11 for MOMA and saving to *.mat files. - Windows scipy installer

  4. pytest and pytest-benchmark are required for testing

You can install all packages directly by

pip install "cobra[all]"

Solvers

cobrapy uses optlang to interface the mathematical solvers used to optimize the created COBRA models, which at the time of writing

Testing your installation

While it is not a hard requirement for using cobrapy, you need pytest and pytest-benchmark to run its tests. First do

pip install pytest pytest-benchmark

or to install cobrapy directly with the test dependencies

pip install "cobra[test]"

Then start python and type the following into the Python shell

from cobra.test import test_all
test_all()

You should see some skipped tests and expected failures, and the function should return False.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

cobra-0.6.0a2.win-amd64-py3.6.exe (2.6 MB view details)

Uploaded Source

cobra-0.6.0a2.win-amd64-py3.5.exe (2.6 MB view details)

Uploaded Source

cobra-0.6.0a2.win-amd64-py3.4.exe (2.2 MB view details)

Uploaded Source

cobra-0.6.0a2.win-amd64-py2.7.exe (2.2 MB view details)

Uploaded Source

cobra-0.6.0a2-cp36-cp36m-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.6m Windows x86-64

cobra-0.6.0a2-cp36-cp36m-manylinux1_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.6m

cobra-0.6.0a2-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.6m macOS 10.10+ intel macOS 10.10+ x86-64 macOS 10.6+ intel macOS 10.9+ intel macOS 10.9+ x86-64

cobra-0.6.0a2-cp35-cp35m-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.5m Windows x86-64

cobra-0.6.0a2-cp35-cp35m-manylinux1_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.5m

cobra-0.6.0a2-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.5m macOS 10.10+ intel macOS 10.10+ x86-64 macOS 10.6+ intel macOS 10.9+ intel macOS 10.9+ x86-64

cobra-0.6.0a2-cp34-cp34m-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.4m Windows x86-64

cobra-0.6.0a2-cp34-cp34m-manylinux1_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.4m

cobra-0.6.0a2-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.4m macOS 10.10+ intel macOS 10.10+ x86-64 macOS 10.6+ intel macOS 10.9+ intel macOS 10.9+ x86-64

cobra-0.6.0a2-cp27-cp27mu-manylinux1_x86_64.whl (3.3 MB view details)

Uploaded CPython 2.7mu

cobra-0.6.0a2-cp27-cp27m-win_amd64.whl (2.0 MB view details)

Uploaded CPython 2.7m Windows x86-64

cobra-0.6.0a2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (2.9 MB view details)

Uploaded CPython 2.7m macOS 10.10+ intel macOS 10.10+ x86-64 macOS 10.6+ intel macOS 10.9+ intel macOS 10.9+ x86-64

File details

Details for the file cobra-0.6.0a2.win-amd64-py3.6.exe.

File metadata

File hashes

Hashes for cobra-0.6.0a2.win-amd64-py3.6.exe
Algorithm Hash digest
SHA256 37592152df9aba8e5caae6bf0943693ef43bd270b936b79bded0dba14041b9d0
MD5 3ca4b00e6e87ae08cda95dbd72382953
BLAKE2b-256 af625dcceca05b1ca267aa5510b966065519bae7e9881cb5f79a371f957ac9cf

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a2.win-amd64-py3.5.exe.

File metadata

File hashes

Hashes for cobra-0.6.0a2.win-amd64-py3.5.exe
Algorithm Hash digest
SHA256 de0675f95f66c7a9e6cf1918c939db12c81bf5fe9b78a194dcad3bd2ae517a62
MD5 54f7024c362b0c59bd00c91cd13b9585
BLAKE2b-256 77852b4da6e21a0375bf7c078503d861af7f4e845c5f27bfab48c4ca1bb76382

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a2.win-amd64-py3.4.exe.

File metadata

File hashes

Hashes for cobra-0.6.0a2.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 8f6ebd90ce8c26573f2b7da269f330d8b16943cb5914ee57789cf71268c6ff1f
MD5 05810b3e5d7c796b4d793bd2264606cc
BLAKE2b-256 8dc83cd09ce1ce2db33434e3d0e86d7f169b9d837fc062a77d8b11e94103552d

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a2.win-amd64-py2.7.exe.

File metadata

File hashes

Hashes for cobra-0.6.0a2.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 c3d0ef532a9b1ed52b00bce15182c695744a93ffffc003544a529fc9645b0905
MD5 b1478101c89382bd3ac13fdd80c1085e
BLAKE2b-256 869a24ae6ee058d012fc304114e58b99b276db32b5b2bed1ca33c36c838fbcc5

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a2-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for cobra-0.6.0a2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 a8dac7c7bd087f077ad184e1e13a11117e13d131e8816175f7d3dbadab65442f
MD5 bc89f2098ef57a34660044f45a2777ae
BLAKE2b-256 7a27cbfbc52238eb623c1cfdc611683abd7b1bb6da27586cc17f51f3bf26218b

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a2-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for cobra-0.6.0a2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e1b1e382b5de5835d565b7e213520db2864a4d3d70da4f9da0793fca63498a83
MD5 eddfe807d5b6f9b7629f672adaa2cf40
BLAKE2b-256 492049c37c1321462a626d12307bf2405b4986be5726e46558f602f77501b312

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a2-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for cobra-0.6.0a2-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 738a9e0f176e21668110a491b42b524f6f2077dd82c9ea041a68f0b36d7a0d10
MD5 4af3d6b8d469aefc957f891c2d967fcc
BLAKE2b-256 1ed3ff84014da3c0f3e1abe832e98db70614927f31582af5476ceb810de9c04e

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a2-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for cobra-0.6.0a2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 9fb34d596620304ff64972e10f2a5e673c130ec17a2b4d56bd6ab7aee4cc166e
MD5 64d6fc5492c6322c5d83caf1fad2b6ed
BLAKE2b-256 2d05784f1147f8bf8042fbe829e2ad14228f7a801297353678cb6c5c71601604

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a2-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for cobra-0.6.0a2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4472cb1a9d8c6958e1fe9c099a1286480f8e5be7211cba020483af0fdc1eaca1
MD5 64bed3f5a93bac01757543c9cf03b13b
BLAKE2b-256 049bfe24932b7db80df5b2b12b44f2504bf369e753676d463f1cb0ae2220bbb5

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a2-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for cobra-0.6.0a2-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 3806f3d71b31ab72d82d8c4838dabc4c824c00b3cf1761d0024997063b4fd438
MD5 929e28d2307b407e5e98695379956055
BLAKE2b-256 190f8f3fcb566e4801ccf8a60cee1559ae1d7e6c97fc337f805c54bf6af05f09

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a2-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for cobra-0.6.0a2-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 2891f496e34ef33559b1188ab35e58914800b16a071d237724a7fe6f3cf7f384
MD5 349335e290c33724c3f12655f1575182
BLAKE2b-256 947f200c6d4b1da2290abd9d86e293d0f977c2654a822c3618fbb8e765cbfe40

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a2-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for cobra-0.6.0a2-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6f7f16c7e965dcd93ced1f6f7244b4b68916da2d983b9c2f415a6ea6101d371d
MD5 61ce80bdfcc5d117516355f044cf9df7
BLAKE2b-256 0fd83350ce19dc46a787ce96c6e6eb49e97b02c28ca04018533d655977e42042

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a2-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for cobra-0.6.0a2-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 6a4825124dbf16680b193d8f80d4f9c470651856868b8f19f8f54cea982e1a75
MD5 1c81074d2c2ab2a2049b5dd9acac878f
BLAKE2b-256 4b67e52b62e6f7fe0d3d52275fdbe6e261af3b628ba3a9936aa0ca418bcdc0cc

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a2-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for cobra-0.6.0a2-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 833cb54f5c636df4972166161218877912679a6562615f4fc2ac85023b2df4fd
MD5 64e7c08cce3dfcec6aefbbedf7627307
BLAKE2b-256 3290d654cd67bebb91ac238fdd34a9a94c1d541569bdf1d264762ae586cc32bc

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a2-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for cobra-0.6.0a2-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 3cf6840d83863ef1d9d1fe96338c34e470b97f5063b2edce331eb733aad1558f
MD5 7e60b6996755788aa6479e286683754a
BLAKE2b-256 85215d30e6662e009bba42e765d3026de4f3b38626ee0f158ebede57e7eea867

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for cobra-0.6.0a2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 144ddb79a641fd9909081a4aa10b7b233fe6ad8726d09bffaaa1fbd3288fc974
MD5 1c3b811b9f50ce252a96c8e2f9515d24
BLAKE2b-256 e58b8976a754157e794d543281351c79c2af049d6a72f661d1095b3529fb2c94

See more details on using hashes here.

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