PSAMM can be installed using the Python package installer
pip. We recommend
that you use a Virtualenv when installing PSAMM. First, create a Virtualenv
in your project directory and activate the environment. On Linux/OSX the
following terminal commands can be used:
$ virtualenv env $ source env/bin/activate
Then, install PSAMM using the
(env) $ pip install psamm
When returning to the project from a new terminal window, simply reactivate the environment by running
$ source env/bin/activate
The psamm-import tool is included in the main PSAMM repository. Some additional model specific importers for Excel format models associated with publications are maintained in a separate repository. After installing PSAMM, support for these import functions can be added through installing this additional program:
(env) $ pip install git+https://github.com/zhanglab/psamm-import.git
- Linear programming solver (Cplex, Gurobi, GLPK or QSopt_ex)
- PyYAML (for reading the native model format)
- NumPy (optional; model matrix can be exported to NumPy matrix if available)
PyYAML is installed automatically when PSAMM is installed through
linear programming solver is not strictly required but most analyses require
one to work. The LP solver Cplex is the preferred solver. We recently added
support for the LP solver Gurobi and GLPK.
The rational solver QSopt_ex does not support MILP problems which means that some analyses require one of the other solvers. The MILP support in GLPK is still experimental so it is disabled by default.
The Cplex Python bindings will have to be installed manually. Make sure that you are using at least Cplex version 12.6. If you are using a virtual environment (as described above) this should be done after activating the virtual environment:
- Locate the directory where Cplex was installed (e.g.
- Locate the appropriate subdirectory based on your platform and Python
pipto install the package from this directory using the following command.
(env) $ pip install \ /path/to/IBM/ILOG/CPLEX_Studio1262/cplex/python/<version>/<platform>
Further documentation on installing Cplex can be found in the Cplex documentation.
Python 3 support was added in a recent release of Cplex. Older versions only support Python 2. If you are using Python 3 make sure that you have the latest version of Cplex installed.
The Gurobi Python bindings will have to be installed into the virtualenv. After activating the virtualenv:
- Locate the directory where the Guropi python bindings were installed. For
example, on OSX this directory is
XXXis a version code.
pipto install the package from this directory. For example:
(env) $ pip install /Library/gurobi604/mac64
The GLPK solver requires the GLPK library to be installed. The
Python bindings are required for PSAMM to use the GLPK library.
(env) $ pip install swiglpk