Similarity search ranks library molecules by how closely they resemble one or more query molecules. In ligand-based virtual screening, a known active compound can serve as the query even when the target’s 3D structure is unavailable. Similar structures may share biological activity, but similarity does not guarantee it; promising hits still need experimental validation. section 2.1.1 section 2.1.3
A practical search involves three linked choices:
- Representation: convert molecules into features a computer can compare. A molecular fingerprint encodes structural features in a fixed-length bit vector; different fingerprints capture different aspects of structure. section 2.4
- Similarity metric: measure shared features between pairs of molecules. Tanimoto and Dice coefficients are common choices for binary fingerprints. section 2.5.1
- Search strategy: rank library molecules and retain the top candidates. With multiple queries, decide how to prioritize a candidate across its similarities to the references. section 2.1.3 section 2.6
Listing 2.8 Featurizing molecules with Morgan fingerprints
from rdkit import DataStructs
from rdkit.Chem import AllChem
from rdkit.Chem.rdFingerprintGenerator import GetMorganGenerator
def generate_morgan_fingerprints( #A
df, mol_col='mol', radius=2, n_bits=2048 #A
): #A
df_copy = df.copy()
fp_col_name = f"morgan_fp_r{radius}_b{n_bits}"
morgan_generator = GetMorganGenerator(radius=radius, fpSize=n_bits)
def compute_fingerprint(mol):
if mol is None: return None
return morgan_generator.GetFingerprint(mol)
df_copy.loc[:,fp_col_name] = \
df_copy[mol_col].apply(compute_fingerprint)
return df_copy, fp_col_name
specs_filtered, fp_col_name = generate_morgan_fingerprints(
specs_filtered
)This RDKit listing generates Morgan fingerprints for molecules in a dataframe, using a radius of 2 and 2,048 bits by default. section 2.4.3
For fingerprints, Tanimoto similarity divides the number of shared set bits by the number of bits set in either fingerprint. Dice similarity divides twice the number of shared set bits by the sum of the set-bit counts in both fingerprints. Both range from 0 to 1; the score describes similarity in the chosen representation, not a measured biological effect. section 2.5.1 section 2.1.3
Finding antimalarial candidates
Use the 400 known active compounds in the Malaria Box as queries against a diverse chemical library. Fingerprint the molecules, compare each library compound with the queries, and prioritize highly similar candidates for further investigation. Document the fingerprint, metric, and multi-query ranking strategy so others can review and reproduce the search. section 2.1.2 section 2.4 section 2.6




































