The openCOBRA Project
The openCOBRA Project
COBRA for Python Available in svn
We’ve recently added a Python package that provides access to core COBRA methods to our repository:
svn co https://opencobra.svn.sourceforge.net/svnroot/opencobra/python/cobra/
Please note that this code is under development and is not yet ready for general consumption.
All questions / issues should be posted to the pyCOBRA Developers’ forum.
If you don’t know what you’re doing and get easily frustrated, now is NOT the time for you to try out this package. Give us a few months and we should have a few installers.
COBRApy does NOT have all of the functions of the COBRA Toolbox. We will be rolling out a number of these functions as modules in the COBRApy foundry over time; using a modular approach will allow us to improve performance of the core with a sizable reduction in fixes that break things.
If you’re interested in contributing, let us know. If you’re new to Python or haven’t read the style guide, please do so before contributing; we’re going to follow it as much as possible.
For Python neophytes, any attributes that start with _ or __ should not be directly accessed.
README:
cobra for python is under development at the moment and is not supported. If you're interested have a look around, but please know that any questions posted to the mailing lists or e-mailed to us will be ignored.
**16 July 2012** We’re transitioning from svn to git. Please not that the svn repository for cobra pie and the core COBRA Toolbox for MATLAB are deprecated.
it is accessible via subversion:
svn co https://opencobra.svn.sourceforge.net/svnroot/opencobra/python/cobra
don't forget to add it to your python path. we don't have setup / install scripts at the moment.
If you're really interested in using this early on then please note that it has only been tested on Mac OS X 10.6 and Ubuntu GNU/Linux 10.0.4. As things are, a number of modules must be installed on your system (see INSTALL) to use this package, and some of them are not currently (or easily) compatible with Microsoft Windows.
INSTALL:
The heart of cobra for python is in cobra/core, but the items that one will use are in the toplevel namespace:
cobra.Model, cobra.Reaction, cobra.Gene, cobra.Metabolite
use dir() and help() to learn about them or look at the code. Some scripts (cobra/io/sbml.py) come with examples at the bottom.
To use cobra, it is necessary to install:
1) NumPy 1.6 or later
2) SciPy 0.9 or later
To perform any optimization simulations (cobra/flux_analysis/), one or more of the following must be installed:
1) pyGLPK 0.3 or later (http://www.tfinley.net/software/pyglpk/release.html)
-This requires GLPK 4.18 or later
-This cannot solve quadratic programming problems.
2) gurobi 4.0 or later (http://gurobi.com)
-There is a free academic license
-Make sure you easy_install their python module, or add it to your PYTHONPATH
3) ILOG/CPLEX 12.2 (http://www-01.ibm.com/software/integration/optimization/cplex-optimizer/)
-There is a free academic license (http://www-01.ibm.com/software/websphere/products/optimization/academic-initiative/)
-Make sure you easy_install their python module, or add it to your PYTHONPATH
-On Mac OS X, there is only a 32-bit python module for the 12.2 release.
To read / write Systems Biology Markup Language (SBML) files (cobra/io/sbml.py):
1) libSBML 4.3.1 or later (http://sbml.org)
-Make sure that the python bindings are installed, if not then you'll need to compile yourself.
To perform some of the statistical functions (cobra/stats/):
NOTE: many functions in this directory have not be audited.
1) rpy2 2.1.8 or later (http://rpy.sourceforge.net/rpy2.html)
-or, easy_install rpy2
To use any of the parallel functions:
1) parallel python 1.6 or later (http://www.parallelpython.com/)
-or, easy_install pp
To access the COBRA Toolbox for MATLAB (cobra/mlab/):
1) mlabwrap 1.1 or later (http://mlabwrap.sourceforge.net/)
-This is an advance topic and might be difficult to install.
-This will likely be difficult or impossible to run on Microsoft Windows - Good Luck.
EXPERIMENTAL: To use linear algebra to calculate metabolite formulas (cobra/manipulation/balance.py):
Seriously, don't use this because it's not complete and going to be redesigned.
1) sympy 0.6.7 or later (http://sympy.org/)
- easy_install sympy
DO NOT CONSIDER USING:
cobra.jython
July 4, 2011