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 Distribution

cobra-0.5.4.tar.gz (1.4 MB view details)

Uploaded Source

Built Distributions

cobra-0.5.4.win-amd64-py3.5.exe (2.2 MB view details)

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.5m Windows x86

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

Uploaded CPython 3.5m

cobra-0.5.4-cp34-cp34m-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.4m Windows x86-64

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

Uploaded CPython 3.4m Windows x86

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

Uploaded CPython 3.4m

cobra-0.5.4-cp33-cp33m-manylinux1_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.3m

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7m Windows x86-64

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

Uploaded CPython 2.7m Windows x86

cobra-0.5.4-cp27-cp27m-manylinux1_x86_64.whl (3.0 MB view details)

Uploaded CPython 2.7m

File details

Details for the file cobra-0.5.4.tar.gz.

File metadata

  • Download URL: cobra-0.5.4.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cobra-0.5.4.tar.gz
Algorithm Hash digest
SHA256 fe17b0a7d3882a15140879502abe6c3a857bf9fb83bdc1a57b19d3254a9d5783
MD5 0b3ec4b97dfd15e9f488a99f996228e7
BLAKE2b-256 78780fc2296fdfda3327d80b123d5ddb6036639e58747eff532d02be39da4512

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.4.win-amd64-py3.5.exe
Algorithm Hash digest
SHA256 953b42dc4e4f79df5fb25e03d531c1fc73131729e16331e9e86727b26751f28c
MD5 1dc38fd5c1ffcd4c2fb6044b72433416
BLAKE2b-256 61fa1415303dd376c6f2b1ee96dd6ad4814133dc09064ed67e38eb8dc15d5688

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.4.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 4eb5d0e96c4404d9af5dcb6b2e21f3e8f31a5b07cfef4d0d3ed380dc53b0d524
MD5 c4149297ba6b8bb057a44bccadbe779e
BLAKE2b-256 ff23fbb19c3c35f827a18243c92e0492bf965c8569b73307d7d233ca75089e05

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.4.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 3bef56e619e8f305a2acf4e30ceefcd9dc6424683079427525d6cb9672810b27
MD5 a33a8ee21c014c2d0ea65aed17eb4db2
BLAKE2b-256 a389181d6c92214b10472d8648fc4c52181c0f446e76c579858fac0ca1f259d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.4.win32-py3.5.exe
Algorithm Hash digest
SHA256 5e0a970eb29c1f41a0a35d1eaac86dea25a8742cc347eb66a016e79bc366ac6d
MD5 b7bed4fb95bd57891f419f7e053894ab
BLAKE2b-256 db491a1fe83e16b833f69bf3910d9dcc8a37bc129899e068e243ce7a28206dc1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.4.win32-py3.4.exe
Algorithm Hash digest
SHA256 730652bf90deb89c40f75194027adaa3dc6ac15679a595c9e9395d37a81c17c2
MD5 a212b86667328c1c3906280db44de48e
BLAKE2b-256 d52ca0585fbcda6b64f7e61b41f357f1d08620c456e025a3390c6e67da6826ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.4.win32-py2.7.exe
Algorithm Hash digest
SHA256 f4537ba0cb1f73698e3f1346cfb9f494432e65178d66f5d73103f35961fa591c
MD5 0273dd1cf7d86686d1e146c3c0a89449
BLAKE2b-256 1228148e9cdc01d19b2cadfa1716e99327e2d160636a7549a913fd92ad5f6ac0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.4-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 47ba2f2a1b6dce731f4694faedf1a955ffeee58c8f540ef4324e82426a8c89cd
MD5 043ec378f98711c47140c9f308629798
BLAKE2b-256 88d94683e15b3f089aa6dc1b1b07fc09ae7e03a10b7718f1d414f30025436ed2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.4-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 337d89831548ffe2f8bf3784cff5d4589b9430f363c4ee2a24fefe8f6f019f20
MD5 c0a12195dea718fa506811a6cbd0ae12
BLAKE2b-256 73d4af1b135f0cbaa612f6ab25f8190a8da453000316c1e7a6305d9c469291c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.4-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6da80e378ee2838cd56e5cfadcde674ac2e4a0c220ccae43338be2a319573410
MD5 1323893bf47242f5d36a1fc496e9d397
BLAKE2b-256 99b6936a58fec97d1c6f205dbb60598dd4d903a53312804e1a5f7fe40ad9d7f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.4-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 4d3f8f511be35ffcb6cbc72e9816171db64f6b72d364e24ccc3ad005d0f59f24
MD5 86db970a1133eddf761d9f95a3fdbd59
BLAKE2b-256 4b87767b62031ef6f02a61bdc6335c47895a314372989052a51886b062404d4a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.4-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 0f47bad000f931193de2e872d568cb718c109e2951cfdcf1cacd24290070b988
MD5 941f4530093aaee24d8008dd80623593
BLAKE2b-256 9e817acfa7fd05c3fb7440738b6f9bfc382f95f361072e2c2504ab832465c642

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.4-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 73835579cc9000fbee29529b5bc9c7cd2da828194f9bddce665c070559faf135
MD5 01afbd4eecb495aa2f86bb12383b6a32
BLAKE2b-256 731715395b8018ae36f788f273925fda4d86de1b5462d4a2a5f75eecb0f0460a

See more details on using hashes here.

File details

Details for the file cobra-0.5.4-cp33-cp33m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for cobra-0.5.4-cp33-cp33m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0b876af097bce73e5532d176f68543ff921d61ec715250e5f6463d6fc3eabfbf
MD5 41f58386ca51e051902390e834252285
BLAKE2b-256 3e393e72a4a5db4eb05d24f48b4cc801a73cece7641f17bb42599ee9d273b3e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.4-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4f4b66e124811a86041b362a8832588d9b78e1f2f149555f75b75d35bac31ef5
MD5 a0dc4ed88b3502053efd2fdab53517b0
BLAKE2b-256 0aa7b323e6b4d6be8fd05ba9ff67cfd07b51d78944b9d118b91a8c43a11df6e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.4-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 94b68dabaee486e992dffd7aea73921b6e37d127b752433f944413622983e03f
MD5 aa058202b9f5b3540a6cc8786b079128
BLAKE2b-256 be60caff5245c8af259e2d427e167c693449c031334fa3a2ece843e65ecb30e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.5.4-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 077491161d57650764fe785dc71585b629247311f2a245e7a630ef7a1229b232
MD5 bc88086fe21683307b7106805c6c0ec2
BLAKE2b-256 3cf2f077c59c9d86c31a4007d8b6de45e75d1a19782e7cdb222267ba447f0cf1

See more details on using hashes here.

File details

Details for the file cobra-0.5.4-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for cobra-0.5.4-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c0cc07e4c0fc479c8f5a27c7fe1cdccc5e5fc759207bf594ddf2d13eb7fbb3c2
MD5 7ebf527c799600b73a5b160fb8252c29
BLAKE2b-256 b654643dc930cf8e2b0409c9bee7f1ae499861951e7e7d60f02c1becf1172e63

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