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. By writing a well formulated question, with sufficient detail, you are much more likely to quickly receive a good answer! Please refer to these StackOverflow guidelines on how to ask questions. Alternatively, you can use gitter.im for quick questions and discussions about cobrapy (faster response times). Please keep in mind that answers are provided on a volunteer basis.

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 0. If you see a value other than 0 please file an issue report.

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 Distribution

cobra-0.9.1.tar.gz (1.7 MB view details)

Uploaded Source

Built Distributions

cobra-0.9.1.win-amd64-py3.6.exe (2.5 MB view details)

Uploaded Source

cobra-0.9.1.win-amd64-py3.5.exe (2.5 MB view details)

Uploaded Source

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

Uploaded Source

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

Uploaded Source

cobra-0.9.1-cp36-cp36m-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.6m Windows x86-64

cobra-0.9.1-cp36-cp36m-manylinux1_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.6m

cobra-0.9.1-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.9.1-cp35-cp35m-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.5m Windows x86-64

cobra-0.9.1-cp35-cp35m-manylinux1_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.5m

cobra-0.9.1-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.9.1-cp34-cp34m-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.4m Windows x86-64

cobra-0.9.1-cp34-cp34m-manylinux1_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.4m

cobra-0.9.1-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.9.1-cp27-cp27mu-manylinux1_x86_64.whl (3.3 MB view details)

Uploaded CPython 2.7mu

cobra-0.9.1-cp27-cp27m-win_amd64.whl (1.9 MB view details)

Uploaded CPython 2.7m Windows x86-64

cobra-0.9.1-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.9.1.tar.gz.

File metadata

  • Download URL: cobra-0.9.1.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cobra-0.9.1.tar.gz
Algorithm Hash digest
SHA256 1395aa04bea3cc590b0d835c630ac5aba3e6ec4fa7668ac74281ad980f27f60f
MD5 b166c5f36b22243cc315882872dd6296
BLAKE2b-256 807bd08a8839f95fe3be024d400f1366a7234a169cee012c4ffbcb1962df0956

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.1.win-amd64-py3.6.exe
Algorithm Hash digest
SHA256 151a3d4c611d998eb64ede660179efbd9b77e1757839cac129318e9d38244bab
MD5 90f3ea31ba80cffbaef86ccadcf2245b
BLAKE2b-256 bab3813cd0138bd32e707dd40d05222617452a7693f8e45553f3aaf7c42e75e7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.1.win-amd64-py3.5.exe
Algorithm Hash digest
SHA256 de92cd79210bd0bb81ccad960c0f5f5491523ef1f45a94ad3c519e934f2ff731
MD5 e7c1176d346b63e31ca1ad03c65a6b04
BLAKE2b-256 71f39a198c2c7d4f4fcfb32373d47ae9f3121d551266ecb649a882763b6ecc9c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.1.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 ea55e3ccdfb8328777e5f47cd24e8ca919adb593c26f4a214195a6f3bc466f87
MD5 d0675f11b3d6430b7e9b76c635626e6b
BLAKE2b-256 64cba3cfbdbc091253f4593b0e934ca0b48d2f60a2d16e0e97d8710245e7f40c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.1.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 e27a5f8f02eab84b10b99323d3ceb1d67a982dfd98911a134a0754101b1ad431
MD5 77f4589feb10c5a4b0bbc4e634a9d469
BLAKE2b-256 8da5983daf72571a7cd836537fd159a8eab3004b1fe404b033f1f41b9c4cf1ea

See more details on using hashes here.

File details

Details for the file cobra-0.9.1-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for cobra-0.9.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 4e7dc5b392d32ad4f59b8806c854a16aef25e53c43c150a834381bc013cfb5f6
MD5 4d2231c02f69917e59ecc149a7d1878a
BLAKE2b-256 d345a0ce151ae0c11089f951b301e91da1c8e6e42e8f8e08cd35b03fa6fdacec

See more details on using hashes here.

