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.9.0

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

Uploaded Source

Built Distributions

cobra-0.9.0.win-amd64-py3.6.exe (2.5 MB view details)

Uploaded Source

cobra-0.9.0.win-amd64-py3.5.exe (2.5 MB view details)

Uploaded Source

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

Uploaded Source

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

Uploaded Source

cobra-0.9.0-cp36-cp36m-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.6m Windows x86-64

cobra-0.9.0-cp36-cp36m-manylinux1_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.6m

cobra-0.9.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.9.0-cp35-cp35m-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.5m Windows x86-64

cobra-0.9.0-cp35-cp35m-manylinux1_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.5m

cobra-0.9.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.9.0-cp34-cp34m-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.4m Windows x86-64

cobra-0.9.0-cp34-cp34m-manylinux1_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.4m

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

Uploaded CPython 2.7mu

cobra-0.9.0-cp27-cp27m-win_amd64.whl (1.9 MB view details)

Uploaded CPython 2.7m Windows x86-64

cobra-0.9.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.9.0.tar.gz.

File metadata

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

File hashes

Hashes for cobra-0.9.0.tar.gz
Algorithm Hash digest
SHA256 fb8d4b8a5266d7ecbe2d5cc0de6fa527ccc9059ee1b7730fa520fa1a962485ac
MD5 60a3b8a1df621f632b219e4220c83f16
BLAKE2b-256 982a4755a4e404d1584d8a2ff3d0f9b77c117eadd1972524c2ab0107e60bdbf7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.0.win-amd64-py3.6.exe
Algorithm Hash digest
SHA256 e38584462053c613802717d2d79c0f8b4e48ac09ee6ad1438cd15644f035cd1f
MD5 a480cce4928e50267ee50a8a2255e9ec
BLAKE2b-256 1fc59d114c0bed92211509981dd7ad3e75038b3d428ac1782e87c37d12580133

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.0.win-amd64-py3.5.exe
Algorithm Hash digest
SHA256 95068dadcbdc39c9c0b1794e5de682b8ec677893b34227d99abcb20ec04b9d67
MD5 03740e29967443199282822b4b252f14
BLAKE2b-256 80b7fb24d4b5b025e4eb2e52d57c9410469ca8a1142c6f9de1cc0216e9e4413e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.0.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 cf4f9a639ea77ab0c54ec3e9e5a010290320670aa5263ff65324c4a0477b420d
MD5 1fc49891e21c7f66a9a7ebe9b0714a50
BLAKE2b-256 70b2d475a2c3daff891e984114106db152b31f759f26d2d58d7df21de13e7a57

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.0.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 c9801189af9fcf62dba7e8b3a72b1c7bfea18dcf13c7da03af30837ebead4f6b
MD5 daed5d6416a9ae0aa5eae03109f95cfa
BLAKE2b-256 5dba931e970bbb2f06d5d6a69523a5c153f01b54aab14c466ebb95eb5f6a085e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 8c4a5a246016d0fb7703acc8a1d765a9d1085c1e6b7daff7aac21ae10373e23b
MD5 3170693e08e5b81c163c5db57f8b3cdd
BLAKE2b-256 8776b5a03aa57be8116f3f7da1c4b7890aee30dfa4f946a8d9788c4bf07c8055

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 97f5263922962849262e1b9fd0251b401534a235024c55df336c47ffc2593ae3
MD5 c7b91afa7ef7f4c4c902c483710389bf
BLAKE2b-256 ab5f619e5f949066afa1749de60617393090b3b00698ece28e5f9d8166192d4c

See more details on using hashes here.

File details

Details for the file cobra-0.9.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.9.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 5299bdc513e11426af677f68d9bcfa850639b2f0128be0905fbef701462a43d7
MD5 aa62a820494e0085d938567d14315eff
BLAKE2b-256 fc3fa54fb0de8b7afa0db76b5ee15318971e7123b5a9d86381f5dc02b2518faa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 5c20ea78712553beacf6c89ed1eaeee0cd7a1da6733be9ecfd6e5cc4a96de78e
MD5 a8ce4842c864f111b64793e1e7193535
BLAKE2b-256 6eea33c1860c8bec0be7dfee7d57595060c8be2f9e2596200ad088d9e9da2577

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 04cf189225cc1754c3990d62f851fac23e3207af1fe1564e0fb94e2b0063eff9
MD5 5c91064418dd400eff418f7c75530761
BLAKE2b-256 b41ed52b0ddaabe3a67fc15a474cdbd0d5f6b83d30f500e3d110e1c47b1accea

See more details on using hashes here.

File details

Details for the file cobra-0.9.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.9.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 1dd0a0e9a1c656b05f305e828a061e0c5956115b5b9fb03115d4995c2fd8ceb8
MD5 ea313031e54c9683d91bb3848083557e
BLAKE2b-256 e170b0eff396dd2ce1b2d38cd1b48070e748ad602db9c896775fa50da1e62eb0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 ef0b06a5145d516f9a7a4f67c49be7481c145a36f785d82c327a2b07cbd9cdb3
MD5 4ca3cf7b8628a2a79e7fabb821a94012
BLAKE2b-256 929a8ddd7381b1710418486ec498bf42947e146c8411d88ea94752e2c8c75da2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d848d4951c684266f3583b47100c66857c010555a555d396439cffd7e8f7557b
MD5 e3cd67b8b3a6368aafc5be0e195e2b21
BLAKE2b-256 14f39a54a9cb67fbb0c768419cda3aa954011f09aaf919bb5b75a2686e3f5115

See more details on using hashes here.

File details

Details for the file cobra-0.9.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.9.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 7ac687b6b264f21ebd2c89925c7fa3bb1d589794ac86f3f87590bf8524445bec
MD5 738df4e916134c00878b1aa480b1ca53
BLAKE2b-256 665e8f8ff7eb513d9c59001a94c945871a09c482bb1d8bff0d5909ef3de18226

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 107c4bb4219aa2682713141efcfca767db1f433e642a7d2932ce9f849c25d2b2
MD5 ec5e8156be7edd1af13d2c5297a2a01c
BLAKE2b-256 1d55572a1422cb61824efdad56293dab048ea1f063e38b831fe6fd87c2eb25f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.9.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 c3d8ecceee2e475f3b19678b59f6cfd7d55596f232ff5013c4b40b9b6961260f
MD5 b2a18effbd5988964f5a669e16197f59
BLAKE2b-256 17e3b8f6ff4f6f61006eb2b2709a0b23b7353bc0a970113c0ff4eeaea135952e

See more details on using hashes here.

File details

Details for the file cobra-0.9.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.9.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 e625d208b01301c3789a9629b72194c7cc0113204d62d463af11ad7bcc703667
MD5 f4690f04e4ffccae822178fdaa586add
BLAKE2b-256 8d155e8f6f1a6f23b403f232530e7b82851bba25426de48f4d272de12cda59dd

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