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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

cobra-0.5.10-cp36-cp36m-manylinux1_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.6m

cobra-0.5.10-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.6 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.5.10-cp35-cp35m-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m Windows x86

cobra-0.5.10-cp35-cp35m-manylinux1_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.5m

cobra-0.5.10-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.10-cp34-cp34m-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.4m Windows x86-64

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

Uploaded CPython 3.4m Windows x86

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

Uploaded CPython 3.4m

cobra-0.5.10-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.10-cp27-cp27mu-manylinux1_x86_64.whl (3.0 MB view details)

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7m Windows x86-64

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

Uploaded CPython 2.7m Windows x86

cobra-0.5.10-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.10.win-amd64-py3.5.exe.

File metadata

File hashes

Hashes for cobra-0.5.10.win-amd64-py3.5.exe
Algorithm Hash digest
SHA256 94023e4f26572ba13be8cde981d04cb15882157957b7e189523012be2532f6e5
MD5 aae03167d0df0fac976f30a7e60efcd7
BLAKE2b-256 38948bdb88d2159b5714cae5447f8f20f17e36331a0de9493458f0d443b18656

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.10.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 fd83a638e31bdf88a2f42e1fa1e8fdc4177bf1ef900ea7dd4579b458562ec020
MD5 1e0ea653c58de0064cd726a1249194a8
BLAKE2b-256 3f724795903f1781c3f3abe5311751b1ac3dfce04463ca14dcd2aaac4938b00d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.10.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 f8f277587a992d4fbf6b751e25f00396ae46cd8abf002f902b35dc63c9a55cb3
MD5 9b9bc997e0ec46ac8357dbbf4e225d47
BLAKE2b-256 f3644dc9e8748bb8572587c3fe50fa3173a3a9a0937e4f82c7cc5318d32d79da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.10.win32-py3.5.exe
Algorithm Hash digest
SHA256 799e8714a2dd20f7f3b87a549f78f338ab518cef7f689e3794ddb85f8e21d0f4
MD5 8eaf911c7dc2a8013bc54237a1892da2
BLAKE2b-256 5cbf4dc810d1db5846ba50b9ada3c4421b1a15224d5ecdebc2ff20163605bb63

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.10.win32-py3.4.exe
Algorithm Hash digest
SHA256 4caa73f3ea1d84ba57900c4e2d950cae1ed025eacdce95c0bd4d8e6bc165680e
MD5 54965f5897c1857f1658e49192853462
BLAKE2b-256 514d3487497b6167a7c6e8a7e527a1939f240e3d21d861257f348b924d55673b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.10.win32-py2.7.exe
Algorithm Hash digest
SHA256 006bc6966bfe1cf1fe5266c8ca3fa4d1c85d7a0724fdb7d341747366a1b07cc3
MD5 fff1967657e1a532f51142e5840158d7
BLAKE2b-256 70875adbcb8ca01edc306de6273416223192e0a7e88d135f259b833da3f7fe3d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.10-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0270e61dc8af4742115e055d356c4b00fae42efffd981b0080f0afd4e3ca584d
MD5 ee0fe6ebc8c3bb17f8124e651e0472c9
BLAKE2b-256 1393a2fd81393b453e459b049ed3c7ba093998d8353a846f56b235b1b6edc6a7

See more details on using hashes here.

File details

