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.

  5. pytest and pytest-benchmark are required for testing

You can install all packages directly by

pip install "cobra[all]"

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

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

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m Windows x86

cobra-0.5.9b1-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.6 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.5.9b1-cp34-cp34m-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.4m Windows x86-64

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

Uploaded CPython 3.4m Windows x86

cobra-0.5.9b1-cp34-cp34m-manylinux1_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.4m

cobra-0.5.9b1-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.6 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.5.9b1-cp27-cp27mu-manylinux1_x86_64.whl (3.0 MB view details)

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7m Windows x86-64

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

Uploaded CPython 2.7m Windows x86

cobra-0.5.9b1-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.6 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.5.9b1.win-amd64-py3.5.exe.

File metadata

File hashes

Hashes for cobra-0.5.9b1.win-amd64-py3.5.exe
Algorithm Hash digest
SHA256 4bffb6be73a871ba35821b90b3205759b60818274da44f2911a5d41863577cbd
MD5 d62ffbd4a72c93e43c68ae9e610e8888
BLAKE2b-256 54c4dd673d35f5729034cc03451a4e45c981a31ca37567a9f4592510b1089446

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.9b1.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 204f2e2898681359e771248e320871573348bdb5d79e6d865465e20559393a5a
MD5 b84eeb2fb46d526b5b2c82ceaf4799c4
BLAKE2b-256 c9173eae350bae08184d8695e33d257e1247ca2bed2b90f3e94c43096f3d6084

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.9b1.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 ff62e99bab1b3a7adf735ac6fb8f2c8569319ceb862905fb4c190dd880476fe6
MD5 fa9e00d4e1e89c82202d6af3311eb045
BLAKE2b-256 9f212c0ac2c125046cfab61adcab2a4d7eb4ba3ef76f222956b29ec6378d38cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.9b1.win32-py3.5.exe
Algorithm Hash digest
SHA256 a5315df9de9276b0803868a28c9e67b019a72edbd6a4c1fddd9f1242427f49fa
MD5 feb8749fbc4e69939695c51425e80f71
BLAKE2b-256 665a3a5020402d213f975b15bcc2e06f6ecf5ab98b26350e67989c92f7bd0b34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.9b1.win32-py3.4.exe
Algorithm Hash digest
SHA256 725d6b777b77b9ccd4897453851476120964e66af651a2924f3138e18c66a0a5
MD5 40ea74b26f29071c0fe7f5a8cba706c8
BLAKE2b-256 d4011a7bcc02f227c6491a15be1baf7a4ff42dbbf87d810be905da24b4158d2d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.9b1.win32-py2.7.exe
Algorithm Hash digest
SHA256 46f553da98b331978662fa5136daa1d46bd1074a42090ee57e8a7e7d4a83f02c
MD5 15cbe690fb17ffa667b0a72f0e85391f
BLAKE2b-256 f5a88a5395383d7990b61bc4b78eb236e2a6151a2e372fbfb83cec57ea9e67ea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.9b1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 8d763c6d8cf545e7d234558750415e10967bc02d472decad51f01f2067d968b5
MD5 407185eec6e538aab678b3df0c10b3f9
BLAKE2b-256 abfaff009cda40352847c541b7ea0a13ea9d63a6246f08cea9ca948ffc220776

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.9b1-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 7bb918ab1d83dde07b07a3f37241f65012bcdafbeb74e00bf3ef8aac274adec6
MD5 fcd12fd7a3fb49fee21a8db532559665
BLAKE2b-256 b6bb768cd23062c0edddc69b66c48fdce50c59bac017c5db64bc3b113fa2a5bf

See more details on using hashes here.

File details

Details for the file cobra-0.5.9b1-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.5.9b1-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 e38a18a28e185fc6122dda9a24852e6158c994c747c57bdd46d1b3e21ed5b3f6
MD5 1acdbe9cf8998271b43891a62d5482b0
BLAKE2b-256 034fe522680381725192c47d3ccef9ab9c7d1272784b241632be18a9e24c8222

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.9b1-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 efaccefd7f269149d5963066d42cd39fc5c5fb1b0d622c5bf4cd05b08646de03
MD5 a488043bc8f9b45263a5b46ddca674f7
BLAKE2b-256 8aa10e4227ec7474ea8d73cc6cbc523e43a0c383a8012bd2def9fddc01f119b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.9b1-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 be8c5fd8dceed817e798b9cc3fd8eb6f7a5bb9eb737028393dc9ec03e42773ec
MD5 063034abad2f42b1de91168ffc891475
BLAKE2b-256 231c6bfc7e0b364d378a88012785f0b86b409b505fc5435cde63150e30c7e044

See more details on using hashes here.

File details

Details for the file cobra-0.5.9b1-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for cobra-0.5.9b1-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 379a8a2ed6a4f4d6c5d15d23d693f1021bd1a9868097867191d5e77fefc64881
MD5 740bac5bd8eada92a38fc6c41ac3671f
BLAKE2b-256 3dafcccd10528e4f442b72796975d2dec3b2bd0965cae37b6d3e7d5bd0262222

See more details on using hashes here.

File details

Details for the file cobra-0.5.9b1-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.5.9b1-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 169ca03c6439e5bb6d2d5c249c37cd5f539080e2e1c41dc4c723720d174f5c62
MD5 0d8866f51fe2022ccf72096ed29f7aea
BLAKE2b-256 3f23971411e5e47b3879e6d9f3084ec9b92e729efeea37285421307993e3cbe8

See more details on using hashes here.

File details

Details for the file cobra-0.5.9b1-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for cobra-0.5.9b1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3dd532666630531e388d24a9fed8d1d15ce77176c09b7ca1a3f8a969ff79729d
MD5 b9bba27736e9f6532ddeb7ee310e4387
BLAKE2b-256 c1d43fbd75ded189df0e51c0795ca01a77aff525dd630d7ca9e0f65d890b9d7e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.9b1-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 fb40a39e95339d60575c820792f0e09cf2b6a553a05f967b8f387e266139bf65
MD5 70a732ff8d18787ce4d80127239c79ce
BLAKE2b-256 172e7089fa4f686f0d3cdd6feaae14d198c3803c28ab5dd2d98614d44b61e243

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.9b1-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 6aa63c8a954731caa700eab093243cc57ea141e68cf4fcda38a43951933d51d7
MD5 71a6f81fdf7c02cf922d7b0bd1b5df6a
BLAKE2b-256 9fda1d039b0455b053577fd7544cb93a9983e55f7d5a66b2ee372076b62567e4

See more details on using hashes here.

File details

Details for the file cobra-0.5.9b1-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.5.9b1-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 9903b0213a05d4fac413e87b0192147e3076aab48f8a32425ac4ef4a6d2c032a
MD5 60183b741930198c174876466a3bb683
BLAKE2b-256 9d22b5696a5c8ba12540462f2af469f3f111b385a5b1ea4b16f1df68b6e7cbce

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