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

This version

0.8.2

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.8.2.tar.gz (1.7 MB view details)

Uploaded Source

Built Distributions

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m

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

Uploaded CPython 3.4m Windows x86-64

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

Uploaded CPython 3.4m

cobra-0.8.2-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.8.2-cp27-cp27mu-manylinux1_x86_64.whl (3.4 MB view details)

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7m Windows x86-64

cobra-0.8.2-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.8.2.tar.gz.

File metadata

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

File hashes

Hashes for cobra-0.8.2.tar.gz
Algorithm Hash digest
SHA256 6e95dd9704e7118f752046e579b4a8cb026cd1b70fb5bb807cf5498716a14bda
MD5 5d5b4cbf07f7bd32a474297954638743
BLAKE2b-256 98957dd4c0fee952dfd0d96a72122e68696e109035fcb78ebb686327632fa86f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.2.win-amd64-py3.6.exe
Algorithm Hash digest
SHA256 0f1179707273ce1dcff7ef14c5fd66c226c36d5f72d29024a173eb8845933157
MD5 566fbb265daf4e2dd574985a4106be16
BLAKE2b-256 722bf22ce01cca346245e9c352c42deefd8372a74395c63f0897d35bbd11bce9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.2.win-amd64-py3.5.exe
Algorithm Hash digest
SHA256 7628c50d97d2cf75f7a9506d96f5a89b1c05ffe0fd913d36b1af6e2b6fee92d5
MD5 ee37152817e2459bffc4dde62f3edf03
BLAKE2b-256 44b4155c08a0bfffea4faadfe4cbd022566649526fe874d3d0a4f0f54276cdf8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.2.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 12af1221ec31045f3afa8e377b70c410fa3431cbe3def03caa527b24aaef3cbf
MD5 552d136939b934919e749c232b915fd9
BLAKE2b-256 6b7e48f2368c6dd439839f65ca494bf5bc51d626310aebcb61d597171c4a0e57

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.2.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 48458908d7433a9980fad4c818c6adb87fa96cebdd94b981fa78caa4f7f945da
MD5 925a1ef96bacf1d9caa4a3aaa7fc8622
BLAKE2b-256 e1184dfdcaa679a797a33b24a47b980b5b1efa01ae6c3a3f1692b94bbdacb805

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 82e4fd3aae7bb8b78a9338973c33221c0cc6970d15dec9f5f443e59704386fe3
MD5 7d80243dbd3aab0d636506f0b5661fb2
BLAKE2b-256 5081cdc45b8ee7373621d834af77e16b3b9cae876de685ff89dd8233dc764002

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4caeab549779ff8c197075359221ecd86ebe7a720bf607670b04cd007ca00668
MD5 f27502f2374ad30df8dd70a22d9ea6df
BLAKE2b-256 fbdbfddcf2ca78f1356c641ef20a28da0c0c5ad8dfe2a59311523a49bcdc9cd0

See more details on using hashes here.

File details

Details for the file cobra-0.8.2-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.2-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 73787f88d9b0db9a67c8abfd5652afc7d6094a533b113069d6c8208e0b14ff2c
MD5 5c9a9aa91a1a5b37eca8a188f294a995
BLAKE2b-256 3dcbe345f97df5085c17f485b16a3962ce3b5164d67efab0020b7b5178de8c10

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 3a6562dee38e93bbf083efa04b5efb2ff960a851aa854d72f359cec1eeffd867
MD5 518a1c511c046a9e8262b27463004f6d
BLAKE2b-256 3c810d60ff77e21740f8f6e47a9c22a7e4f33d17f166d7d6593b75c5f74eb9a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 db4149b6cbe2f718e3399ae8b31ef235509b8a08124bb326857f54373e95b589
MD5 3952f64d4d128e1e717d2a5625363983
BLAKE2b-256 a7ac707b026f9469ced5eda5eed37561072b7733f8de364c76b522aa3bc17e98

See more details on using hashes here.

File details

Details for the file cobra-0.8.2-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.2-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 e0d34286d647dece2d62e1aca8f9fa1983964898a94162e387dbd4087915a2ff
MD5 2920d85d558a002a47f7ffe10a6ef8a4
BLAKE2b-256 94e2dec4228f59d29bb7d4b919e0997c6fa9b327fe46108d5dd2b17bcac7e65c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.2-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 34c3c3c0cea539e72176c193a124894e03099f9d47d19c6cc3f096b0a48b773e
MD5 52de9c41cf9519993f220579d05f642e
BLAKE2b-256 87f9d1ea6785aadc77c82063ad6a37f42d2864d028c78ea7d64c136111dcfe68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.2-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a7e0854ddbb1c7981f4a921465108ec6b82203f6e0fde32229ea3526c5582559
MD5 0f987755e126069a1c912838132bd8cc
BLAKE2b-256 177d8ac37685f36d3f365dd4db1b4eb1843eb5dcb4e381deb92b34c4b2e0df36

See more details on using hashes here.

File details

Details for the file cobra-0.8.2-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.2-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 2f930a22c8abee683588944b2ccffa923d0c88a623e9be5c93cce6c77c1a7bc0
MD5 ef621fabb3294bfdcb3738dcb3a33d5b
BLAKE2b-256 07c6a4f9ca3660247bae5861b175a5151957a80e9854f076d2327f985acaad5d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.2-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9a6210625b8587e75cc252a19b37dbdb8679a0e75f3ddda11efef5d05c2483fd
MD5 badff52863943cc851a9a7b46c1ef476
BLAKE2b-256 cb4e23fc91946647a8313a6410813cd6510d737a7b11caf8564b64da6b87e3d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.2-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 bf2a34c2638e11e641d7b32dcb5a112c15d211c8c3152e05349335af6391f6a2
MD5 aad99a3f54b8acefe5251597850e77a0
BLAKE2b-256 484db770c9b5dea3e5f6e3e45728cae6f8561934f35b236e202657dd5ece4f8f

See more details on using hashes here.

File details

Details for the file cobra-0.8.2-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.2-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 34c6494e1d30ff6e7bbbb2ade71e5df8ad6fc8a5d84545c39d9d2f82f74d6705
MD5 7a959a9e55319a82dc4ab26ce71502ca
BLAKE2b-256 81217d97400d950d04f557f985d1dc2bd58642c2ad6a03cb333c1cb8ffa4d3fb

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