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

Project details


Release history Release notifications | RSS feed

This version

0.6.1

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.1.win-amd64-py3.6.exe (2.6 MB view details)

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m

cobra-0.6.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.6.1-cp35-cp35m-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m

cobra-0.6.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.6.1-cp34-cp34m-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.4m Windows x86-64

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

Uploaded CPython 3.4m

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7m Windows x86-64

cobra-0.6.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.6.1.win-amd64-py3.6.exe.

File metadata

File hashes

Hashes for cobra-0.6.1.win-amd64-py3.6.exe
Algorithm Hash digest
SHA256 ac247be75f66e67b0981adad0edf4cd94fffb6cef73460dac2a3103310af2510
MD5 3510ef2ddfb170753ddb905e009246be
BLAKE2b-256 2db001af2695f5855d54d69b72d5b4945d19efbe7e2fc6b0d9a26a0dac29a51e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.1.win-amd64-py3.5.exe
Algorithm Hash digest
SHA256 f6832d0abec57d063a430a82832c48644870a93aa1238b7a8e994a6e672ffc1a
MD5 a90c446c995e632f8f0e1e266fd1d088
BLAKE2b-256 906113d0b0a00dcd74364b39f015f8922a61c46ddda89d004e3af4eb9670a4a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.1.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 5ec102de12a47d4dfdff17ad3df472a3f2639a1ed8b770159e8008f73a0bff25
MD5 309efc95e202c944e62d88ab7c573b34
BLAKE2b-256 b58190a94d33294c3caac5dd4f9bfc76d58899fed62de1681b9b621fd2a9b211

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.1.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 e34de423df63ee918246e894ab00ce1e276ea663680dd07de55e23c0e9f82746
MD5 61086244e747206b8ebb74471f22a81e
BLAKE2b-256 30dafb7e9876e71b4b54f46fa92dba1439ed9adbedce86b90ccd8ad54e883327

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 736f353b8235f91231ebe09c1f0a041d1db9cf8fc7d6cef438eea58b16e7b879
MD5 789dda5e21e9546bf8c2fce72c518f08
BLAKE2b-256 abf659da273c63605b7af52533fb4c65176fa4307bf6ca0cc4813d4e26351e0e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 53eaaf8bb76dde77490b19a3e08d73e31902f0af55100b3f82c8a457181e5b50
MD5 acb7ad8542ea07c159e09e8126a0e5e5
BLAKE2b-256 b38aff81db824035b068f01a82b2e7b1353fdfc6f0a7536791ba0b1a2f9cd4ae

See more details on using hashes here.

File details

Details for the file cobra-0.6.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.6.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 cd464a25ba6bdda26286065048b49d1923ecece371ffa6f3e0bb41352ee7d127
MD5 08b0efc6fbb1ab096e1c2cc1e87a7ab6
BLAKE2b-256 031b7f2187a55c8aab6801c437f99289e38832b550f82b5bc7d193354ee24bd4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 6d3c397efa2178a2e4ddf4d09acc4259cac908f2d12dbf851b8a5058d865cf43
MD5 114be4f4687944d26cb8f0aaf20fe23a
BLAKE2b-256 b95fff7a1c16c1d29dd8d4fcd5ccd71b92b18ae10fc763702ed3bfc369f56716

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 00c9ad8689adfb0b466ec5aedc6fc83bdb1edc038757efe70576b2bbf2269eda
MD5 5b2ab5083f49b193b3c92a31d8ae169f
BLAKE2b-256 5fd8bb228b3f4f0b7b407fc58873df3aca8f64da68336b9f66aa81119f96bba6

See more details on using hashes here.

File details

Details for the file cobra-0.6.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.6.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 6f900398831daca00b11f9ed9533098b7f3fec0703f3cc10abf61328e39f325a
MD5 8820f03c1566a2de3d08e372c84e1816
BLAKE2b-256 c1ced00f71c564187c8a846c4aa819d6bbde6bcc0621b6f2b2a68463633886a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.1-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 4afcf84e482648e383d8646e76ea40b13ff4c0345dcd0c080425b116aa99bc61
MD5 14f983d8d58f1705d6f309e077a52af0
BLAKE2b-256 b3e72c6ece923c6c4295a2ed39e02e6fea5afb17759fbf98d7431ef52dfca30d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.1-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 bf2938174ff06a18db118f663b85d18af2f7ecf4d6a0cd55a57b339b428b1899
MD5 63d19156d7204fadb062ab709b39afe2
BLAKE2b-256 6e95146395047b4c7f7b98c9b08114402f8bc831199be7c7654d620d066fac00

See more details on using hashes here.

File details

Details for the file cobra-0.6.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.6.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 3219f62eedbc8f1b0d52bdc1a19f40607a354bec8e175a14c97a709e15554e13
MD5 d886baa0e407adc53190ad00176c5472
BLAKE2b-256 9705fee0b7b3ee99986c7b54421f12227d45f22134d879e3201cfdd93215f678

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ac79a9fc43a6586eac776a36ee4ab7a905600240f222551a52f5c0fd75fa9f0c
MD5 0a3ff9cf80955f507f80afbc14da713c
BLAKE2b-256 0b21cf135c9f4548ce65a3ef4e7647cb0521457df96546f1100b7d06de9168ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.1-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 69b3709fe90a15731b38f065dab8e811f00ca5a8068f26478ad799afb40b386e
MD5 07559756be6085929355df778b0bb897
BLAKE2b-256 d2e197d3e706a7a00f396f7f6ba8ba78f3e5d3bc225b18a7d5964d88c3452ea9

See more details on using hashes here.

File details

Details for the file cobra-0.6.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.6.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 6aa07b747e593966902fd500ad541a6bfa93bf801bb17daa5ab2daa4e2534d63
MD5 36fd278d4b4b4a23906c29956804dc75
BLAKE2b-256 f5139bda1e9930a0831156df5946b768aa2af1a77a9ecebc884f3cafd422a888

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