ryvutherapeutics/molecular-embedding-overview

Dense molecular representations for efficient similarity search

Jupyter Notebook

3

2 commits

updated Apr 8, 2025

See the code

README

Dense molecular representations for efficient similarity search

Project objective

This project is about finding a dense, low-dimensional molecular representation with an adjusted distance measure that could be an alternative for Morgan fingerprint with Tanimoto similarity. The key motivation is to be able to create a vector database of compounds, with fast similarity search and clustering procedures giving comparable results to traditional fingerprint approach.

Usage

Within the project several embedding generation approaches where compared from NLP transformers to data-driven descriptors. To prepare the models run

chmod +x setup.sh
./setup.sh

This will clone the necessary repositories and create a docker container for CDDD REST. It will increase the repository size by about 900 MB. To generate embedding use embed.sh script. The data should be stored in .csv file with a header just like examples in data/. The compounds should be represented by valid SMILES and should not contain salts.

chmod +x embed.sh
./embed.sh smiles.csv cddd

The embedding is saved as a pickled array of arrays in embedding/ directory. If you encounter any problems importing gensim package in Mol2vec or Graph2vec calculation, try installing scipy 1.12.0.

Requirements

  • Docker
  • Python 3 (version used: 3.12.2)
    Necessary packages are listed in requirements.txt.

Code references

ryvutherapeutics/molecular-embedding-overview

Dense molecular representations for efficient similarity search

Jupyter Notebook

3

2 commits

updated Apr 8, 2025

See the code

README

Dense molecular representations for efficient similarity search

Project objective

This project is about finding a dense, low-dimensional molecular representation with an adjusted distance measure that could be an alternative for Morgan fingerprint with Tanimoto similarity. The key motivation is to be able to create a vector database of compounds, with fast similarity search and clustering procedures giving comparable results to traditional fingerprint approach.

Usage

Within the project several embedding generation approaches where compared from NLP transformers to data-driven descriptors. To prepare the models run

chmod +x setup.sh
./setup.sh

This will clone the necessary repositories and create a docker container for CDDD REST. It will increase the repository size by about 900 MB. To generate embedding use embed.sh script. The data should be stored in .csv file with a header just like examples in data/. The compounds should be represented by valid SMILES and should not contain salts.

chmod +x embed.sh
./embed.sh smiles.csv cddd

The embedding is saved as a pickled array of arrays in embedding/ directory. If you encounter any problems importing gensim package in Mol2vec or Graph2vec calculation, try installing scipy 1.12.0.

Requirements

  • Docker
  • Python 3 (version used: 3.12.2)
    Necessary packages are listed in requirements.txt.

Code references