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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m Windows x86

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

Uploaded CPython 3.5m

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

Uploaded CPython 3.4m Windows x86-64

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

Uploaded CPython 3.4m Windows x86

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

Uploaded CPython 3.4m

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7m Windows x86-64

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

Uploaded CPython 2.7m Windows x86

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

File metadata

File hashes

Hashes for cobra-0.5.6.win-amd64-py3.5.exe
Algorithm Hash digest
SHA256 cfdb5f037467d25f78ae80a379f9cd5c303625c157cbd2b51fd01aa5a05e0685
MD5 3942cfb99b474020c936637838faa0c1
BLAKE2b-256 39d109c2dc3c81dfa9239a7deb908feed23b8d24368cf627a5eeb2633640d006

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 be2ad7255dc2123e0ecae41c1f8515644d783ddd97e5f47d40159019ad7458e3
MD5 4bd1450c12c7807dd40ec40a60eac8df
BLAKE2b-256 160573e2e98f0bf10ae1acab9b5ba8a31b13c7b04748789a687530c16be7830f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 1a0295cc55feb2bea5adadba36efbf44245388ee52c26898b18566cc2fe8d153
MD5 6c18974c6481b9a245fde8f601e74f96
BLAKE2b-256 1dcfc3fb06de1426697d6210c1628fdd2b597aad52341eb7f7ef93f7123b10b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6.win32-py3.5.exe
Algorithm Hash digest
SHA256 ff000e3e8692641a2b6b69edbd5e54617e6d7701096c0c246cc5d211d2dbad79
MD5 efbfffd4f5bdc62413728d6c2088879c
BLAKE2b-256 82e3ce984af9db85281b2511f41187fde7a3ceac3f4404317c96ed2c8576f5c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6.win32-py3.4.exe
Algorithm Hash digest
SHA256 d7afcade7f59b7970c0e02809d6a954aa8aae65a6ce5224086bfa7facca7d916
MD5 b118cd07bb0197b036f5e4c3dcbe5864
BLAKE2b-256 e4314843a4b70d250c40e43ab45104a978c33fe98b10a9104b929c4cf1dd41b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6.win32-py2.7.exe
Algorithm Hash digest
SHA256 ed519ff5465451fb4dc3283e092419b498a9e44929d4acb67f35f6d97ddbe413
MD5 ccd560257376ebd35fe73df89d3869f6
BLAKE2b-256 22fa7f3b6e0296773e33deb9b6397116c43e770f76cddc2c40ef519f89d5c65b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 17be3336c3760f2efb435904395ce3c6adb488c59de2a33405ca151018fb8e76
MD5 06a681f8a0a4093b49456cf8c1667910
BLAKE2b-256 2de9618c04489f49c37e48855000623521ef108ef075a0e3de209393fb00b4f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 5d69da992d1b290c2fb151301a6a1aaec665d56af1f1e102f7ef5ebad511e57a
MD5 40e6534b6d21bd7573e88674649f40be
BLAKE2b-256 fc142985c71f62572aaf76ea4266fda532822bbe54b44b721d711d4d8e41d19a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 72a803c5a0b2ab66c848dd80756ef8fbae6e78560acc6161ea5c677cc9c745d9
MD5 459a15c9a3e7b41de2e66c245c84347c
BLAKE2b-256 0d4cf7802c7728558600146cf31168162dc09465049135d0cd6f32cc114f4aca

See more details on using hashes here.

File details

Details for the file cobra-0.5.6-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.6-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 a9066474b168b406a3a0d89c142ba009cec3ac6f5e93eb74857cdf12b8e2a961
MD5 684d5a6305bfde0d4b7a54f0d028b7da
BLAKE2b-256 606163597bf3d711d4d8212fe80b7c2a425e63486c73ffcb8e46d8e20906ad3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 e96b483f521750cc3a6fbe808b3a6fa85d3407ad66cd8e1bc38d9c013706ea04
MD5 8dde9ddbc41a415ac0ed848bab223c88
BLAKE2b-256 c8fbeb3aad490acf70f18d8ee88f38c3036008645af70ad1e5c67dda670cec30

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 820813b527687a6f3e406e5d7f8b4307b8f0b7c6af0cdfd15fb70c143adb9b21
MD5 e1cbc8efad157f9b40f70582147c052e
BLAKE2b-256 350727b34fc8d9b257dee1001dc704c9465d624f93f1f563b7ef675a34aab43c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 165ecf6ede12cd4a722a027af1f552547bbf6a4b1b09bfe1ece9318813ee5eb1
MD5 0df147863d481e5409416bf199f04cee
BLAKE2b-256 bede95624fff0639eb3a89489e9333c22748591fba9a0d2d0c93593eea56ae05

See more details on using hashes here.

File details

Details for the file cobra-0.5.6-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.6-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 937942ac58be1823af11f476f9bab6adf518b01e4586d23970e2fdf7c5eec0ed
MD5 e7a75919a4ff35185b1a23794c58cf39
BLAKE2b-256 e97da31a07ae6df7764ed19e9b7e4ba8895bc34906524639a76e627265367daf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4a00f4f083797f6092e2efad2c61d3baf938b3cc218a4699dcfe60e8d574034c
MD5 9d6e47684926cdb256e81173efb9db8b
BLAKE2b-256 f354adde00525c908fc666cc3aa60add92aaf08772943a03090da81474419fd5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 ec554a4b2b812815527330dc29ab44c2d45f27b3e3118735be5d2565d49fa265
MD5 635cfd24cd22103c6f18d9daf66888f0
BLAKE2b-256 bf26a4dfa6e1f49707b51bf616d28e626d6ba8a89960133e130519b64da44b39

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.6-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 7e166d4a9309761825e01031ef4d1b9dad1d3f7afafb776a12e66a3124dd3f53
MD5 da634a20c8bafa0eaeda6e2ada9555ec
BLAKE2b-256 c15e7a9885a35a8692465d5ecffae4fa42f5dd160b162775a0c5c66d08b79861

See more details on using hashes here.

File details

Details for the file cobra-0.5.6-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.6-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 5c55eb3aa575c8362aea89a972de7782c61a9b3e69e140b9cb02e047a42e0167
MD5 51dba6b5291f5ee8e03bb2e88c3db853
BLAKE2b-256 49e412cc8f6cbdbe88b7a5f69d73f2866e1c980901711c65ff4f4d84546115d4

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