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

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. numpy >= 1.6.1 for double deletions

  4. scipy >= 0.11 for ArrayBasedModel and saving to *.mat files.

  5. pytest and pytest-benchmark are required for testing

You can install all packages directly by

pip install "cobra[all]"

Other solvers

cobrapy comes with bindings to the GNU Linear Programming Kit ([glpk] (http://www.gnu.org/software/glpk/)) using its own bindings called “cglpk” in cobrapy. In addition, cobrapy currently supports these linear programming solvers:

ILOG/CPLEX, MOSEK, and Gurobi are commercial software packages that currently provide free licenses for academics and support both linear and quadratic programming. GLPK and clp are open source linear programming solvers; however, they may not be as robust as the commercial solvers for mixed-integer and quadratic programming. QSopt_ex esolver is also open source, and can solve linear programs using rational operations, giving exact solutions.

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 True.

Project details


Release history Release notifications | RSS feed

This version

0.5.8

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.5.8.win-amd64-py3.5.exe (2.2 MB view details)

Uploaded Source

cobra-0.5.8.win-amd64-py3.4.exe (1.9 MB view details)

Uploaded Source

cobra-0.5.8.win-amd64-py2.7.exe (1.9 MB view details)

Uploaded Source

cobra-0.5.8.win32-py3.5.exe (2.1 MB view details)

Uploaded Source

cobra-0.5.8.win32-py3.4.exe (1.8 MB view details)

Uploaded Source

cobra-0.5.8.win32-py2.7.exe (1.8 MB view details)

Uploaded Source

cobra-0.5.8-cp35-cp35m-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.5m Windows x86-64

cobra-0.5.8-cp35-cp35m-win32.whl (1.6 MB view details)

Uploaded CPython 3.5m Windows x86

cobra-0.5.8-cp35-cp35m-manylinux1_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.5m

cobra-0.5.8-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.6 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.5.8-cp34-cp34m-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.4m Windows x86-64

cobra-0.5.8-cp34-cp34m-win32.whl (1.6 MB view details)

Uploaded CPython 3.4m Windows x86

cobra-0.5.8-cp34-cp34m-manylinux1_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.4m

cobra-0.5.8-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.6 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.5.8-cp27-cp27mu-manylinux1_x86_64.whl (3.0 MB view details)

Uploaded CPython 2.7mu

cobra-0.5.8-cp27-cp27m-win_amd64.whl (1.7 MB view details)

Uploaded CPython 2.7m Windows x86-64

cobra-0.5.8-cp27-cp27m-win32.whl (1.6 MB view details)

Uploaded CPython 2.7m Windows x86

cobra-0.5.8-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.6 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.5.8.win-amd64-py3.5.exe.

File metadata

File hashes

Hashes for cobra-0.5.8.win-amd64-py3.5.exe
Algorithm Hash digest
SHA256 0cf98ca889a4cd9f7d35346a4c2bf63695e7ea14809dd4e7022baa3924d2a0ff
MD5 a7fc95c81aec4e7f86495896257ecd1e
BLAKE2b-256 47bd6f35432a5eeb66f71351ad3e61cdbf8b2d7b4bfd918bede59b9c1e72233b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.8.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 8aa5576315edc15282ceab2808c54a9601470674339c7c15044e3fbb05688e82
MD5 d17535a998f0b5c5d40b886967df9091
BLAKE2b-256 a5cd06850c6c105cf3b1e0c34ab2b547ba74c74918a7bc9af82a2978d6351334

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.8.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 a9a2c9f9c2e01a95298810436c19ea2f24ff4af15e47639753817c66001f7b0a
MD5 b61d3d28bfcb0c7d791550dcf186f7a2
BLAKE2b-256 661933366418e4e650e9741eedadca1acc8acae1f086fd043c08371297a6f678

See more details on using hashes here.

File details

Details for the file cobra-0.5.8.win32-py3.5.exe.

File metadata

File hashes

Hashes for cobra-0.5.8.win32-py3.5.exe
Algorithm Hash digest
SHA256 f9eb4aa3caf67a9a8b76ba220af550562c38d19af12b883252adbb990338d636
MD5 1ced6c04e57ac59e78addd2edbb40714
BLAKE2b-256 36a9fda098b3c7b4e9adbda085418fc1bfcc820eeb57207de74df7a304dacf85

See more details on using hashes here.

File details

Details for the file cobra-0.5.8.win32-py3.4.exe.

File metadata

File hashes

Hashes for cobra-0.5.8.win32-py3.4.exe
Algorithm Hash digest
SHA256 11f74fed63684098bf14f3a9db314f3f1edd94e72c94c2bcb113ab9f5bab2a32
MD5 c9f8b575a127ed51ba01ba150a95ec85
BLAKE2b-256 098697796f62bf465530005431fe4fbcace5b2e81be31ece991140c8e65c65af

See more details on using hashes here.

File details

Details for the file cobra-0.5.8.win32-py2.7.exe.

File metadata

File hashes

Hashes for cobra-0.5.8.win32-py2.7.exe
Algorithm Hash digest
SHA256 0ef681806cdf94cb678d3273a84627e17a6f2c958f8932016afee10dcca15d3e
MD5 1c8d4359a1749411c0f376ade62b20ab
BLAKE2b-256 967db9b1b5f30271f9d5bae28cb18f5094164dc73b5ffea48f9cc717f953a2cf

See more details on using hashes here.

File details

Details for the file cobra-0.5.8-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for cobra-0.5.8-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 2955b57c3a8507af075b91365a1731ef9616aed241b7a071dc9063e1ca0f0ab9
MD5 6282085d174556cc2f14b2251b6a6488
BLAKE2b-256 e7d7d900a58475a28d2bef65fbf3e8a95452495a8ec07099150e9966e0b10625

See more details on using hashes here.

File details

Details for the file cobra-0.5.8-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for cobra-0.5.8-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 fd145577d72c123335e455e2426e26c169f33c8c6eb0f352118b785c110750d3
MD5 f7ed1cf9dfd2e0d89397f99e8674aa74
BLAKE2b-256 d5c9349abddf9be6fbf8ae9df3192db23403461830b669abf693952f52d31b5b

See more details on using hashes here.

File details

Details for the file cobra-0.5.8-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for cobra-0.5.8-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 65c3177510d1186ff980e506525fb1b3d4ea1a06774152a49f170c9d8ac036b8
MD5 82c57d9fe30a75e2d8cefc97015331d6
BLAKE2b-256 a79d10313b178d53029ea5f146157f3e2f6727ea14b76486a419fc38d34fe8a4

See more details on using hashes here.

File details

Details for the file cobra-0.5.8-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.5.8-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 db3dcfe0753d091c5ed38e6c31a1035d085f8b00f3ed5c18ad2660e78e2962df
MD5 e203a0d9f1985b3212b9e19760daea7a
BLAKE2b-256 b2ea351c3e44f5db613374e57f62192bcdbe5826eb519f252d735892429ce06e

See more details on using hashes here.

File details

Details for the file cobra-0.5.8-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for cobra-0.5.8-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 6a8ae27b05795029aa8f0b3467fa097f7e2cee588049810c73805903e383fd37
MD5 b0e05348494e5527dbeaa9ba0a059cd2
BLAKE2b-256 05af39be2138673cb4fea94033184073e0fd0440dc78361d3b8e7c8cf76ac47c

See more details on using hashes here.

File details

Details for the file cobra-0.5.8-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for cobra-0.5.8-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 60ff418c36f038f2531424e934c7e72bcbca36c51a6e58215d90ccebc08359fe
MD5 ba3cbd5ef9bc7032fd262bcec3edf670
BLAKE2b-256 8644123b2fa240fa80acf37e7f31133b0681d61ad30a797b2d74987b9a911673

See more details on using hashes here.

File details

Details for the file cobra-0.5.8-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for cobra-0.5.8-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e199d5a390a640503f81aa6961a906b9a64c900a71ddd19f2efc9d62906ce3f6
MD5 3341cfba8831d8d89958a95858fa249c
BLAKE2b-256 fc82fd37124758e5321d7cf285a1ea7c185af41acc69e0b0cb2fad9ef3b8cb32

See more details on using hashes here.

File details

Details for the file cobra-0.5.8-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.5.8-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 ddd76ef15eeab575b9cef23b3cd0bd4e36b586c3d602f92ca6607dc8e4763e4b
MD5 789fb0211fef242034bfdc3283a60cfb
BLAKE2b-256 d5d9e4754ad32ba813ec54a5d6c12896cd80e3bb3d2f3cfd170d3e3fd623bf46

See more details on using hashes here.

File details

Details for the file cobra-0.5.8-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for cobra-0.5.8-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3101fb10d84ea186d82fd092977b1ece0fd381bbf882276d585b78236504e2cd
MD5 b701bcc92efe107793f954da246e7222
BLAKE2b-256 02be43bceecf890bf5e1da230dbf37fa28e8ef194b9fc5c481c80fc189ce9f8c

See more details on using hashes here.

File details

Details for the file cobra-0.5.8-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for cobra-0.5.8-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 4d88c03177d5bfad2dad44271e80a99b0fb017da77969ff296c54b348aa86fca
MD5 f838273b45b7c9050db25aa5ec3d09a2
BLAKE2b-256 5fa4a1070247106a0480bfcb5e20b1bab6cb4e15c6d2db613bdac1abd5bad72a

See more details on using hashes here.

File details

Details for the file cobra-0.5.8-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for cobra-0.5.8-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 d728c22edd9ee9f67809953568a635eed0496dbf8424f4d6a087a51c31803614
MD5 ba661b70719692e21e058e9d08bca579
BLAKE2b-256 654573ca7debc61b124c481fa07d8848a2bc319c78a9aef60a8d57bd669b6a47

See more details on using hashes here.

File details

Details for the file cobra-0.5.8-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.5.8-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 b25e6f4880e817649e762847023612a19eaec405145a8a6ad75bb4e4670639cf
MD5 f07af43f86d7368951675b2ccb33a64e
BLAKE2b-256 2ec17a40e52d8351d06576b1527e642ca03a17217879ffbbb86186cfde099e8e

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