Bayesian Reaction Optimization Using EDBO - Part I

2 minute read

Published:

Recently, in collaboration with folks over at Princeton and Bristol Myers Squibb, I finished writing a python package called Experimental Design via Bayesian Optimization (EDBO) for reaction optimization which enables the application of Bayesian optimization, an uncertainty guided response surface method, to chemical reactions in the laboratory. Now, the paper is submitted for publication and under review so I have not yet made the repository public. However, to facilitate training and beta testing I am writing a few preliminary posts on (1) installation and basic software usage, (2) simulations with real chemical reaction data, (3) using EDBO in the lab, and (4) tackling computational optimization problems.

Reference: Shields, Benjamin J.; Stevens, Jason; Li, Jun; Parasram, Marvin; Damani, Farhan, Martinez Alvarado, Jesus; Janey, Jacob; Adams, Ryan P.; Doyle, Abigail G. “Bayesian Reaction Optimization as A Tool for Chemical Synthesis” Manuscript Submitted.

Part I - Installation

Ok boring stuff first. In this post we will be tackling software installation from the code in my private repository (so no Git, PyPI, or Anaconda for now).

Install conda

If you haven’t already installed anaconda (or miniconda) on your machine you can follow the instructions provided by conda.

Install EDBO

Windows Script

I wrote a shell script (install.sh) to install EDBO on windows machines. You will find a copy in the edbo.zip folder provided.

  1. Download and unzip the folder.

  2. Open an anaconda prompt, navigate to the edbo directory, and run the script.

cd path/to/edbo/directory
sh install.sh

Mac/Linux Script

I wrote a slightly different shell script (install_mac.sh) to install EDBO on Mac/Linux machines. You will find a copy in the edbo.zip folder provided.

  1. Download and unzip the folder.

  2. Open a terminal and create a conda environment for EDBO.

conda create -y --name edbo python=3.7.5
conda activate edbo
  1. Navigate to the edbo directory and run the script.
cd path/to/edbo/directory
sh install_mac.sh

Software tests

Use the pytest framework to run some basic software tests to make sure the installation worked. In the anaconda prompt (or terminal for Mac/Linux) navigate to the folder containing edbo. Then run the following commands and you will see test logs appear in the testing directory. These may take a few min to run and you should see some warnings but no failed tests. If you do please let me know so I can fix the issue and update the software.

conda activate edbo
cd tests
sh basic_tests.sh

Up next

That wraps up this post. In Part II we will walk through a basic introduction to the software.