Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

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. By writing a well formulated question, with sufficient detail, you are much more likely to quickly receive a good answer! Please refer to these StackOverflow guidelines on how to ask questions. Alternatively, you can use gitter.im for quick questions and discussions about cobrapy (faster response times). Please keep in mind that answers are provided on a volunteer basis.

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. scipy >= 0.11 for MOMA and saving to *.mat files. - Windows scipy installer
  4. pytest and pytest-benchmark are required for testing

You can install all packages directly by

pip install "cobra[all]"

Solvers

cobrapy uses optlang to interface the mathematical solvers used to optimize the created COBRA models, which at the time of writing

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 0. If you see a value other than 0 please file an issue report.

Release History

Release History

This version
History Node

0.9.0

History Node

0.8.2

History Node

0.8.1

History Node

0.8.0

History Node

0.7.0

History Node

0.6.2

History Node

0.6.1

History Node

0.6.0

History Node

0.6.0a7

History Node

0.6.0a6

History Node

0.6.0a5

History Node

0.6.0a4

History Node

0.6.0a2

History Node

0.6.0a1

History Node

0.5.11

History Node

0.5.10

History Node

0.5.9

History Node

0.5.9b1

History Node

0.5.8

History Node

0.5.7

History Node

0.5.6

History Node

0.5.6b2

History Node

0.5.6b1

History Node

0.5.5b1

History Node

0.5.4

History Node

0.5.3.post3

History Node

0.5.3

History Node

0.5.2

History Node

0.5.2b3

History Node

0.5.1b3

History Node

0.5.1b2

History Node

0.5.1b1.post14

History Node

0.5.1b1

History Node

0.5.0b2

History Node

0.4.2b2

History Node

0.4.2b1

History Node

0.4.1

History Node

0.4.0

History Node

0.4.0b7

History Node

0.4.0b6

History Node

0.4.0b4

History Node

0.4.0b3

History Node

0.4.0b2

History Node

0.4.0b1

History Node

0.4.0a4

History Node

0.4.0a3

History Node

0.4.0a2

History Node

0.4.0a1

History Node

0.3.2

History Node

0.3.1

History Node

0.3.0

History Node

0.3.0b4

History Node

0.3.0b3

History Node

0.3.0b2

History Node

0.3.0b1

History Node

0.2.1

History Node

0.2.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
cobra-0.9.0-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.9 MB) Copy SHA256 Checksum SHA256 cp27 Wheel Oct 6, 2017
cobra-0.9.0-cp27-cp27mu-manylinux1_x86_64.whl (3.3 MB) Copy SHA256 Checksum SHA256 cp27 Wheel Oct 6, 2017
cobra-0.9.0-cp27-cp27m-win_amd64.whl (1.9 MB) Copy SHA256 Checksum SHA256 cp27 Wheel Oct 10, 2017
cobra-0.9.0-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.9 MB) Copy SHA256 Checksum SHA256 cp34 Wheel Oct 6, 2017
cobra-0.9.0-cp34-cp34m-manylinux1_x86_64.whl (3.3 MB) Copy SHA256 Checksum SHA256 cp34 Wheel Oct 6, 2017
cobra-0.9.0-cp34-cp34m-win_amd64.whl (1.9 MB) Copy SHA256 Checksum SHA256 cp34 Wheel Oct 10, 2017
cobra-0.9.0-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.9 MB) Copy SHA256 Checksum SHA256 cp35 Wheel Oct 6, 2017
cobra-0.9.0-cp35-cp35m-manylinux1_x86_64.whl (3.3 MB) Copy SHA256 Checksum SHA256 cp35 Wheel Oct 6, 2017
cobra-0.9.0-cp35-cp35m-win_amd64.whl (1.9 MB) Copy SHA256 Checksum SHA256 cp35 Wheel Oct 10, 2017
cobra-0.9.0-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.9 MB) Copy SHA256 Checksum SHA256 cp36 Wheel Oct 6, 2017
cobra-0.9.0-cp36-cp36m-manylinux1_x86_64.whl (3.3 MB) Copy SHA256 Checksum SHA256 cp36 Wheel Oct 6, 2017
cobra-0.9.0-cp36-cp36m-win_amd64.whl (1.9 MB) Copy SHA256 Checksum SHA256 cp36 Wheel Oct 10, 2017
cobra-0.9.0.tar.gz (1.7 MB) Copy SHA256 Checksum SHA256 Source Oct 6, 2017
cobra-0.9.0.win-amd64-py2.7.exe (2.2 MB) Copy SHA256 Checksum SHA256 2.7 Windows Installer Oct 10, 2017
cobra-0.9.0.win-amd64-py3.4.exe (2.2 MB) Copy SHA256 Checksum SHA256 3.4 Windows Installer Oct 10, 2017
cobra-0.9.0.win-amd64-py3.5.exe (2.5 MB) Copy SHA256 Checksum SHA256 3.5 Windows Installer Oct 10, 2017
cobra-0.9.0.win-amd64-py3.6.exe (2.5 MB) Copy SHA256 Checksum SHA256 3.6 Windows Installer Oct 10, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting