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 Distributions

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

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6m

cobra-0.8.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.6mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5m

cobra-0.8.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.5mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

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

Uploaded CPython 3.4mWindows x86-64

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

Uploaded CPython 3.4m

cobra-0.8.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.4mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

cobra-0.8.1-cp27-cp27mu-manylinux1_x86_64.whl (3.4 MB view details)

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mWindows x86-64

cobra-0.8.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.7mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

File details

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

File metadata

File hashes

Hashes for cobra-0.8.1.win-amd64-py3.6.exe
Algorithm Hash digest
SHA256 2b0263c81cf8b4b3935634d0862e088350db7345797d8fbb2e335a7e7ce7a966
MD5 a48111a785add1765c336cf9dd222c90
BLAKE2b-256 77710806510874f31231acc52fff2a354782b03c479dcd557dc109ca958e26e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.1.win-amd64-py3.5.exe
Algorithm Hash digest
SHA256 07575d42f2e217d789e9f33188b2e732ea3be334b890b8d74e6cc9de93d98b48
MD5 3b10e58f538e16c0e8cf3069a48f3708
BLAKE2b-256 afb3e0d3a4056b78e1e6c5521424d4c9d17490681e22798d74dea84d1445f356

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.1.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 6dcb3b3097ba58ca7477245f1c043e2f0b4739548801a3f0767a7cbe1211ab91
MD5 29d68638256ba3bcf39e855d01aebee2
BLAKE2b-256 f0c4d0a3aa4e1ff1df2b3634df549ae4b2581e2f85522c04d3d1715f99fb8b72

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.1.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 025c8925bf73132b47adca686b6e4245c93954bc34aa174ae141b45ef9a55da7
MD5 41ddeb29b01a2ee6aa665dbc56275636
BLAKE2b-256 f4ad27f3dacb079b611cdb72c4f12c7081768d236f95372d7b9c505662e46821

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 81fb75138c9b8fad6a1ebff27a1b4e4af794350de40f51c4fe4fcce8fe05dc98
MD5 0bdd5f920b04049d35ce2ffa52bdd432
BLAKE2b-256 44aa4bb532b0ccfdc61af2ab249972fbf0b61e217ce59cb2cc14cd86ebbd53b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ada1c212acf55bcc5891ae44b2de92d62815f27dbda77a6a8a1752692bbf9016
MD5 3a8de51bdb60a62953f6a1e24ebea557
BLAKE2b-256 7ab5d3e9bba33af9a9c1f49212402be71672009c7bb0d2065e48deeb97f992cc

See more details on using hashes here.

File details

Details for the file cobra-0.8.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.8.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 ac4cfc632c72c1464c7a6375334a9467849bfda7794e0eabd3219f6e34d9e53d
MD5 87dfa76340c41198c12417b94ce4051e
BLAKE2b-256 b286cf7535dc48b8776041cc6d2280be7b77c1eff6a9c5a14d3a14923234f8a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 05db5084635917e6884f9d5634a7cdb6e898648c6daf1ab14d5cda0e05b06e02
MD5 c3b88c65d1ba2c4ea239be2d6571bc36
BLAKE2b-256 261eda8bf82085039849614ea5ccd5d6911ccd55b101d7c0f5d68dedf493d888

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c15c3fc216d883bd136cfb3a3ecf74d8980f3b9e48a2b1ba3c8a0b6a3afeddf6
MD5 45241d69ba7998d0b5577945a1254ab4
BLAKE2b-256 2494769601892d0ab8835e4978836ec81608fc154e598aebd5acadd805ebb710

See more details on using hashes here.

File details

Details for the file cobra-0.8.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.8.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 283b3afb4df5b5cd6eba3951478feed11f975b0a5bf573538c4a575cf87fc15f
MD5 f18b7f1a800eb3fc1b0d9323f3120a91
BLAKE2b-256 af99934bfb88b7cf4449424b7b51f56e04c91a0ea3cd70a255d8b4646a62b899

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.1-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 67fde71fb3c64c3a222c4a45ea61749536c397501c7fd312a02bf0dcb8dbfa5e
MD5 ec5023e51aa23d9da6f8a7c4e568cfb6
BLAKE2b-256 52498acf20d4177b55298134942c2ff58fa92373a7dbd53b97c932198e276342

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.1-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0a3133880d68768c1df958b81850cc039b97b9c917da217a89d36cf6edfc0d4c
MD5 defc99bba418dc390039bd301aebd6ce
BLAKE2b-256 f47d3a922bc2427a74cdfc3e8588816b292ab04da79b3ac0f539c4944ecc849e

See more details on using hashes here.

File details

Details for the file cobra-0.8.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.8.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 d9f614cb54b87da624c172630e79bfbe424ba3ab125bf14fb9e5384bbfb50162
MD5 43dbe68f6070c1ace7751f8ba104794e
BLAKE2b-256 a7fa7fffbcef78e8cdfbca410db5030edae89c5fa33ac9c9697761957efbe3a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f8736629c4503451aab3c3792677febc6f06212b48bb5f1d907f66130d3c8e5a
MD5 dbac934f000e29fa1e93972e56aef4d6
BLAKE2b-256 1c24a9ac968ca25c146123d3e30b50f5d03ce0abd813555ccb3fbdf43966c1a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.1-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 310cdb8b3825af3dbc0d59a2407ec5578eadcdce133e93a0cc991b280320278b
MD5 56ed868319ea8e94a7e2bf0e71f3a6fc
BLAKE2b-256 f18eac0d4b7cdf6dcead503a0509ed72ac4e0cf89ba94f7c69ad4bb10cb4bca6

See more details on using hashes here.

File details

Details for the file cobra-0.8.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.8.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 eb7eb514edf4e072f09b999b7c4b56d7498718ce67fc95887b75a23c3bc26d7c
MD5 6f1b4d57440e82f1eda4bb9b7fe00adf
BLAKE2b-256 b395cd0eb07bf93aff708b82182befe3ec1d8e474749fa7c6cbf54f9d0d44a43

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page