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

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. numpy >= 1.6.1 for double deletions

  4. scipy >= 0.11 for ArrayBasedModel and saving to *.mat files.

Other solvers

cobrapy comes with bindings to the GNU Linear Programming Kit ([glpk] (http://www.gnu.org/software/glpk/)) using its own bindings called “cglpk” in cobrapy. In addition, cobrapy currently supports these linear programming solvers:

ILOG/CPLEX, MOSEK, and Gurobi are commercial software packages that currently provide free licenses for academics and support both linear and quadratic programming. GLPK and clp are open source linear programming solvers; however, they may not be as robust as the commercial solvers for mixed-integer and quadratic programming. QSopt_ex esolver is also open source, and can solve linear programs using rational operations, giving exact solutions.

Testing your installation

  1. Start python

  2. 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.5.3.win-amd64-py3.5.exe (2.2 MB view details)

Uploaded Source

cobra-0.5.3.win-amd64-py3.4.exe (1.9 MB view details)

Uploaded Source

cobra-0.5.3.win-amd64-py2.7.exe (1.9 MB view details)

Uploaded Source

cobra-0.5.3.win32-py3.5.exe (2.1 MB view details)

Uploaded Source

cobra-0.5.3.win32-py3.4.exe (1.8 MB view details)

Uploaded Source

cobra-0.5.3.win32-py2.7.exe (1.8 MB view details)

Uploaded Source

cobra-0.5.3-cp35-cp35m-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.5m Windows x86-64

cobra-0.5.3-cp35-cp35m-win32.whl (1.6 MB view details)

Uploaded CPython 3.5m Windows x86

cobra-0.5.3-cp34-cp34m-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.4m Windows x86-64

cobra-0.5.3-cp34-cp34m-win32.whl (1.6 MB view details)

Uploaded CPython 3.4m Windows x86

cobra-0.5.3-cp27-cp27m-win_amd64.whl (1.7 MB view details)

Uploaded CPython 2.7m Windows x86-64

cobra-0.5.3-cp27-cp27m-win32.whl (1.6 MB view details)

Uploaded CPython 2.7m Windows x86

File details

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

File metadata

File hashes

Hashes for cobra-0.5.3.win-amd64-py3.5.exe
Algorithm Hash digest
SHA256 25b0bdabac3a8216b556339d748eba63cf3193e5737aac03d37b0f4f721f10fa
MD5 058adc96e8a8e5ad670a5f7847a8c39f
BLAKE2b-256 a5b44d1f4b4644740fb1cc4cf653a52cefe3b272accf9c2d90101b62a08fe9ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.3.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 a64628d2e8e61ff74a444481d68b3ab7c56049c397532f974c623a26bd96dc16
MD5 9ee4ba3efbebd9e4d0f9dd74fc8f7456
BLAKE2b-256 f52f8de9916cbcaa9cc6bfc54774c4a74d8d6c4ffcf4147f985974326eb0ba42

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.3.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 dab890231bf99c9e09e8bfdf0f630b1da27a3b6e62ccd2bb29ea9e622843cb1c
MD5 bd5cd2b17572f58d41059674c67169cb
BLAKE2b-256 24ce05d1a09592e98c0ac3b6ef566e4ce201ddac60b07e9dea8cf08bcf370bda

See more details on using hashes here.

File details

Details for the file cobra-0.5.3.win32-py3.5.exe.

File metadata

File hashes

Hashes for cobra-0.5.3.win32-py3.5.exe
Algorithm Hash digest
SHA256 c6c7e9e0f23bfc2438623b8f3a3a00130407aadcb73827f1fc4f3c4c487c092d
MD5 f02b3de374c86270d63342534fa3dc7f
BLAKE2b-256 43db722e5d27fdd9d3d0b6124ebfc20293622ce3d48bb715e57a1617451f6ff0

See more details on using hashes here.

File details

Details for the file cobra-0.5.3.win32-py3.4.exe.

File metadata

File hashes

Hashes for cobra-0.5.3.win32-py3.4.exe
Algorithm Hash digest
SHA256 f656fba3cafb892708ba93c7747af0604b3b9ba8d16c46669f1af2e0b43a21a2
MD5 574ac06298bb2abb4b1fad505222b4e7
BLAKE2b-256 a46f0ef3fb20049ed88766df621910b89f2a073c7b209abb61693893b19b7687

See more details on using hashes here.

File details

Details for the file cobra-0.5.3.win32-py2.7.exe.

File metadata

File hashes

Hashes for cobra-0.5.3.win32-py2.7.exe
Algorithm Hash digest
SHA256 8d2f9388cbf3d97c1865793bea1cca2edd8be2fb8124c0856273d168b3dcce38
MD5 6231979ac2762c06a32639bd4e60b479
BLAKE2b-256 a5a464033c61d10c931ac6e987416196cc82b4db98933e3603fab87a827e4d5c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.3-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 aff96a5a3147fe3b54cef27ed0accebb84b4b8a69e8309b8c7b82ed441cb1538
MD5 255a073877333987e2eb05a9bda7490e
BLAKE2b-256 4f31e38af48f09283842446800d572fae35d010d6c3ae3e99a80e957f630ff26

See more details on using hashes here.

File details

Details for the file cobra-0.5.3-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for cobra-0.5.3-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 cf89aea2a4f0b21c98a55ee50e2617a7462229240cfb9f4e61464de93908f9a1
MD5 e72b24f9eed780cd2a89ee0936639ac8
BLAKE2b-256 3ce66567d5556fc01d7c58750f2e45b2e2158d4a9568a1d6874aa92b6978929b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.3-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 9ad1617f0db5c99c4f27529f9a01f08b88403431788001e9686ab3ba6d4e7719
MD5 4a5ef84b51abb1f315a0925b542323d2
BLAKE2b-256 824c827fdbc49ed2b32da89a32cd890704a31c002128fe31d6ea0c5d6a8386f0

See more details on using hashes here.

File details

Details for the file cobra-0.5.3-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for cobra-0.5.3-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 7eeb664d3a87f6bace7ca0c456c638d7648489b5eb4fd7602684f67b49219522
MD5 65e9e0ac86277151e693c63ae59a1268
BLAKE2b-256 7f6eb129ac21607f1b5e66faa34dae13292ed8c8e50e3fa9e14b977f34ca91e7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.3-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 8c57611d5a0b724c48c2863298aa7cc0257be0bfd562d1274696a7c972dd86d8
MD5 4acc6ef5d2901b75c857a663eced7716
BLAKE2b-256 a4806f7fe3264c83e7f0dd3d6a27165f37e4411d6dfc897de99bc4c67fabceb7

See more details on using hashes here.

File details

Details for the file cobra-0.5.3-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for cobra-0.5.3-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 5ed396751d5b478718865dd4dffd3ab99a3e2164f421bd6c3ba822e169ba6c90
MD5 171fd7bdc8bfa2e9dd9d3a3a62ab9550
BLAKE2b-256 00d2ea86036e57fcc02be16c8dc93bab6f3c97e1a4199322799a3f07a6e4eb80

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