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

If you're not sure about the file name format, learn more about wheel file names.

cobra-0.5.11.win-amd64-py3.6.exe (2.3 MB view details)

Uploaded Source

cobra-0.5.11.win-amd64-py3.5.exe (2.3 MB view details)

Uploaded Source

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

Uploaded Source

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

Uploaded Source

cobra-0.5.11.win32-py3.6.exe (2.1 MB view details)

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

cobra-0.5.11-cp36-cp36m-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.6mWindows x86-64

cobra-0.5.11-cp36-cp36m-win32.whl (1.6 MB view details)

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.6m

cobra-0.5.11-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.6mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5mWindows x86

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

Uploaded CPython 3.5m

cobra-0.5.11-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.5mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

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

Uploaded CPython 3.4mWindows x86-64

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

Uploaded CPython 3.4mWindows x86

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

Uploaded CPython 3.4m

cobra-0.5.11-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.4mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

cobra-0.5.11-cp27-cp27mu-manylinux1_x86_64.whl (3.0 MB view details)

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mWindows x86-64

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

Uploaded CPython 2.7mWindows x86

cobra-0.5.11-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.7mmacOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

File details

Details for the file cobra-0.5.11.win-amd64-py3.6.exe.

File metadata

File hashes

Hashes for cobra-0.5.11.win-amd64-py3.6.exe
Algorithm Hash digest
SHA256 b002cc32dc7efda21bed873214407ed207a64ef3e83b467f919872cca023e759
MD5 2a97ad180daf59bde616ba2ae4a14f1f
BLAKE2b-256 93517bc0f977258d391695a782bc9e2d9b8c65dd1d8be93e2fa016031867bf11

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.11.win-amd64-py3.5.exe
Algorithm Hash digest
SHA256 c091bad1b072741973355afb9e70abc2dd3c05f8043e962141fd8f447bdf0574
MD5 eb45d51da132542d3440f0c42093aafc
BLAKE2b-256 69821bf00fb584ca8456f36c67a876dc4106a2e5c7d57f0cdb5ba400d689c10d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.11.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 261e47efb28ab8498b1900dc1f01b9298f51d053984d90d7a0dceb8fc4b3907a
MD5 e22d212720cf188615bacf76f2dc2d0b
BLAKE2b-256 2aed1788b6b7857ea12ab3c781616b708690603ee414663c270395401b46817b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.11.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 0db872dcca7754ae34466a9e7bb2989b822d63c6039204d7932b398476e19dbb
MD5 43269d514112fb2307ec16f40fe0ea7e
BLAKE2b-256 1a583ae8ffe1c47906dedb23f654e2bcc4cb0e2ba1928d21fc91a1a8af488838

See more details on using hashes here.

File details

Details for the file cobra-0.5.11.win32-py3.6.exe.

File metadata

File hashes

Hashes for cobra-0.5.11.win32-py3.6.exe
Algorithm Hash digest
SHA256 f551355e5002d5063fa0cc5f3a39b89caf302f7a637917452f2d7e961c83e3c6
MD5 bb48e0b2e4abf4efa96e997da6e5f9d8
BLAKE2b-256 337060232479ab1c25de48654e50839e8fd37f0544556157db6b838ee4a7777e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.11.win32-py3.5.exe
Algorithm Hash digest
SHA256 b5dfd7ba5a6d4a8ef41b545a80100bbf00fa1638aa9aa6243b18a24a95e87537
MD5 e56d1d83c5e99146d7d8f54eba8b91b4
BLAKE2b-256 aba05a8b6dcd1dc4ecd4cc52983bbd0cd5645243f187fc2b8076b7fec204337c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.11.win32-py3.4.exe
Algorithm Hash digest
SHA256 28a472783c45ddd4efb09707320b337316e746bbd28a2a949c5ad5ad136c1b81
MD5 ee8ec247f425529fe7f6e98343953150
BLAKE2b-256 e11e9cba13808f2449a568b74079e1f62d2aa0adb5c39aa79da87727f3e0a14a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.11.win32-py2.7.exe
Algorithm Hash digest
SHA256 f625c378fa6a4a1493ea3e0f36fd24b26e75f4b7a6b4b9ecf5a4b0fe0433769a
MD5 84a2c4b98e7612d6697def517e059a93
BLAKE2b-256 b7aaf1c7d54542e7162ab180d92b51455c2ad373d03e7f9ff0e16d0f1fec0cfe

See more details on using hashes here.

File details

Details for the file cobra-0.5.11-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for cobra-0.5.11-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 146a2c142096570b6edc97eaebc808afd6ad6b4cbe73df7e983c8f58b8c79976
MD5 5123cac6a43869d305c386799fad2a8f
BLAKE2b-256 006603566a94b4dbbc9c07fb4a5d0f45fdcc1b16b400f50b03963e88c5f25045

See more details on using hashes here.

File details

Details for the file cobra-0.5.11-cp36-cp36m-win32.whl.

File metadata

File hashes

