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 'Stories in Ready'

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. 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.

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

Uploaded Source

cobra-0.6.2.win-amd64-py3.5.exe (2.6 MB view details)

Uploaded Source

cobra-0.6.2.win-amd64-py3.4.exe (2.2 MB view details)

Uploaded Source

cobra-0.6.2.win-amd64-py2.7.exe (2.2 MB view details)

Uploaded Source

cobra-0.6.2-cp36-cp36m-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.6m Windows x86-64

cobra-0.6.2-cp36-cp36m-manylinux1_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.6m

cobra-0.6.2-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 view details)

Uploaded CPython 3.6m macOS 10.10+ intel macOS 10.10+ x86-64 macOS 10.6+ intel macOS 10.9+ intel macOS 10.9+ x86-64

cobra-0.6.2-cp35-cp35m-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.5m Windows x86-64

cobra-0.6.2-cp35-cp35m-manylinux1_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.5m

cobra-0.6.2-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 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.6.2-cp34-cp34m-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.4m Windows x86-64

cobra-0.6.2-cp34-cp34m-manylinux1_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.4m

cobra-0.6.2-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 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.6.2-cp27-cp27mu-manylinux1_x86_64.whl (3.3 MB view details)

Uploaded CPython 2.7mu

cobra-0.6.2-cp27-cp27m-win_amd64.whl (2.0 MB view details)

Uploaded CPython 2.7m Windows x86-64

cobra-0.6.2-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 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.6.2.win-amd64-py3.6.exe.

File metadata

File hashes

Hashes for cobra-0.6.2.win-amd64-py3.6.exe
Algorithm Hash digest
SHA256 853339bc118defd5331944fed8ac4a20e91ace5457b4b61e9648df6f58bc1cb7
MD5 47f73a530e6a2c8ccc0e4ff748e07377
BLAKE2b-256 a0a0a7e83dc4f384d87de2738da5a793c256be3b300c8543a6a6b2036a3e4bd6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.2.win-amd64-py3.5.exe
Algorithm Hash digest
SHA256 5d98f55e7669abf94847fb09a2e6c5c6b8c0f773ae4700aa4b2b3b9244ff6749
MD5 7144001f7d64625b50d4869a99b02258
BLAKE2b-256 dc4f4f7840f141959e1bebd68b51a7d8c4e6d178d2da04f14cb4032a109288e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.2.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 9b4e40f855386d561287f2efeec5e7e67272599e29b0d5b678dba5291cf6cf1f
MD5 4c783c939f307683bf3fcee012742d87
BLAKE2b-256 3e06b91860199969f65355932cfa18be9621f1e9ef280d7c7e76c24e149328f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.2.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 32c140f14327e700abaa18f664fb9ad03f4dcd47290af9b4fcb67d0abaa52a63
MD5 c9c158ab43d3fbd8d0a398a455616329
BLAKE2b-256 89dba8f1df4a12be8310d41ba463c0f1cab4baff3fd0372ca85f6bddbd256543

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 d966519d6925000321c55d744850f7aa941977df57ef6974b58354b54c3167e4
MD5 c9bd5349051aee6a66962eab5efffc51
BLAKE2b-256 3cebecfdcb2fce65408e45f11122e783867142eed2d469b3c2d8384bb5bd4ad4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0b3bdebc55741d4e14e5727ea6e9aa79d6090f7f8264baa31defad5b996692a7
MD5 ec35df66e660d1fddd2a3d3be7c73a13
BLAKE2b-256 71d423ea187c439c400def7e67f0e980cf0ffb58b3cbb2fe65054800710efd4e

See more details on using hashes here.

File details

Details for the file cobra-0.6.2-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.6.2-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 aceb4c1cbc0c457e78ad525fe382c5363725df9127dcc34ccc650cf93529e78b
MD5 3aa7d44b242b2e2240339277fef493aa
BLAKE2b-256 9e33ef234c91d2ad7f3841ab4f2c70f20e4d91fd19e057fb3c8d78198390601b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 66c52fd062e17b81d53520c29ebed9a94e1412a30c53551a0ede49d5be005e7f
MD5 b90b8297b21cabbada6f1cbe69c24e80
BLAKE2b-256 9eccb5038bcca4902bbc6f46146d9533a53dfc4a49125346fbb09983bf41d6ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a4c83e06cecb3b7984c831ba8973dd74a29a8a0e0e673b8e5a9f049059e6405f
MD5 a7d961361a8173720b1686ff70ed5917
BLAKE2b-256 45e5f45427a5f421920d4d94effee98131aaa925e51cb6946da784e1120cd0b2

See more details on using hashes here.

File details

Details for the file cobra-0.6.2-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.6.2-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 088a8ba2dfe6bc915e3ff3dda2bdf2b43e67f2ea5ec624a1e30ddc679ba3b68d
MD5 9167a0b6c7723aeafca8cdca2350fab2
BLAKE2b-256 d6702e7bd35735913ffdb2553fcb3f8077fd79ae3dd4f343cf42023ce4cb2cc0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.2-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 0c20a1ff6d56d0fa4f7c427eb368e11384d67976c7c3ba20665a106a55eeba1d
MD5 28b7615f6ede547bdc77910cdfa95450
BLAKE2b-256 3acf277aa55471b2781bf4fc727f86cff818e18e122ce1692e99646a2ee7c055

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.2-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 fc20c021886b8dda49c4b50f4ac570a60ec49e4c6efa3aea9d49b7f191fc4e90
MD5 fbb595a3f5980733be5dc4192d49f409
BLAKE2b-256 4714d1ebade5b14ef6926dc11630f65077b92da7238af7bb697b04a07e0a4b58

See more details on using hashes here.

File details

Details for the file cobra-0.6.2-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.6.2-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 e14569541f0a380a0ce05c070cccf2b82c5e07f415e0a9b62a7d41a4d0334b6d
MD5 1f4f1b5d898f534224af484eb75d8798
BLAKE2b-256 657e648b21629dc2a11d20879131919268ad2fa10d5d6c801d0b0c1eba3b972d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.2-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 72592eb12ec070ec7127c1a21a17bba8ec58a421a412e9b97e0181659c8b3e3e
MD5 e940bd1454648654abeb1a1a0aad8aa0
BLAKE2b-256 e92a53b2fe3ab154b4a7a053d2c8c76f274cbeb699891614dbce4c99192a04d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cobra-0.6.2-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 715e3e5fab2b2cec3f043fd7572cdbced465a3854564355eb940e7bf53339010
MD5 b8544b3926f0dce5822aced9fc647414
BLAKE2b-256 00b511473e8cd9df31dfab5d8396810a9cc61038d9a601cd77d2b4b64d5f4dbd

See more details on using hashes here.

File details

Details for the file cobra-0.6.2-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.6.2-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 2ed69dd8a62048c2682feb510be47a42cc2edb8a699c51a3ef97c66019eadc8c
MD5 02b869cc60b87d8423e47a039e182203
BLAKE2b-256 9148a153d34182e8c893110db18f37362c6898f204fdab93ff2fbc1f3e26871f

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