Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

OptStoic python package

Perform optStoic analysis using Python code that share the same data files with GAMS code.

Note: All the examples are specific for glycolysis pathway generation.


  • Next, setup a virtual environment in Python 3.
# Create a project folder
cd project_folder
# Create a virtual environment call optstoic_env
python3 -m venv optstoic_env
# Activate your environment
source optstoic_env/bin/activate
  • Then, install one of the solvers in the following Solver Requirement section.

  • (Optional) Install the Graphviz package for pathway visualization. See the Additional Project Dependencies section.

  • Next, clone this repository in your project_folder and setup. This should install all the Python dependencies.

# Create a new project folder
mkdir project_folder
cd project_folder
# Activate your environment
source optstoic_env/bin/activate
# Clone the repo
git clone
cd optstoic-python
python install
  • To run nosetests after setup:
pip install nose
cd project_folder/optstoic-python
nosetests -s -v
# nosetests -c=nose.cfg

Solver requirement

At least one of the following optimization solvers should be installed. To solve the loopless optStoic formulation, an optimization solver other than GLPK is recommended.

  1. GLPK 4.47 installation

    • Linux (Tested on Ubuntu 16.04):
    tar -xvzf glpk-4.47.tar.gz
    cd  ~/glpk-4.47
    make install
    #if the program is successfully installed, you should get an output by typing
    glpsol --version
    • Mac (Tested on macOS Catalina):
    brew install glpk
    # If success
    glpsol --version
  2. GUROBI Optimization provide academic license for free ( Install gurobipy following the instruction provided by GUROBI.

  3. SCIP Optimization Suite >= v4.0.0. See the documentation of SCIP for the installation procedure.

    • Linux (Tested on Ubuntu 16.04):
    sudo apt-get install libgmp-dev libreadline-dev zlib1g-dev libncurses5-dev
    tar xvf scipoptsuite-6.0.0.tgz
    cd scipoptsuite-6.0.0/
    make test
    cd scip-6.0.0/
    sudo make install INSTALLDIR="/usr/local/"
    /usr/local/bin/scip --version
    • Mac (Tested on macOS Catalina):
    brew install gmp
    brew install boost
    tar xvf scipoptsuite-7.0.1.tgz
    cd scipoptsuite-7.0.1/
    make test
    cd scip/
    sudo make install INSTALLDIR="/usr/local/"
    /usr/local/bin/scip --version
  4. CPLEX Optimizer

Additional project dependencies

  1. PuLP. Run the test.

  2. Graphviz (Optional, for drawing pathway). The Graphviz software is required before installing the graphviz python package.

    • Linux
    #If you have root access
    sudo apt-get install graphviz
    #If you do not have root access (you can get a different version of Graphviz from their website
    cd $HOME
    mkdir -p bin/graphviz
    tar xvf graphviz-2.38.0.tar.gz
    cd graphviz-2.38.0
    ./configure --prefix=$HOME/bin/graphviz
    make && make install
    # Check if the graphviz is working
    cd $HOME/bin/graphviz/bin
    dot -V
    # Add the following line to your .bashrc
    export PATH=$PATH:$HOME/bin/graphviz/bin
    #Install the Python graphviz package
    pip install graphviz
    • Mac: brew install graphviz
  3. Component-Contribution (*Optional, unless you want to perform MDF analysis)


After cloning the repo or setup, please run tests as followed. The runtime depends on the solvers selected by PuLP. Note that the don't capture stdout option must be provided to the nosetests (nosetests --nocapture or nosetests -s) so that Pulp can read/write from intermediate files.

nosetests -s -v
# nosetests --config=nose.cfg


Read the tutorial.

Jupyter notebook setup

cd project_folder
# Activate your environment
source optstoic_env/bin/activate
pip install notebook
pip install ipykernel
python -m ipykernel install --user --name optstoic_env --display-name "Python (optstoic)"


To continue development with the code, please create a virtual environment and use python develop for installation.


Please cite Ng, C.Y., Wang, L., Chowdhury, A. et al. Pareto Optimality Explanation of the Glycolytic Alternatives in Nature. Sci Rep 9, 2633 (2019).


No description, website, or topics provided.




No releases published


No packages published