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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m Windows x86

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

Uploaded CPython 3.5m

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

Uploaded CPython 3.4m Windows x86-64

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

Uploaded CPython 3.4m Windows x86

cobra-0.5.6b2-cp34-cp34m-manylinux1_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.4m

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7m Windows x86-64

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

Uploaded CPython 2.7m Windows x86

cobra-0.5.6b2-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.6b2.win-amd64-py3.5.exe.

File metadata

File hashes

Hashes for cobra-0.5.6b2.win-amd64-py3.5.exe
Algorithm Hash digest
SHA256 576ee01e1bcb69b4aff599faae4a2e4f20739893b4c1e05aec37df5d92002d99
MD5 0d1b986476b9b6010af99ab20859c7d6
BLAKE2b-256 46566ac11b8d638b3476f232c4026205cf5058a2c8bccfbfb6a622b1f5e8dcf3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6b2.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 528b4ffd27b7bb8585d45606fd51c35cb2b7f7fd0ba443330b068ce1cb96b27c
MD5 7dd9365ea9201140d154701e01450204
BLAKE2b-256 cb94dde5d8b37dc6e739d3efa31ccaf199f918d958122d3cc616f295b1adc46a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6b2.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 264b8a8291350938c05da0bcadec22afbc21681fbce28dda52cf091b99e9b163
MD5 634dc8826e6adb5fb75a38cf607edb64
BLAKE2b-256 e7bfca901f1e749eda92b97b1337c3ce04a396bdbf10883d2962fafd5d4b1a62

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6b2.win32-py3.5.exe
Algorithm Hash digest
SHA256 d956bd9b10118107aab919b80457d084acd50ff1e4f7d0b760a44bc3fe49f9bc
MD5 e1e0cbfd76d0a8b9b06c8e939dde5329
BLAKE2b-256 8f5dbf541e3f99910b51c3641b064206b6bda9383e4cd9c63595fd073cc7947b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6b2.win32-py3.4.exe
Algorithm Hash digest
SHA256 a49af4da45d7c14db73bfa9363bc3b513bf7b3b3625be00e479c71b0b0fc5d6b
MD5 16e8f66e1beada9d558c7db337e03772
BLAKE2b-256 f2b4a18c0e8ed612a9aac400d33990579adb120d4ec8dcdeeaf77b6d7fe76470

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6b2.win32-py2.7.exe
Algorithm Hash digest
SHA256 8c32d98bbf248c6528e3bd51df15ed7fd48d1b598e5ac5d9d747628575921d96
MD5 f9a1288b13bc4786ff75dee2da75311e
BLAKE2b-256 c3f4dde1564c9a309ea7f0de557d5e377d9a38506f51aaca56bec0a56577bd13

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6b2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 0b6a6b99a9a4355eb4fba210fc855f0b5ed3ec8f82180fd27a71108bae09b751
MD5 3d7c9f8864f701a24cf2279ab5e96551
BLAKE2b-256 3a21bb818bd63bd4e68cacde9ea265f4a3882e03d9070e4c3f13dbae61fdcd4c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6b2-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 4972126fa430eedafd044f9471f68d556d11fac5ca4d341288f71ef7e3fb0c87
MD5 88d13a443b62b9b300f25772da1f03fb
BLAKE2b-256 a809e311a2d3f8dd6b30b598b06eab39cf39bd3edf6ea7833552ec2d6c1fe8ae

See more details on using hashes here.

File details

Details for the file cobra-0.5.6b2-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for cobra-0.5.6b2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1f8381dd4015559353a4bd345445cda5e93c8a7acb7138721f2bfc3c877aba79
MD5 a22c15bbd159aaa2773999f13318e3d5
BLAKE2b-256 c273f94b3fd993e56c5c259f6fad41959735ac408b08842975202faf898e5b03

See more details on using hashes here.

File details

Details for the file cobra-0.5.6b2-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.6b2-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 d3eb0cca450837a36e827654489d32ffd752b4b7fa9709627bc1dcb99b1cc70a
MD5 4473cdb126e99e5926ded3f32817185d
BLAKE2b-256 57a2561314de8e0eb513c41e1c4ed21829c5a97b47a5c4bbe5d16452f50410db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6b2-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 6b84d49b7fa8493d2114779c491ec82dbac52dcf52d29c1fe8a6f8f60a27c176
MD5 0758c2a4df7a74ea2ae610ddbbe458b4
BLAKE2b-256 36f965f3d3f571d3650224df7190df45dcb7dccbf6a304bdd9bbe1b76e51ff86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6b2-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 521ec7288dcc14cbabf017020a37f043d43d4d3c3543c2ba25ab5767e8c22166
MD5 062cab1df9769d6cbc90ea8c870c80f5
BLAKE2b-256 3369c3d383b461423b77459dd83de8a68f676dee248eac6f41296e969b6fa277

See more details on using hashes here.

File details

Details for the file cobra-0.5.6b2-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for cobra-0.5.6b2-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 509e71cbc99473e1697559e9a57dc24543885e17a4f020ec5121e03d6e7120e7
MD5 8abb4cb4312aa640abbef0e69ca3b356
BLAKE2b-256 c3d7c5f5a4eff5e7b4145eb57a5689937d58bdc9ec42991a59517406a0d3aa53

See more details on using hashes here.

File details

Details for the file cobra-0.5.6b2-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.6b2-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 8560cd28bf7f166b7c351a146d9c228429b7ad8a8733850acdc58316378a7211
MD5 7ae54ac8f805512413f555bfda3478a1
BLAKE2b-256 e84c138dce93a1d54b389f66e98c9d5e462de9015f31d0ff6d3df02d8b0b1e20

See more details on using hashes here.

File details

Details for the file cobra-0.5.6b2-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for cobra-0.5.6b2-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3343c8912eb7fa56281fb27c0966d28f755de1e9c883d6b4506c04a6e89ca91d
MD5 bacfb2f1eb4fbc00b76dfaa1b94f0fb3
BLAKE2b-256 4db1e566967d1d3ed19c03e08ac1552c73d88664ebfbe4102d0221baa383593e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6b2-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 25231bbcaf328d8e37e7ff379d709a82c89cff0a0e4fef0be033a74feecfd27a
MD5 ce2e0d99c3d11bd4afb9aef12d178dd8
BLAKE2b-256 1431032235d9b2ee808aadd21d938e48a8010b3687590f7de95d4c4db134f099

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6b2-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 a17a4c2821f9f6aa0159e835ca8acfaf94776a37dae70aa7f5bead4180708d54
MD5 c2d97b445536260d3aa35fed0248b2a2
BLAKE2b-256 c7e4cb84f92204626d9288c36630c820da32af26c8d96fca9aead84d9a3c63cd

See more details on using hashes here.

File details

Details for the file cobra-0.5.6b2-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.6b2-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 d3e851ad65cefd95074d8190010a562ff61fa15ff2f630744e3ad241ff785c26
MD5 4dbe2a8ab0ce75c2d793463cef71535d
BLAKE2b-256 d00b4b793d3278da5ddec800a48150bc3f3f35de81b2c5208485563c76df8710

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