File details

Details for the file cobra-0.9.1-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for cobra-0.9.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7b14da3f4c14879b5a3f01fa248e9c00f6e16e3c4770d5f0bae1d00b3301df13
MD5 54823b54eb06a419a602b3821e712899
BLAKE2b-256 21824c3779830ae38563858ee3a99f4dc3190f8f66eb543832ec34ecba04abe0

See more details on using hashes here.

File details

Details for the file cobra-0.9.1-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.9.1-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 56909e1ef9e04b8ca7d69c8d841a8c8d98c09a44a7997fadbf792e2ec39fd1a7
MD5 5624a65f949c4fbfef165a11fd9e2b5b
BLAKE2b-256 332cf044f702612d8599359bc6a118ea428a0ad3f9a9df6053d3884ffc0c8a7c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 eb96ef1fa525b7d9be79db3913848b3d474e80a083232bf3ed207644d0462d2c
MD5 b568429f13cfdaef2767d0404c6bf8a8
BLAKE2b-256 8b5a87e19c9d22a8ac15b10a11a3bc3be12e6a22092a36f92a8b2d9bb8b672de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 af605f066a3ae4d446312e30ceff573dbc9a8ca0c222352dd4fd874ce7d1f04b
MD5 ee210d61831e10cdbf388d6ba7910e91
BLAKE2b-256 50cfa96a5677ca3d8343755f2428d43e17cf6572c285464560e830c86b65574b

See more details on using hashes here.

File details

Details for the file cobra-0.9.1-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.9.1-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 2d8bdec30a133b76a8bf9b68a6af03b83c7a8e10651cf9a9b0ba89757fbc3f1f
MD5 e62d7d243cdfea4a9068d7e66e690834
BLAKE2b-256 4519a3a969b0c5fcfcbd602a41aa362ccab05f4847ea950e1bc3dee1e451d230

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.1-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 6e8de3ec47fe4f7b579d91802bad25eda2a8889b24404ff9b41eb81ac74b0899
MD5 1a8afbb8d5d9342749590f94368968c6
BLAKE2b-256 2a7f623de2a234183f3ddeb3c69cadd45f9a0c27acb17adc8b6f7b46a72dde9c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.1-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 39726504be0cb07fb192dc6d608eaa35dfefae33e6d36820c219572e38f71f74
MD5 9d9c41243be8dedb6f096779a638481b
BLAKE2b-256 d5e6f2f095c0d9472bde433b8112d0780ec80f9eed60353cf1917aa8a79fa6cf

See more details on using hashes here.

File details

Details for the file cobra-0.9.1-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.9.1-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 7d8fe3c0c772b8f87017ac2d0d19a897ca1f1e8762f15a1bff7db08dd86bd52a
MD5 9ecaaffac5d2e22afc35c204a7766701
BLAKE2b-256 8b282947f1195200e249b74df352f65c59deb8761a5262764522765f4637e443

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5b1d83e9b21d6b9ff75b5fdef78c479534c8f58936a0437cfc33028850478166
MD5 b6756e0dba34d343bdc52dd012b10dc5
BLAKE2b-256 319bcd043484154c42e8a3925e913a1b60c0ca6f30098537834dc1a94cb6ce00

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.1-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 b22c5a326c3f0c77e98e5396d782e7458d06cbb982b5aea730c52164d19a063a
MD5 9f63e64cfded490769810a5b95a9bcb1
BLAKE2b-256 534a6e28873e7dbae25b6e25960ac72c5c407855126248c6c0d8737af29a084c

See more details on using hashes here.

File details

Details for the file cobra-0.9.1-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.9.1-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 beedfc7d017d3845b796d7ac49772366b4f597ec611d9f5f6e45fd0eab63d810
MD5 45f0f13f2de5d5b5715aa3b610661931
BLAKE2b-256 fe652cf6b835a467b9f39f2a384b2a3927c3f37ed7bf182df60ffe20f44b0a21

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