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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m Windows x86

cobra-0.5.6b1-cp34-cp34m-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.4m Windows x86-64

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

Uploaded CPython 3.4m Windows x86

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

Uploaded CPython 2.7m Windows x86-64

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

Uploaded CPython 2.7m Windows x86

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6b1.win-amd64-py3.5.exe
Algorithm Hash digest
SHA256 ce8b20e4703f0b09c67bce8a1123c72e414666dc6501ffc6c80862b4aacaee90
MD5 bfaac49178c85b662527902348e6af11
BLAKE2b-256 df96636c96073b613a672ca81fbe03b06fddcc41272d9d0c54c5cb28b11404e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6b1.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 1833383fcf856593e099b2c955809ec1242a6975725d15dcce38d600dad8e34c
MD5 baec7e5a6893bdc95a3a87d9246667af
BLAKE2b-256 e69f5fa29c41fef3a8d8891d75707cb4f1cf2c1d49aebf82dbbf726cbe21e591

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6b1.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 9060799461a4c991bcc2372ff08a2241aac541fc7ea40dadae6fcff5c278d0e8
MD5 13b4089438fded40b8ae07099d6ba657
BLAKE2b-256 bf2a39214565ce163e9cdd464eabe9f6d37a87628b0ebbe0b5c5f763574da607

See more details on using hashes here.

File details

Details for the file cobra-0.5.6b1.win32-py3.5.exe.

File metadata

File hashes

Hashes for cobra-0.5.6b1.win32-py3.5.exe
Algorithm Hash digest
SHA256 bfd135ff81427940fddadee1ceee2e18460f4d4cc9ea598d3bcecccddc54ff91
MD5 1f48697cde18db1585695bc89c1e8e1b
BLAKE2b-256 6b7ab618cb9307e56534148c1789180042f83a08511c3c22910d46fe3c03806a

See more details on using hashes here.

File details

Details for the file cobra-0.5.6b1.win32-py3.4.exe.

File metadata

File hashes

Hashes for cobra-0.5.6b1.win32-py3.4.exe
Algorithm Hash digest
SHA256 f4ed949a70be82f277e07129de2947a4516a917da9c61d954edfe4131323a91c
MD5 004d3707326e58afd2ab5ae8c5b99c28
BLAKE2b-256 a3558877621f8ecd45d0e3e126cc39ad9b27968dc219ff8dd0efaebc0d666de3

See more details on using hashes here.

File details

Details for the file cobra-0.5.6b1.win32-py2.7.exe.

File metadata

File hashes

Hashes for cobra-0.5.6b1.win32-py2.7.exe
Algorithm Hash digest
SHA256 9b86669dc4652932b218ab5ad73150c220846f333274a12ff6a7e1f07c2eb673
MD5 55da03284b900c5c65397876671b0d69
BLAKE2b-256 3638db3f7e4c85bac427d66f4c220ee8fc883626e4b43e92413ef2135e6a5760

See more details on using hashes here.

File details

Details for the file cobra-0.5.6b1-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for cobra-0.5.6b1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 7642ced53e8fc444bbe5566dc6f71acb52120c7d9762000ff40af24746a66b9f
MD5 b13d85387ba6a754a2d38472664000c8
BLAKE2b-256 b9481b8d8872a4da232bc477c5e5d3ea8fb5f6fdce2ef57d7eb6574736058732

See more details on using hashes here.

File details

Details for the file cobra-0.5.6b1-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for cobra-0.5.6b1-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 049db427485878b852b00a858b95aaa4b157847c463c004d43eb90adb7dbfc98
MD5 4707483769fd71fad48ee8950e065ba0
BLAKE2b-256 68ba306f3c2816c4d4a63b7eeaca7747e93dd81bb0afeaae7f68b6c2ae308cc5

See more details on using hashes here.

File details

Details for the file cobra-0.5.6b1-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for cobra-0.5.6b1-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 2f077814db1401c1466ea48a30504f24d06ee98d07b35504a3d01c904faf474b
MD5 56543f09263a72122568c7bbbf85fa85
BLAKE2b-256 19869c9e907d9c3d0ad3a74f580d40501cf142a174170b90656bf290b9971e71

See more details on using hashes here.

File details

Details for the file cobra-0.5.6b1-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for cobra-0.5.6b1-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 b5dbc7ae744758e53c33022a0fe5c2b5c24bef949511264ae7a14890197783f2
MD5 c9b8798e8f6d52eefa3c7d782774b4d4
BLAKE2b-256 17cc21226f3fbf384d9131a45f4b4e9d2a3d8b8589771a5d58cb36fe5a169a8b

See more details on using hashes here.

File details

Details for the file cobra-0.5.6b1-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for cobra-0.5.6b1-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 1fcfd0efbd5f862b245e4f272f4931036836aed3ad110451997ee379de0a41c4
MD5 0d2fbfd9c642878348dc4b479aa64dc8
BLAKE2b-256 d88624d0b807ae59c098cdc4ace8b6a0fea851d83c02a6a5895c031ea63d74ab

See more details on using hashes here.

File details

Details for the file cobra-0.5.6b1-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for cobra-0.5.6b1-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 67e1b17387fe2ddf9b6e0b5e4e82eb7343f215dcf3b4a735f3fc276c722916e8
MD5 85520a877cd8e226c0c5eb21515fb9ab
BLAKE2b-256 c80f89219dab3205c2bd91f7827703a8d95b5cf0c5658420c6406a8cb4ec1a4a

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