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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m

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

Uploaded CPython 3.4m Windows x86-64

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

Uploaded CPython 3.4m

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7m Windows x86-64

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

File metadata

File hashes

Hashes for cobra-0.6.0a4.win-amd64-py3.5.exe
Algorithm Hash digest
SHA256 4cf46caaeba23ade4c2f1c8ac275736595db61695dc12afe83842294d6214fb6
MD5 ebc22480b459a8a877b62065d23c8b3a
BLAKE2b-256 2d33b316f023eb23cdb3bcb6d0a07bc2c789933c3fc8070c1f1e23d09d843e43

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a4.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 2f818317c7f86b63fd3566b161c3842513f81e09e6d9a3a12d373c8f6d4b6d4f
MD5 ff78de1a94c2af7f9a25f4d47429b6a9
BLAKE2b-256 d07076cd7c3d445645573b1db04e311593aaff56ac3a2900584d357610959a45

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a4.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 133a8a40c2311d873b0b45c731cd81d8fd5097035ae0962d210ef3e2c6eaf350
MD5 89c8dc32ea8ef8f1a74f6c9de5eb763c
BLAKE2b-256 5282281536b42677f6fda47fcb217b86571e87de8149727b827a02430cf7045a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a4-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 e3aa7dca5954b66b38a745491b0091e41f7b2d3206181692a5c64bb964c2f537
MD5 a9b092d3d12a12f311bf8e3b3be4e03e
BLAKE2b-256 fb9545c9643f350c34ea0c678c251bca5a13d7bf39504acf68a7eeb6e509b329

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a4-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ecce8d08cece9ad6f08ce71fd022a92ceff653eafd674acbe836b6828cd620b7
MD5 23b475ebd0383f37f482f1c6cd0283e1
BLAKE2b-256 71c9179961ba48af0b9026a9c98fbc5d8311679cc813d769f0b3615bb5a8d0af

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a4-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.0a4-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 7bd768c2ed6604da972f291908daba2f558e67edf0d7131b48b9f619a49b601b
MD5 02409b225087db93b76918ed8384cb58
BLAKE2b-256 e9b84351a90960c15ff127b73b58b966a2bd5eaee9c28b9256cecb25fb4f605b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a4-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 c2de814c94ef04a960c4ebf14fc5aeda579613a903bf2abef0389e96255706af
MD5 e420b7f601d21b2d844b9ef324609d4b
BLAKE2b-256 dbd3bcd83bb4867ebfa86756855cf9231659b2409d371e751f488f90c4825b53

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a4-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3f596d5317a1159bfb5227ead79e1e91c363dce0ecd6de7bae83c3c09ff2e656
MD5 1826c324f8f57f2d35943631f016576e
BLAKE2b-256 584f2c0ffe15a9604ed88b0acd1307c15cd89f9d508b9cbce709c3177e176c7b

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a4-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.0a4-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 1fa2444aac7cd3df7e4128ad19f78575d9a1c6368872397170d54e7d62780b5e
MD5 f6d87b79a4448e3d8ecda4fb113ccf1e
BLAKE2b-256 e630d118ff4dee46a5d700b340599ffdda601db6aca9fb96587c643fe4033483

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a4-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 8e3d9cad63125ff1a5cc08da37e7b180fa1ee7e9bfa6d9a54ef5fbb761897acd
MD5 300c70a78e28a5e5c408bf920c294249
BLAKE2b-256 cc27e378093178adffdaafe311c3feabd7447306eb16e591e668925fd778d5dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a4-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d50f09af830f885c6ad9cc68054231b66ca351e5b7ae4a1a3563421613cd1ca1
MD5 8d267d1bca65e92d17e3110a07a0a85c
BLAKE2b-256 aa88da2496ffd69a4c23f0075bf9b72360cc91865aaf609537e8ffe86e14120e

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a4-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.0a4-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 1f8bbd9ca7143ee0a3d4140b116037bfbec74a1fc9041bed7893ee866e6234d8
MD5 924583b8f9804e948fa70063f7efb9ef
BLAKE2b-256 eb38163a3ea36a34ce84d1f813046f45e10e0f79a98600791930827e000c4da0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a4-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6bb320f4f7a6ead4d14af60f3ff926b0a23b337ad149f8a345064b4afde7c574
MD5 6fbca54f77b847b66841785def0aeaf4
BLAKE2b-256 b0aa1a53396ca7f0171557c45b2842d24d4f2f7f4e9bd002df76a63a64891bca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a4-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 85a179370bb201cac39dddf63ea272b58911e5cf8559a1cf787a4ce82813acf0
MD5 0e006c269e07c1c83226d7c3712c18f1
BLAKE2b-256 fec965d1202846f33c6bbf3c42b7e53c02e0099c897cc111e15597f8f7231d35

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a4-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.0a4-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 a005bd2fe6a2618f7dd8a69711cc9f0c7295cc3fd31b50c12171ca15adee4454
MD5 2ea14836f875171a4951d3a499bf20b7
BLAKE2b-256 bc834b65062f3272f20ebd9192e4ddf92b722b1e2895575d1014471c441c6756

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