A COBRApy[1]-based package for computational design of metabolic networks
The comprehensive StrainDesign package for MILP-based strain design computation with the COBRApy toolbox supports MCS, MCS with nested optimization, OptKnock [2], RobustKnock [3] and OptCouple [4], GPR-rule integration, gene and reaction knockouts and additions as well as regulatory interventions. The automatic lossless network and GPR compression allows strain design computations from genome-scale metabolic networks. Supported solvers are GLPK (available from COBRApy), CPLEX, Gurobi and SCIP [5].
To get started, check out the StrainDesign documentation.
Guides and examples are provided as Jupyter notebooks at docs/source/examples.
Parts of the compression routine is done by efmtool's compression function (https://csb.ethz.ch/tools/software/efmtool.html[2]). Therefore some source code from the efmtool_link package was adopted.
The straindesign package is available on pip and Anaconda. To install the latest release, run:
pip install straindesign
or
conda install -c cnapy straindesign
Download the repository and run
pip install -e .
in the main folder. Through the installation with -e, updates from a 'git pull' are at once available in your Python envrionment without the need for a reinstallation.
In some cases, installing or using the StrainDesign python package may fail with the error:
JVMNotFoundException: No JVM shared library file (libjli.dylib) found. Try setting up the JAVA_HOME environment variable.
In this case, ensure you have java (JRE or JDK) installed and your JAVA_HOME environment variable is set.
If you're on OS X and get the error
OSError: [Errno 0] JVM DLL not found
check that your Java and the JPype library is set up correctly.
The cobra package is shipped with the GLPK solver. The more powerful commercial solvers IBM CPLEX and Gurobi may be used by cobra and the straindesign package. This makes sense in particular when using strain design algorithms like MCS, OptKnock etc. As another alternative solver, SCIP may be used. In the following, you will find installation instructions for the individual solvers.
Together with Gurobi, CPLEX is the perfect choice for computing strain designs. Its stability and support of advanced features like indicator constraints and populating solution pools make it indispensible for genome-scale computations.
You will need an academic or commercial licence for CPLEX. Download and install the CPLEX suite and make sure that your CPLEX and Python versions are compatible. This step will not yet install CPLEX in your Python environment. Once the installation is completed, you may link your installation to your Python/conda environment. This is the next step.
Using the command line, navigate to your CPLEX installation path and into the Python folder. The path should look similar to
C:/Program Files/CPLEX210/python
Make sure to activate the same Python/conda environment where cobra and straindesign are installed. Then call
python setup.py install
.
Now CPLEX should be available for your computations.
The official instructions can be found here: https://www.ibm.com/docs/en/icos/22.1.0?topic=cplex-setting-up-python-api
Similar to CPLEX, Gurobi offers a fast MILP solvers with the advanced features of indicator constraints and solution pooling. The installation steps are similar to the ones of CPLEX.
First, you will need an academic or commercial license and install the Gurobi solver software. Ensure that the versions of gurobi and Python versions are compatible, install Gurobi to your system and activate your license following the steps from the Gurobi manual. In the next step you will link your Gurobi installation to your Python/conda environment.
Using the command line, navigate to your CPLEX installation path and into the Python folder. The path should look similar to
C:/gurobi950/windows64
Make sure to activate the same Python/conda environment where cobra and straindesign are installed. Then call
python setup.py install
.
If your gurobipy package does not work right away, additionally install the gurobi package from conda or PyPi via
conda install -c gurobi gurobi
or
python -m pip install gurobipy
Now Gurobi should be available for your computations.
The official instructions can be found here: https://support.gurobi.com/hc/en-us/articles/360044290292-How-do-I-install-Gurobi-for-Python-
Less powerfull than CPLEX and Gurobi, the open source solver SCIP still offers the solution of MILPs with indicator constraints, which gives it an edge above GLPK in terms of stability. If you want to use SCIP, you may install it via conda or pip:
conda install -c conda-forge pyscipopt
or
python -m pip install pyscipopt
Warning
If you encounter program crashes with SCIP (a dependency of pyscipopt), make sure you use a version different from 8.0.1.
You can, for instance manually install version 8.0.0 through conda install -c conda-forge scip=8.0.0
. Version 9.1.0 has been tested with StrainDesign successfully.
Official website: https://github.com/scipopt/PySCIPOpt
CNApy, a GUI-featured toolbox for metabolic modeling offers a graphical user interface for the modeling and design of metabolic networks. The software provides a dialog box for specifying strain design problems.
Schneider P., Bekiaris P. S., von Kamp A., Klamt S. - StrainDesign: a comprehensive Python package for computational design of metabolic networks. Bioinformatics, btac632 (2022)
[1] Ebrahim, A., Lerman, J.A., Palsson, B.O. et al. - COBRApy: COnstraints-Based Reconstruction and Analysis for Python. BMC Syst Biol 7, 74 (2013)
[2] Burgard, A. P., Pharkya, P., & Maranas, C. D. - Optknock: a bilevel programming framework for identifying gene knockout strategies for microbial strain optimization. Biotechnology and bioengineering, 84(6), 647–657 (2003)
[3] Tepper N., Shlomi T. - Predicting metabolic engineering knockout strategies for chemical production: accounting for competing pathways, Bioinformatics. Volume 26, Issue 4, Pages 536–543 (2010)
[4] Jensen K., Broeken V., Lærke Hansen A.S., et al. - OptCouple: Joint simulation of gene knockouts, insertions and medium modifications for prediction of growth-coupled strain designs. Metabolic Engineering Communications, Volume 8 (2019)
[5] Bestuzheva K., Besançon M., Chen W.K. et al. - The SCIP Optimization Suite 8.0. Available at Optimization Online and as ZIB-Report 21-41, (2021)
[6] Marco Terzer, Jörg Stelling, Large-scale computation of elementary flux modes with bit pattern trees, Bioinformatics, Volume 24, Issue 19, (2008), Pages 2229–2235,