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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5m

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

Uploaded CPython 3.4mWindows x86-64

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

Uploaded CPython 3.4m

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mWindows x86-64

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

File metadata

File hashes

Hashes for cobra-0.8.0.win-amd64-py3.6.exe
Algorithm Hash digest
SHA256 9948cbbb2f6285a0bba02c6756a6eaf849e5ae660af0a7383724dbfab6b2f70b
MD5 a6d19c7882d48b60e833c73b5ce0457b
BLAKE2b-256 2bd9a16d673baa7cf088c7c8d36f3db593948de3b529acef8e2e948ec541dfb2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.0.win-amd64-py3.5.exe
Algorithm Hash digest
SHA256 d1742e98ac28bb45e385e1a9f6830f108201fef72853ddcf67e4b8f29ecf16a3
MD5 7b72b46ab49c4abc0d75f6e7ccd98579
BLAKE2b-256 1c548aa2662b01f955e19e730655e6e56a316fd1091d4bc070ed2df2a0b31b5c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.0.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 307f610e37dbcf1cb51af68679af979ebd218629cf39d3a8c726358a268f4927
MD5 ef18ec3133382e79132065ba92991e7b
BLAKE2b-256 4928ff19345736d689b0e6041b99cd85141242f2b23fe0a94dbace57ed49727b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.0.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 bb0ca0d885bd9148fb6ef934b29a591dcb0c4fd6a19a8c07e9e0b91f0074d9f9
MD5 d238e853a0ff50857c4cdcbc3504fcc3
BLAKE2b-256 a3e46efdabf7c80d7158a84164087f892d42a7b43d44e27a02c856982da70cb3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 024283fbd14824f05b655efb3f8b7421eb24e0523095f29797763c931ba92fbd
MD5 cd432f018422b1d36985956d1b10a9f8
BLAKE2b-256 5814f1bda1734cce923d1d30569a92dbc698c6e7aadd61f34f48096134185514

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 df8b29c7fe001139f1531565772926046d5d4b2481d9543d229c5c6ad2cbf677
MD5 0b5f1a00c11416337f86cb3ce7c85df5
BLAKE2b-256 f45bb10101cf3bf82e7cba40c6bec2015f04430fcea2b0375fb2ad3f600bdd35

See more details on using hashes here.

File details

Details for the file cobra-0.8.0-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.0-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 940f97a4051415d30256b77afdc582cc05e363ae515b1098ae45df8c791e18c2
MD5 6de66c47d11f6fafbc8fb0ae1e7016f5
BLAKE2b-256 494d0b85dc05e81e6fa2cb4aad4c442452ae4f9cb813e82137fe5efb1e4e94ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 b2268b373e976d6afb8d117de6f3c60b188af7dbed95dc410e5865d6ce37e357
MD5 1d57fcac86b9d543b684284f725d7141
BLAKE2b-256 a60ff8057d511b664e5ad49bc8e7bf55ea1fb8b85f327d04848b6b8d39dfc9fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 84986fecddfe3365b500f38c27969428d83399ed3b216208aa52eee835f83755
MD5 94392bfca85937031d1fe5ac3a5fc549
BLAKE2b-256 c53ca58776bbe3285314e35af1b35cd01c75cf0c6025d1cf5b57e423d5aa47c6

See more details on using hashes here.

File details

Details for the file cobra-0.8.0-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.0-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 4d47ba3eab7d5f4a743dee68a6e55b86eb62a636926a82fef9db332bf6d9aa41
MD5 87ea2541fec8f828def0f876e9165521
BLAKE2b-256 7e8b104263519039e77cea8fdc105e15c2272a4c6a0e9e02eeaa74cc85c8a354

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 715f36eadcd0c57ac87b108c74c7af0c409e4e2a15c12da39e2640b22b1d5361
MD5 3eb2a7f1e7279b3903433f424885ca97
BLAKE2b-256 432631acdf4366fbdfab27fee994197b6e9db1ded526f77e5b7ee8c4a7621144

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 828a992574506d1685777e72de238c093f94af5575851b9b33d8792405404b0d
MD5 b3eca2f98508aa1d8fcae39c39f6de79
BLAKE2b-256 34b5af2f0e4821c289a341898dd6b2c132a812b2dbfc0b0abe522fd685704388

See more details on using hashes here.

File details

Details for the file cobra-0.8.0-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.0-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 387f4e465b3aaca8c6efa750f73d1b8899422f4dd798f87994ecf95205f80493
MD5 3f688c9bf21908c45804968c446f770e
BLAKE2b-256 1f5a0e069417a610ec90eeb56e53492507ad9023242fa65cad65e28d55592b1c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 fc4c2fe6aba06c633e9692cdd97e77ac10f368f7a4dfb3eed5bd8c8eae2a809f
MD5 2f5a292f39f3a6c1c91e51ff1472f2d2
BLAKE2b-256 45695b4ea331675eacde321a22a1b31810cc0d685973072c3a2e34e9d2a4eb4c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.8.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 af8cd82186bd70e13f14116c943ef3d47065d055802d210b971d08e9880e92db
MD5 54aaedb3bcaf89d667bbef793a8d7a45
BLAKE2b-256 76930db638817a305a3ea25643842f0f9cca0f7f931565166f2023bd4cd511da

See more details on using hashes here.

File details

Details for the file cobra-0.8.0-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.0-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 d7039b26a352b903219f25e8b8407bf3c21aa09548845f6770ead023639dfff2
MD5 0a6a38735976286068d58e59aa1708e8
BLAKE2b-256 bc90a7daed5d92067d1917532dc461645a07b4b7087025547792e728d19fc762

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