COBRApy is a package for constraints-based modeling of biological networks
Project description
cobrapy - constraint-based reconstruction and analysis in python
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
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.
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).
libsbml >= 5.10 to read/write SBML level 2 files
Use sudo pip install python-libsbml on Mac/Linux
lxml to speed up read/write of SBML level 3 files.
numpy >= 1.6.1 for double deletions
scipy >= 0.11 for ArrayBasedModel and saving to *.mat files.
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 (available with Academic and Commercial licenses).
coin-or clp and cbc through cylp.
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
Built Distributions
File details
Details for the file cobra-0.5.9.win-amd64-py3.5.exe
.
File metadata
- Download URL: cobra-0.5.9.win-amd64-py3.5.exe
- Upload date:
- Size: 2.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 423dd9ab0553d8270be4575d8f94c5ddbee7c0d0af4d2ded3f6728bde7dab276 |
|
MD5 | f54f487faf9f0e3f7c65246b137617db |
|
BLAKE2b-256 | a30b3b9d69b84536eba5308797dff6b266f40816bcc7b90aae241485ddac1c63 |
File details
Details for the file cobra-0.5.9.win-amd64-py3.4.exe
.
File metadata
- Download URL: cobra-0.5.9.win-amd64-py3.4.exe
- Upload date:
- Size: 1.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df08ff683cdd1bbb9745c4b9dfb71f148242f1accd00834bdfd2a3c69c0fa60c |
|
MD5 | 306ed7448d1560dba9cd0e9943bbe028 |
|
BLAKE2b-256 | 5c40b412a86981a450c1f4217f5bed3965d36f112749f596cfdab22449888ea1 |
File details
Details for the file cobra-0.5.9.win-amd64-py2.7.exe
.
File metadata
- Download URL: cobra-0.5.9.win-amd64-py2.7.exe
- Upload date:
- Size: 1.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29aa8d11f707e11d9a3a3141283e85d70b4945f09bfdbf8a3d623163e1b27f88 |
|
MD5 | 2940b0e41f009282604d17ed39fb4c86 |
|
BLAKE2b-256 | 507b66875204acd92c77a9db96e0d87f8130dbd278f099f9e6166d76dbefde84 |
File details
Details for the file cobra-0.5.9.win32-py3.5.exe
.
File metadata
- Download URL: cobra-0.5.9.win32-py3.5.exe
- Upload date:
- Size: 2.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cec1f7babfc7e3509c29b1ed48999caf96dc9880dc6d2a51dccdd285e686392 |
|
MD5 | 6902cd6cb966d8e0254119212560578c |
|
BLAKE2b-256 | b10ef07da119934c46ee5816be50b9c8eecb9c33bcab891e755cbc33ab6bff4b |
File details
Details for the file cobra-0.5.9.win32-py2.7.exe
.
File metadata
- Download URL: cobra-0.5.9.win32-py2.7.exe
- Upload date:
- Size: 1.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d4ba493b08081627ead5229f57cdf93f95a862d2c0777460735031d0070257c |
|
MD5 | 9db84df9595b2bf7b03c0258b9359302 |
|
BLAKE2b-256 | 7f319442101220ef7c4b1cb8926b4f2ecfae0c0f4090bc620cff6d81642591f2 |
File details
Details for the file cobra-0.5.9-cp35-cp35m-win_amd64.whl
.
File metadata
- Download URL: cobra-0.5.9-cp35-cp35m-win_amd64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.5m, Windows x86-64
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebeaacb23335ad5175443092230ccac3433e42e38ca27e17226832a7221268fe |
|
MD5 | f12af34b3c6b621313d6fe7bdacd1e3e |
|
BLAKE2b-256 | 7dab4987c09549ca5142c93209d03608d19b2962d7fdf53f1665cade05872cab |
File details
Details for the file cobra-0.5.9-cp35-cp35m-win32.whl
.
File metadata
- Download URL: cobra-0.5.9-cp35-cp35m-win32.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.5m, Windows x86
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f94ff344ff58ca4f82b48ef98341edd1ad667a85484410ac0768f6e460b921d8 |
|
MD5 | c98d354a75d64dfc10bf1a4d11d29e11 |
|
BLAKE2b-256 | c1eb0d4a2ce4a4e0482ed9610210835a950b74ca0639bb095edb8cd103002f7f |
File details
Details for the file cobra-0.5.9-cp35-cp35m-manylinux1_x86_64.whl
.
File metadata
- Download URL: cobra-0.5.9-cp35-cp35m-manylinux1_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.5m
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 926e166379650299a1325c7284adf36fce3c0dda3d1141cab1df20505d72a7c6 |
|
MD5 | 093f5105b67792dcea2d45afa25e1006 |
|
BLAKE2b-256 | c0e086a1aa32f42edf377860bdcd2ac5e5f8b085d15cf8515c819d0e23e96781 |
File details
Details for the file cobra-0.5.9-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
- Download URL: cobra-0.5.9-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
- Upload date:
- Size: 2.6 MB
- Tags: 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
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 163b0bbfe402a80c0cc3125f28f78bda3b27fe7bf123511350811fd171c0dc0e |
|
MD5 | 04a4ae534001fcc0283bfab13fb5c12c |
|
BLAKE2b-256 | 30f4b31d9a0aec24f9bd9d1ebe86429435074d3fa3039654bb224bd26bfe3190 |
File details
Details for the file cobra-0.5.9-cp34-cp34m-win_amd64.whl
.
File metadata
- Download URL: cobra-0.5.9-cp34-cp34m-win_amd64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.4m, Windows x86-64
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e95ebae92eef3c8d5722a09de26ddf50b250a219b92f350b15dac11fa0d40fc8 |
|
MD5 | 51e415cabd98e97c49ecd31254dfcd2b |
|
BLAKE2b-256 | 4c8a6c344cbaa0ef08ebd144f332168e6f7f02c0d5251a75aefbef66fa624baa |
File details
Details for the file cobra-0.5.9-cp34-cp34m-win32.whl
.
File metadata
- Download URL: cobra-0.5.9-cp34-cp34m-win32.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.4m, Windows x86
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eba016ef86e5bcba07afaf83f54f0990c8787e7f8558cf78e4d11144a7b908d8 |
|
MD5 | dd703dda8cf488e7578927b8b8134c9b |
|
BLAKE2b-256 | 43cd6e5ccf8f77d2395ccf4b51e749e009508ed170d0505adbc4b81a56589534 |
File details
Details for the file cobra-0.5.9-cp34-cp34m-manylinux1_x86_64.whl
.
File metadata
- Download URL: cobra-0.5.9-cp34-cp34m-manylinux1_x86_64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.4m
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1743bc2ae462482540a23539d4afd6271973093ea7e5fbe97088cd8b0282e515 |
|
MD5 | 0c05d2dd6c4dc2d341e842e03e68c3d5 |
|
BLAKE2b-256 | 8b9759065fb5ec3fccf10321235683e8b08a942775d71a404320cb643e04487e |
File details
Details for the file cobra-0.5.9-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
- Download URL: cobra-0.5.9-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
- Upload date:
- Size: 2.6 MB
- Tags: 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
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a66b8b34fddcfad6793967ccda397dab7bbd2febd2eea214f69fbaedb9661acb |
|
MD5 | 026dc8c18cb1844fb28fe6854316bff4 |
|
BLAKE2b-256 | 93e1d987826fd509b7224141fe9346ceac600d1cf65e62676be9049979290604 |
File details
Details for the file cobra-0.5.9-cp27-cp27mu-manylinux1_x86_64.whl
.
File metadata
- Download URL: cobra-0.5.9-cp27-cp27mu-manylinux1_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 2.7mu
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31620d70c9314dae208c2540b55b6be4e1ade3a8296aa053fa9a5eb6fbbc5884 |
|
MD5 | 0ca483c7e2a675069783200b36f00be1 |
|
BLAKE2b-256 | 9ca14e87471f17ac1024b681194295a6d3c2353bd9c93ca923db3e31c82ec3e1 |
File details
Details for the file cobra-0.5.9-cp27-cp27m-win_amd64.whl
.
File metadata
- Download URL: cobra-0.5.9-cp27-cp27m-win_amd64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 2.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41153f823bad9e650f5ec1fffa47316b26d4a279d42d7f4529107eed8cb61cc1 |
|
MD5 | 25960fc67afd7aa2d1d699a7c5c366d7 |
|
BLAKE2b-256 | 10dddf42d7c518aeb8ccaad538fb5a270bcc800a1c00df44074178e7dbe8603b |
File details
Details for the file cobra-0.5.9-cp27-cp27m-win32.whl
.
File metadata
- Download URL: cobra-0.5.9-cp27-cp27m-win32.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 2.7m, Windows x86
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c795e7be3f395d8d6789c4274c30a352eb918f2fd0a4915d2c9c28747dced37 |
|
MD5 | 75c58566136ed7bf82457c175845dc04 |
|
BLAKE2b-256 | 0d3947c5a7a2668bb441aedb0eefa3d0a4402459fad0529a2a27f6f28fb1db2d |
File details
Details for the file cobra-0.5.9-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
- Download URL: cobra-0.5.9-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
- Upload date:
- Size: 2.6 MB
- Tags: 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
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9aaeb588369fbc4190f6842967ec99f5cde40c04576ada0b7317ccdb43b7b30 |
|
MD5 | fd48a18a272c6eb59bb5590d5e964033 |
|
BLAKE2b-256 | 56eba96883a62e5d3ac55a1d337edf6439c997659ca8f8e61582164b045f0168 |