Details for the file cobra-0.5.10-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.5.10-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 cf9c05b6d345021f5597c7fe43f52560cba9dfbbac72cf15cdd6071ab7ab0744
MD5 67a6b132c95d14358fa5d920a483aa66
BLAKE2b-256 9e85221d218aabb0c162cb98f5bbd77b8944e35715a93fa617d3744fd82aeca3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.10-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 051c3846d3f8c6148afa000eb8e993bde39fbe796babbb8a9ebb29400a0e72b0
MD5 d3189ddbba963f564cefe246566dcdd8
BLAKE2b-256 e6b0f61e69e8456d5c886f9fd611a1892398c7b5dd092000c33a79fbe7efc9cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.10-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 2c5c6e505781258adcb81cf1355573dedc6401547708b5e8f17d50fdb8358ee0
MD5 511b246ab3275305d9aedca0bcf9a188
BLAKE2b-256 df335fc93b1a9751bada78e6dd8db77b9e1fe071cc8918e51fc2a9b9394796a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.10-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6c49eab10b668e7e20dc2fc87c9f777f3fdb4d3c134efc21ee2dd36cd0a83400
MD5 4015496c8db9560c172984798a52a1a9
BLAKE2b-256 68b484a5286e1dcb8e76f15c0f7cbbe853801f5ad6473012347ebdc6290a0004

See more details on using hashes here.

File details

Details for the file cobra-0.5.10-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.10-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 e1614ed24a5de1fd7f0ac0f95ded0f3cf02b5030cc838fe774e9704c9f0cc1ec
MD5 ca94ffc3a043c983ad7fb0eaedea5273
BLAKE2b-256 86a6461cab597f0adf920ca7b7cff06e89e4b4def84c91dc444a755225da79a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.10-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 1ab2520960152498e1601ab2200bc124a064890b7a9dbf986d9735b98db19b52
MD5 77f87cb3e61f30c53ef5533a365af836
BLAKE2b-256 67781f40a835d2f9b0a17b1ae4fb600e7bfb92872839e8fa5c74a4bf48c018f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.10-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 dc7add164a7719477c1f0363cebc989bf5f3f38a6892f6f3567a4a930e0bf1ed
MD5 37bfd3a7a05cf9ba9bd8a925d01cd024
BLAKE2b-256 01e6bca5beceebd418586d802a07cbd9b1572f13ca4a0270fe2357955087e73b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.10-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 be76b825aea595b050562a71dc6b41b17d0580e6e3467db6fe05fced9ae0cb55
MD5 a35804ff9502792f2ebdd4ab40ccc91c
BLAKE2b-256 5d5f96a25faf53a2aa3c6d92f95e39ca970d6359650bcf41d5bd640daecb4732

See more details on using hashes here.

File details

Details for the file cobra-0.5.10-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.10-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 1d41b5474ebcf80fbd72dd0300e3cedb75a804ce45c6bbe6b8095f58c6896417
MD5 062eaf830e89e7eea759c07d8ab2c6df
BLAKE2b-256 513fe4ee7233d9a9988096627b86d1372ecddb891d6f4877a29500f135ba0226

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.10-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a06947471cd1d76e1338d89441d330e893cd86a8e72ab315ad23f9982a3e76ac
MD5 06d2080dd3a4ae57b557368a543a3559
BLAKE2b-256 c0ee7b4261144f754fe2f2ab96119d816705087aa6fd85f435c199ee91e7214f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.10-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 6a55d0d43c4c9f08496c1a55a9f90a7be74cb5b2598990d329a89856fcd5e7a5
MD5 1125d855181ec3bd79b272059af08749
BLAKE2b-256 69ae804478157ede7a0e5df931e895380ab23b10c740ec26b51615838ead89f1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.10-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 489d5d654a893829bb4dd6c7d14502556f0539934fc85b96568553abfa2e9a2d
MD5 0aa43bc75e51b282035e7ce514f7f6a5
BLAKE2b-256 855e6c5ef612032ae58be3d03ed7bcb442c3f18e2d04c5f7c300ee3f709345cf

See more details on using hashes here.

File details

Details for the file cobra-0.5.10-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.10-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 b3362ef3eef85a878a0dd04788b708e0b5b2df8950fbc252424251bdc74b6885
MD5 69ded69f88babe73eb990895bf9ddd96
BLAKE2b-256 002b94038b8edec629794da422cd49b1a6df84c88a478720688e5a1f8216b840

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