A Streamlit web application for iterative Bayesian optimization of enzyme reaction conditions. Uses a Gaussian Process surrogate model with Expected Improvement acquisition to suggest the most informative next experiments, minimizing the number of lab runs needed to find optimal conditions.
- Gaussian Process surrogate model -- Matern kernel with per-parameter length scales and per-point noise from replicates
- Expected Improvement acquisition -- balances exploitation of known good regions with exploration of uncertain regions, plus a diversity penalty to avoid clustering suggestions
- Replicate support -- enter multiple measurements per condition; the model uses replicate variance as observation noise
- Chromeleon HPLC CSV parsing -- import results directly from Chromeleon exports (European decimal format, dual peak windows)
- Response surface visualization -- interactive 2D contour plots of the GP prediction and uncertainty for any pair of parameters
- Parameter importance -- correlation-based ranking of which parameters matter most
- Latin Hypercube initial design -- space-filling initial experiments with practical rounding for lab pipetting
- Project save/load -- export and import the full optimization state as JSON
pip install streamlit pandas numpy plotly scikit-learn scipy
Python 3.9 or later.
streamlit run bayesian_optimizer.py
- Define parameters -- set the name, unit, and bounds for each reaction variable (cofactors, pH, temperature, etc.). Fixed parameters can have equal min/max bounds.
- Generate initial experiments -- the app creates a Latin Hypercube design rounded to practical pipetting volumes.
- Run experiments in the lab and measure the response (concentration, HPLC area, conversion percentage, or area ratio).
- Enter results -- type values manually, upload a CSV, or import a Chromeleon HPLC file. Multiple replicates per condition are supported.
- Get AI-suggested next experiments -- the Bayesian optimizer trains a Gaussian Process on your data and proposes the next batch of conditions that maximize Expected Improvement.
- Iterate -- repeat steps 3--5 until the response plateaus or reaches the target.
The app supports four output metrics selectable at project setup:
| Metric | Unit | Typical use |
|---|---|---|
| Concentration | mM | Calibrated standard curve |
| Relative HPLC area | % | Quick conversion estimate |
| Absolute peak area | mAU*min | Raw detector signal |
| Area ratio (product/substrate) | ratio | Internal-standard normalization |
MIT