Hashes for cobra-0.5.11-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 90b99b630cb11bc296fb7954876758ffde995980f984d774a94c2c5e14e5cf5d
MD5 9d8abcd0929b6b2db5af774295791f85
BLAKE2b-256 b94553f5ef7bd7718da80caab3f4fdaca02160ce90de1213fab010897117fa9e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.11-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 94881263f6cbe4305ae6a124e9509272fac665ed111254d605a0c7655248d1a8
MD5 816a74bf6d10f5cd63123e289c2cf0d7
BLAKE2b-256 cca27e73c9f9e8b207710e1a579269ee9b00d21e3d5104c56f777114d318a817

See more details on using hashes here.

File details

Details for the file cobra-0.5.11-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.11-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 14ed9fdfedd011e32b98118c14a5c7f78f087895f961083492bdec2905c307b3
MD5 4d5e6827d751aeade60eac0ac235dd56
BLAKE2b-256 c92c12f14ffcdcb2ef138b3f3f2c4d43b4ca3025280d329722fdf80df42ba6ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.11-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 d851dbe3bfd9631824f8824eb8c15a9269aef814de7e5ea3f832fd20ae9aebdb
MD5 290f5a0aafcbde373ab87e6d9d17fbb3
BLAKE2b-256 b4106f6e5cda60e6d29aa16db345ee608b4ef41721f91b662248649e8fe08e69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.11-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 2a2b3cf0b139da5e018cf159cbf381e345b4e79c01f8ffae5e7d8867bb137b22
MD5 7a81b7e67bd35a7e4569d44452686eca
BLAKE2b-256 f2bfe642b22a0616b10b210392cf10746b1819e2590cf2ad4a8244615f31a1fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.11-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c565f53ec651ec66f159c53eb8bbc06927068da91543338cf93c8ef8f98b6cf4
MD5 6b16566f33483c7af2e139b6c1d8cb4d
BLAKE2b-256 bbc2c8fab1c9e2fd71b803cb0d8439cb94cf57a5fdbf2d8dbe42faf52363baf0

See more details on using hashes here.

File details

Details for the file cobra-0.5.11-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.11-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 35b4985bdfeb3866996d956b85e404c30f62aa15c7ecaeb98792322148623a2a
MD5 635beac3b3095961b4f05f1f9e7ddd6a
BLAKE2b-256 0572f4764f0af7ef9dff7af819e4311c7ce0a777957acce3a6ce6d77a4c9310d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.11-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 305ab4eb1d2724739e59c4d8d9a2b84948cdc9dc5b877882183f5021a5b7a580
MD5 fa5fa4c0d58f521bfd8823db09c921f5
BLAKE2b-256 9df7665f10a2f04238a78b9e12776e298c0fa195cf7175009b5116273e47e491

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.11-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 31e5112ea83e80f5592ae479d6dedc3c8e68eb3ceff683549abff959f0640f06
MD5 1f6d59ac803856c2b280fd64b9cff0d9
BLAKE2b-256 65b3b9ed3857fbfa18b7fba9255a57b1035ab7dd442e9de60d52f492e4b2afd0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.11-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 395d4cf2dfa50df59f7cb6e595b43a9e4c6849372274113bf372a190e5cb5e86
MD5 1223322f839d06049cd25e04a47357bb
BLAKE2b-256 b28b98006e42c30360fc9c938c110a4b5737d04453f1edc27c8ad3e027fe266c

See more details on using hashes here.

File details

Details for the file cobra-0.5.11-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.11-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 3533c4eea53b2e76097ed75dac319bdfd4261d7cc7c6926766b4e10877562562
MD5 cc9fe5c187bbfbd370f50e95cf7a9964
BLAKE2b-256 aff4753c272ccc159634c70c72e225aca9d19eae60b0455bc112b9d3074ab59b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.11-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7891ecf741c18adfe0051e72a277be3fdd4a3e49c246ad98d22b1bf101341686
MD5 4149840f32b5af507d6f85191e7098e6
BLAKE2b-256 c6d6e84e0b9a8a44bebf37273fd544299129a861c80d8d2bab4a0e1dbc8aadbf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.11-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 743b279350b726044d36eef764dbd322ead7114caf1ecde5acc7286c73449b63
MD5 f57d87488c42a2860bfb6be36abb3f7f
BLAKE2b-256 8f0e391e80f0634ddb29cd78e582d43f4f10d411344c5f1d48100aa15d642ede

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.11-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 0579313b368734f1d98c625f036f6309ac70f5b5450dc1a08404cb3da60f9838
MD5 a8a8f926aa1ae11ecb95b46afb96da66
BLAKE2b-256 c49b8e59f06b0586a9782f62d70f3434ebddd864edc44b3a76d383f37461ce70

See more details on using hashes here.

File details

Details for the file cobra-0.5.11-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.11-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 6607f7373d927329073d24f219baf46833b39420c1cd8a4ff8b55bf0dce0796d
MD5 4995765f3d3e254281761d3638769f9c
BLAKE2b-256 544702a4b673ebe7e9c1e5a68e03316becb11759ad9583d414122303cc28f8d5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page