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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m

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

Uploaded CPython 3.4m Windows x86-64

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

Uploaded CPython 3.4m

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7m Windows x86-64

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

File metadata

File hashes

Hashes for cobra-0.6.0a6.win-amd64-py3.6.exe
Algorithm Hash digest
SHA256 2f790305c521e27c8252df45b1ee116de6b4a4fb4dc6e89d8dd32388010718fa
MD5 61609c3c882338fb0867fe0a1d6fec61
BLAKE2b-256 90c4aefe97f7751d456829ef1d1be8e004f52163356959e519f97af1fd1fbba2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a6.win-amd64-py3.5.exe
Algorithm Hash digest
SHA256 0146f24e67dd822deab7d04f7f9dd9296eb026c811c0a54cdd0d52af387dc6c0
MD5 4ef5a8db496c1e9b7a344fbfff28ff33
BLAKE2b-256 9915b5686bd30b14ae3c36a3817e65b8d0706bccf7033be781ecd6e862e166fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a6.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 6389e12a097977cf0dd758980b20eae1179c6e2c394a6edbf5efc93011210394
MD5 c5d673dac35305ac448189d28e769496
BLAKE2b-256 f816b6ea291b80947f78b11bf0a43b0ff8b36376c6329749a24325628b1f13dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a6.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 942d30ed515d02b1c2894bc76379d69df73ee9bbb0ec3e159eb1dc94fb827a74
MD5 c9c66e604a33245f7f70d17a6f590c37
BLAKE2b-256 4f98ef0af222a0a83387d95db96f225b10e362807472cbdf785e558d43d219fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a6-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 dd874f7e04feca95818c0f3ad88471fc7b2142423e04486b1b42a95a0cfa376b
MD5 3d124ded9f105211ba85f48d33b8d218
BLAKE2b-256 efc8fd20c3b6fce25e19889457b279e00535d99dfd3dd483229b809f7244463b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a6-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 99039edceb078a4a9d59d7f73dafeec2b87c971f438ec15cbd40afbadab54384
MD5 569132c111581895f35648a364c901e6
BLAKE2b-256 9f7dbed022370a1b69cfe9e43499d499c53f15ea3594e27a05c134678bc6f475

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a6-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.0a6-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 9599683c4d45640fcd731689cf1284486ff1b1ede473d7dd12144219352fbd46
MD5 507f305cd66ba38f9acd73bcd59ad916
BLAKE2b-256 ebaafb33ac491c166365d4fa9f65060295ecae0759216060d114a80a4cb1176f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a6-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 916904413ddf2b8c3b90510e8e302531e787269211f3fe6f2b724bc4674d7cd3
MD5 20bc913b73634d7dbe3a712aa8bce0df
BLAKE2b-256 d1dc381163529267d7ed317f38683e2a7dfa8682a19acac0687807250635b566

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a6-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 def9a99294ed1c71e9fd472c49c45137331da92b58ab5d6e54ef515411f14105
MD5 b6d619ed63dbfd9a3fcab3e9414ee1fe
BLAKE2b-256 627cc70e8578410be3fc3109804f8e3a68b79b0f83b4880a2a4b5ad57ab2fba0

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a6-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.0a6-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 ebea41abf4d0dcbfa473ad94aff479974aee3d526790f8e16eb70e8e72ddbb5a
MD5 a230e3532cef2de83334e6a622529c21
BLAKE2b-256 4e1dce1a782702ea018e0197dcd4b6e8bc1a3cc92bf92a2c1a907c1b0d79bb89

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a6-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 80dee72954750f369dcfe1a392ce5dc805341a8f8f8885d1e8770aa2df433cd6
MD5 003e18bfa956bbd8d56f6fb390481e2e
BLAKE2b-256 1f2bc6f1bef8f446aa45326dc68285b35c083e99c44ffec1a29890ef62ddc033

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a6-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a73666970f005b38f0f896f4a608cea750293544b0733527caf0e83be94cdbbc
MD5 431a5541161eed214019c688d5108fc4
BLAKE2b-256 2042998c4ffc296a608166779806a20e03500fe26a8c6b6449d9e026985a6466

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a6-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.0a6-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 8afd61a4da8ad4fc44197b4f3882248a687c4a2d0ff5988b5f5384f71e65112b
MD5 81c220b839173ab3a0b2a71895b847cb
BLAKE2b-256 4608b498f691b0efc8af5314b8b2c7a60b03dd246fbd379980f918ff90000148

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a6-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e49c52f42890f1378b3a5dbe1277a2904b17e99846d42f9d81934b9e848e4e15
MD5 638947804482b1a03a150b608f819f03
BLAKE2b-256 1cc0f834d6bead4ac5fdb5db35b3ed76c426703a0cf14589f56f2c3a3d5bdbb5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.0a6-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 60917748727521f863294bf7f471d61cd48aeb2987ae0fb8f546461b0f302124
MD5 1fc8e8abbb723ff523c1d060e7d23a98
BLAKE2b-256 755616622cfa7a9aa1e28eccf2ac9e18cd17039b0af877a9c54273e49352444b

See more details on using hashes here.

File details

Details for the file cobra-0.6.0a6-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.0a6-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 b224da3c88af3d690be5d03342d6bc61da101be68b17baa1d20653bac27a4f20
MD5 831612bc058a3768f8754c5458c012a1
BLAKE2b-256 ec019728b81cfd228401eb06379a62f00c32ddee8548e3bcefe7d1cff686ab76

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