This repository contains the implementation of the Chemical Oracle described in our paper Digitizing chemical discovery with a Bayesian explorer for interpreting reactivity data (preprint).
- Python 3.10 or higher
- Poetry (installation instructions)
- Edit the
pyproject.toml
file to choose whether to use thecpu
orgpu
version ofjax
.
[tool.poetry.dependencies]
jaxlib = {source = "jax-gpu"} # or "jax-cpu"
- Install the dependencies using Poetry.
poetry install # to install dev dependencies, poetry install --with dev
# to enter the virtual environment with all requirements installed
poetry shell
Interfacing with analytical data is handled by the ExperimentManager
class in the chem_oracle.experiment
namespace. Whilst this class can be used directly by feeding analytical data manually, the Oracle can also be launched in monitoring mode using the code in chem_oracle.main
namespace, which automatically processes new analytical data as it is added to the ExperimentManager
's data directory.
from chem_oracle.main import main
from chem_oracle.experiment import ExperimentManager
# The containing directory of xlsx_file is used as data_dir by default
manager = ExperimentManager(xlsx_file = "experiment_outcomes.xlsx")
main(manager)
The Bayesian model can be found in the chem_oracle.model
namespace. Variants of this model using a different set of assumptions and prior distributions can be examined by checking out the other branches of this repository.
Instead of creating separate git branches for each model variant, the model itself can be deposited and versioned using the Delphi system.