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

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m

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

Uploaded CPython 3.4m Windows x86-64

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

Uploaded CPython 3.4m

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7m Windows x86-64

cobra-0.7.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.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.7.0.win-amd64-py3.6.exe.

File metadata

File hashes

Hashes for cobra-0.7.0.win-amd64-py3.6.exe
Algorithm Hash digest
SHA256 ac989dfce7b8ae707e6e82df5cff2a5c866b7d88e27706f3e850719604fe4e66
MD5 d6f3fb1e6e5910129f1b293d20e59ab9
BLAKE2b-256 fb3bc1cdd64bb6621ff25c33007331d155191540ae15930454a1f0c2c80d1921

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.7.0.win-amd64-py3.5.exe
Algorithm Hash digest
SHA256 aedd167258583e1c14934d2d9db3e0c37e49264ac44ad01676bc971ad74f175c
MD5 cadd93ad9dc718f8dfbe7c1d7be55364
BLAKE2b-256 e7aff5d30eade5536bc0eb11d127c22b98a76ffaf67c3e27bdc2890b21ed048c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.7.0.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 952b998483a4c1f42f64fd9b35d94d540de0aefad59f1238d340cf045ada054c
MD5 5b9ef45a1edac820a250f89ed608082e
BLAKE2b-256 dafea104446ec478ee027d6be6aa8aad516a11114020521569f0023d115afa72

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.7.0.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 f2d684c3e141fe8ab2148b5495f230686c752d3fbf11d4d83f2a49c85b8c1810
MD5 b5d164ffc5a4bf50ea2bc6719d11af39
BLAKE2b-256 251a1699c7179ef1defe57e1c7e789f92451449aad9071af87921f1434db667e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.7.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 9756c05df4b7089ce861e477f7b62f07c55adc52bea6a30bc14cde74b638d69b
MD5 fdc4d19ebc89010039bc951a42171f78
BLAKE2b-256 9cb94efdab0ac91f53fd3c0d6bb630f34dc44043b87bcfbbcb3151955c083882

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.7.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 26779c125b31f6d6adc7c90d58fa480bc5b2751357f64f4ed371a822832f4a0a
MD5 4cf3a425d5b356f17589c469e3aafc25
BLAKE2b-256 3942694bfe8bb2bb3cc483253eb9f567617a5b1230af4024530ab15123a4e66b

See more details on using hashes here.

File details

Details for the file cobra-0.7.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.7.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 e66541d3137d5d8ec1a95ee55097b2250e2cd3638ea1cc7d6333a005603e9826
MD5 91be89b32f93af44e194a0852dff788c
BLAKE2b-256 c8b15b6a9c2c993f499529b8d4a8e7c5366613bff547525be2ed997b8b20fbc2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.7.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 c5c50087c3f7bb3d1f04f2fb5d963cfe20bd27de94190ebc9c975a3d9e4281dd
MD5 ca9cfc52ab932b2f1dbbd3600ef15d76
BLAKE2b-256 a00aa8654f64e075beec380972ff51c3e7df1ac5e90ec5f0267ee396b32bc64d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.7.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ddac7efb60fecb69576e680d03a5566a755855542e2a467f18e00b8af224df90
MD5 96820ab9b7b5a6aee5bf812142a0ec7b
BLAKE2b-256 633df21147f669540c343cc40170ba0bd84d975c35f6bdd917a4b208d3473fc2

See more details on using hashes here.

File details

Details for the file cobra-0.7.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.7.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 0a6bb8d011aa2aa9127749730da4263bf1b968300493928ceaf70c7fd315c518
MD5 fe54842b70efdf988b9f2829f9da8708
BLAKE2b-256 4ba3adc5d42324496c0378f4806d47ea8aa4d779defd40e4db73116c07b73e86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.7.0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 bc90e0e11e688f4ced3c5c0710a5f9741fcdf54f9e84263d4da9ff1de228c612
MD5 31cd76eeabdd7b6fc7dea596d112264d
BLAKE2b-256 de4da8acb403ba0c82b537bd8556a6449c5aff2a10723ef7a5eda2e45d5e9134

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.7.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c82e934d67d9ee663289f81067c2d1fd01ae10d9d3d21eec6e163fd13e02a662
MD5 3de9810df682aaf273eaf2744adc5b23
BLAKE2b-256 19585a06bbff7d478af5cda4c5bc2787aec71501008efd8938bb26e5fb74b7f8

See more details on using hashes here.

File details

Details for the file cobra-0.7.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.7.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 ef40714d7834cbeb98ea310fb84fe23426adfe710b3fc5fdb98f51e40aca95fb
MD5 ce87abb522e23270e9dfaac66ce68c9a
BLAKE2b-256 25eaeca5c634f6470178563b62bfa818dcaac50443f2cebdc9e42444dca60c95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.7.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e89801e12068c3b5aa6e768738a25aa42ce06abdc29b9c6f3f9ebb9bd6a11a65
MD5 4c21a733a328ec3b5421c292584864ca
BLAKE2b-256 db0301f947f1b20e41aa89aef2689891dc771d02e322fba61e3125626a95c1d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.7.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 0cca71d5c90a5ab55db2a3e03ccd6bbf517d8777d4c35fdd004223e3ba85ac5b
MD5 6ac6383983fc10131e73f71992706b8b
BLAKE2b-256 14d51f50b7675e7a82ed8c5e0f381bbd70155a230dd02673472d0e9bfdf9abc2

See more details on using hashes here.

File details

Details for the file cobra-0.7.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.7.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 0f2e3d8bebf1174d4db755d8c7faede918aa26093a1c6d5171d9bb009797fb2a
MD5 23043ded841a50ffa4eec34227069142
BLAKE2b-256 809b3d410a7cae9b360b3dbab595bc2c752ba48502541563e55d163bc7e5eda5

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