Skip to main content

StrainDesign logo

StrainDesign

Current Release Current PyPI Version Current conda-forge Version Current Anaconda Version Documentation Status Supported Python Versions CI-test Status License Code style: YAPF

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.

Network interventions Network Flux-space animation

The compression routine follows the approach of efmtool's compression function (csb.ethz.ch/tools/software/efmtool.html[6]), reimplemented in pure Python with exact rational arithmetic.

Installation

The StrainDesign package is available on PyPI, conda-forge and the cnapy Anaconda channel. To install the latest release, run:

pip install straindesign

or

conda install -c conda-forge straindesign-cobra

or

conda install -c cnapy straindesign

The conda-forge package is named straindesign-cobra because the name straindesign is taken on bioconda by an unrelated project. The Python package is straindesign in every case (import straindesign). Do not install straindesign-cobra and bioconda's straindesign into the same environment.

The StrainDesign package installation and operability is tested regularly in the most recent Windows, Ubuntu and Mac-OS distributions through continuous integration testing. Currently, these tests fail in Mac-OS due to conflicts within the cobrapy package in Mac-OS. If a workable cobrapy version is installed under Mac-OS, StrainDesign should work as well.

Developer Installation

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 environment without the need for a reinstallation.

Install additional solvers

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.

CPLEX

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.

Gurobi

Similar to CPLEX, Gurobi offers a fast MILP solver 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 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 Gurobi 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.

SCIP

Less powerful 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

Official website: github.com/scipopt/PySCIPOpt

CNApy integration

CNApy repository

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.

CNApy screenshot

How to cite

Schneider P., Bekiaris P. S., von Kamp A., Klamt S. — StrainDesign: a comprehensive Python package for computational design of metabolic networks. Bioinformatics, btac632 (2022)

References

[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

Metadata

Release files for straindesign 1.19.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for straindesign 1.19.2
File Size Uploaded Provenance Actions
straindesign-1.19.2.tar.gz 185.7 kB With provenance Details for straindesign-1.19.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for straindesign 1.19.2
File Interpreter ABI Platform Actions
straindesign-1.19.2-py3-none-any.whl Python 3 none any Details for straindesign-1.19.2-py3-none-any.whl

Total release size: 382.7 kB

Release files / straindesign-1.19.2.tar.gz

Download URL straindesign-1.19.2.tar.gz
Size 185.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6be4896e92c5648f3ab7406f9e86b7782060d20fe2a347a027b6e964fe3f7068
BLAKE2b-256 checksum
How to use checksums
3d55fa43833b8cb55ca421dd99100924044804d99ba3ee46c96644baf82eba6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / straindesign-1.19.2-py3-none-any.whl

Download URL straindesign-1.19.2-py3-none-any.whl
Size 197.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50f0a934dfe91fca908af67aa5ba5c015bfdcbe2c8bd81d52e81526cfce4cfea
BLAKE2b-256 checksum
How to use checksums
cd00522116f11588a9e26f79f6e2bf38f06dedd2eda3d487def0656e78bcef15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Security for straindesign 1.19.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for straindesign-1.19.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page