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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m

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

Uploaded CPython 3.4m Windows x86-64

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

Uploaded CPython 3.4m

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7m Windows x86-64

cobra-0.6.0a7-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.0a7.win-amd64-py3.6.exe.

File metadata

File hashes

Hashes for cobra-0.6.0a7.win-amd64-py3.6.exe
Algorithm Hash digest
SHA256 edaa64a28d5c4f1aa581208d7d689d2fc628e9843a1be63c568c29b7a1799561
MD5 7ad7e93cd027eaba6c532af784ee86a9
BLAKE2b-256 4e554bbdc17a213e95fdf9b0961c42b5b633d14160c0cc23ecad6d28e8309c25

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a7.win-amd64-py3.5.exe
Algorithm Hash digest
SHA256 4042c8a0f4f8d876949f65a0b4eefa084a3ed249f9dbd78bdef09a9bf90b44a8
MD5 031b5ec567edf225e1be767aa519e23f
BLAKE2b-256 24b4950ea9988de9c9c4ceaae182568486e2bec2443d6952daf5f88e5daa5dc6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a7.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 296e20d081246a692c25ce8a61dd7adb2165ea7bac79292e57c0835f7d1e91d5
MD5 e154dcd75896e52dc2e2e88b5f7a1ebe
BLAKE2b-256 42157334a1b3ee1c8feef50b1115df8192e3de12d90403d2bffcffc73cdf0d61

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a7.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 29172d23c326275228593f7263edb406e0098f9490b937939b2927dbb5003ad6
MD5 9c1407f2c558d1d7212da119b5797c76
BLAKE2b-256 71b7f4ba18eccc727d86d0498bc5ac49dc0b2e0d11fecb2cd9fa504502521718

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a7-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 b1572cf8115897abedf73951fc0684848de26b17082cf3ade30f403232b5e321
MD5 32fabe1c185acb1a3cab996983860474
BLAKE2b-256 1ace545d19b9afb97841f92bcbfec6ca36617e2164a3f6e5c7668ff9e8344cd4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a7-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7c119868c09f8a2ad2e799e47fae093c2c1d6abc291bc0c027717f0ba47be8c5
MD5 8c6238c765dcb27aeb04c954fe107e4e
BLAKE2b-256 275e688db843ba8687d353810dccf9723541f11de77f3756382b494578ae8089

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a7-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.0a7-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 0a6fe1e5b0df8801ac34785554329b57671db707d1f1d296f9981ce59f02cf20
MD5 c96ad99ec453057ca529c9e2d9e66d30
BLAKE2b-256 e2b8e36f0bf9587e5bf34ef1e3c81d228376363c380fa003cfd18dbe6c6dd769

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a7-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 cdc55762ff563ac2ccd67a60cccfaa5831001291bab3cc4c914803e5a6849732
MD5 dc9a8894bf583fd4cc38fdda8459be34
BLAKE2b-256 171a095a1bd03478e8dd2615b827eb8fb1f5b309aac8f708751ac62302cdf6a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a7-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 efaa6f35c1e97d52e13d2657c72e972470d614fa5d92a0184e8f287e74a37a0b
MD5 12ed919f9d6726de2a3e4378297c1e48
BLAKE2b-256 87eec50892eb582b21a9a53e44eb8c9bcbdf016f6f7bc9f1508d3dc4ffb8e615

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a7-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.0a7-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 9ab657cccb8ce06be3793b12eaa2d120b3e953d041e7da322f745c962b6ac418
MD5 a96200daa03cc1afb316c2c6cdad74a9
BLAKE2b-256 a06642b2af9172e960f822722d46b3e07326ef883337a4843db1a8eccd3eb88d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a7-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 923d046adfd10339661bb6262e889cbe5e347985dc3858d165716c936f54ac99
MD5 58bb1ad214d9f42b3eacc39cd6074ff5
BLAKE2b-256 2735bf3beb20b16937859294ef68acfeffbe9f09530a9505500bb530b834fb16

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a7-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 438967c6c8b7362af9602fa3748de3d7e468e70ae4930edc7caff49e4caf1efc
MD5 b157e58e5eae1d58fd39f8c308126c5a
BLAKE2b-256 f523688d34aa62af3f998a2d711989ce9947221bc330f498f2898a30ea9d5b12

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a7-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.0a7-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 b4858eb1513647e1ffcc31c0fa79d9b0660f4598388220dd28ea91f9bce43024
MD5 82e058b20a6567549207597067561230
BLAKE2b-256 c3ce40c1df8014adfe54e2c83e71d591c7d0353321570376c0c7028f37a1b336

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a7-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 99e2e80b79f6128a3168af539466bd32e8e22942ff02c4c168e9c5f18b462325
MD5 2fff2c7e6ad3c2d2c25d86ae47c70da6
BLAKE2b-256 6a94f961a26ff9a88dc4f8a94191bc06ea4093e08174db51b8c4d4ffd1fa91fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a7-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 0934bead260c405d1cf49a93cc92140e8b241620fe852e83622b83c6d0571b34
MD5 50681e3761c798b7b7bf68fa1e3bd494
BLAKE2b-256 790e7d2221d6da310e37c78d523233461bd4c4d6594d72f4bbf77f7ad85de1b2

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a7-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.0a7-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 ba4376d05c57faff7814df51323ec86531144b9585ea9a1f5581c33340720661
MD5 d68caf52a1103efd88694e55a3b0e35e
BLAKE2b-256 0cc9ad311b5080d0c072ee9fce52b336b72aa6599e4dbc3d83450a4130c736dc

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