Skip to content

ARY2260/openpom

Repository files navigation

Open Principal Odor Map

Replication of the Principal Odor Map paper by Brian K. Lee et al. (2023) [1]. The model is implemented such that it integrates with DeepChem.

Benchmarks

Model Data Type ROC-AUC Score
MPNNPOMModel curated_GS_LF_merged_4983.csv 5-Fold CV with ensemble of 10 models per fold 0.8872

Installation (Python 3.10)

PyPI based installation

  1. Install latest Deepchem (nightly) version:
pip install --pre deepchem
  1. Install torch v2.4.0 - CUDA 12.4 and dgl (for respective torch version)
pip install torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 --index-url https://download.pytorch.org/whl/cu124

pip install dgl -f https://data.dgl.ai/wheels/torch-2.4/cu124/repo.html
  1. Install openpom
pip install openpom

Github fork based installation

  1. Fork the OpenPOM repository and clone the forked repository
git clone https://github.com/YOUR-USERNAME/openpom.git
cd openpom
  1. Setup conda environment
conda create -n open_pom python=3.10
conda activate open_pom
  1. Install required dependencies and openpom
pip install --pre deepchem
pip install torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 --index-url https://download.pytorch.org/whl/cu124
pip install dgl -f https://data.dgl.ai/wheels/torch-2.4/cu124/repo.html
pip install pyrfume dgllife pytest ipykernel scikit-multilearn
pip install .

Getting started

Example notebooks for model training and finetuning are available here.

Odor Prediction Demo: predict_odors.py

image

A ready-to-use demo GUI for predicting odor qualities from molecular SMILES strings is provided in predict_odors.py. This Python script allows you to enter a SMILES string and obtain model-based odor predictions, visualized as a barplot of the top-N scoring odor terms.

Features

  • Ensemble MPNN Models: Uses a openpom 10-model ensemble trained on the Principal Odor Map (POM) dataset.
  • Graphical User Interface: Enter SMILES, select the number of top odors to display, and visualize results interactively.
  • RDKit-based Structure Rendering: Shows the molecular structure (if RDKit is installed).
  • One-click Results Export: Copy top-N predictions as TXT or JSON for downstream analysis.

Running the Demo

Assuming you have installed the required dependencies and downloaded or trained the ensemble models to ./models/ensemble_models, launch the GUI with:

python predict_odors.py

The default window will prompt you to input a SMILES string. Press Predict Odors to view results.

  • The left side of the interface displays the input entry and buttons.
  • The right side shows the predicted odor probabilities as a bar chart for the top N terms.
  • Results can be easily copied as text or JSON for practical use.

Note: If you do not have GPU support (CUDA), ensure the models are set to load on CPU. You may have to edit the device_name parameter in the script accordingly.

Example Usage

  1. Input a SMILES string:
    For example, CCO (ethanol).
  2. Choose Top N:
    Specify how many of the highest-scoring odors to visualize.
  3. Press "Predict Odors":
    The barplot will show the predicted intensity for each top odor term.
  4. Copy Results:
    Use Copy Results (TXT/JSON) to export the predictions for further processing.

Contributors:

Aryan Amit Barsainyan, National Institute of Technology Karnataka, India: code, data cleaning, model development
Ritesh Kumar, CSIR-CSIO, Chandigarh, India: data cleaning, hyperparameter optimisation
Pinaki Saha, University of Hertfordshire, UK: discussions and feedback
Michael Schmuker, University of Hertfordshire, UK: conceptualisation, project lead

References:

[1] A Principal Odor Map Unifies Diverse Tasks in Human Olfactory Perception.

Brian K. Lee, Emily J. Mayhew, Benjamin Sanchez-Lengeling, Jennifer N. Wei, Wesley W. Qian, Kelsie A. Little, Matthew Andres, Britney B. Nguyen, Theresa Moloy, Jacob Yasonik, Jane K. Parker, Richard C. Gerkin, Joel D. Mainland, Alexander B. Wiltschko

Science381,999-1006(2023).DOI: 10.1126/science.ade4401
bioRxiv 2022.09.01.504602; doi: https://doi.org/10.1101/2022.09.01.504602

Citing OpenPOM:

@misc{OpenPOM,
  author={Aryan Amit Barsainyan and Ritesh Kumar and Pinaki Saha and Michael Schmuker},
  title={OpenPOM - Open Principal Odor Map},
  year={2023},
  note={\url{https://github.com/BioMachineLearning/openpom}},
}

About

Replication of the Principal Odor Map paper by Brian K. Lee et al. (2023).

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •