One of the fundamental challenges in computational drug discovery is how to represent a molecule in a way that a deep learning model can effectively learn from. While molecular fingerprints have served the field for decades, their 1D vector structure loses spatial and grouping information that could be crucial for property prediction.
MolMap addresses this by learning to arrange molecular descriptors and fingerprint bits into a structured 2D grid — a "feature map" — where chemically related features are placed in proximity. This transforms the problem from 1D signal regression to a 2D image-like task, naturally enabling convolutional neural networks to learn hierarchical patterns.
The key steps are:
import molmap
import numpy as np
# Initialize MolMap with a reference dataset
mp = molmap.MolMap(ftype='descriptor', fmap_type='grid')
mp.fit(reference_smiles_list, method='umap')
# Transform a molecule
smiles = 'CCO' # ethanol
feature_map = mp.transform(smiles)
print(feature_map.shape) # (N, M, C) — a 2D image
MolMap achieved state-of-the-art performance across multiple MoleculeNet benchmarks when we first published in Nature Machine Intelligence (2021). It has since been integrated into ZairaChem's automated drug discovery pipeline, demonstrating its real-world utility.
MolMap is open-source. You can install it via pip and find the source code on our GitHub. We welcome contributions and bug reports.
Assistant Professor at AIDDPM Lab, Zhejiang University. Lead developer of MolMap, AggMap, COMPASS, and Leadmaster. Research focuses on AI for drug discovery and precision medicine.