Tutorials

Chemical fingerprints and similarity searching

How Morgan, MACCS and path fingerprints work, what Tanimoto scores mean, and why similar structures can have different activities.

Chemical fingerprints encode a molecule as a bit vector or a count vector. Similarity searching compares fingerprints to find compounds that resemble a query. The method is fast and widely used. The result depends on the fingerprint and the similarity coefficient.

What a fingerprint represents

A fingerprint records the presence or absence of substructures, paths, atoms or pharmacophores. A hashed fingerprint maps each feature to a position in a fixed-length vector. Collisions can occur when different features map to the same position.

A count fingerprint records how many times a feature occurs. It carries more information than a binary fingerprint but is larger.

The choice of features determines what "similar" means. A fingerprint based on atom environments captures local chemistry; a fingerprint based on paths captures connectivity; a pharmacophore fingerprint captures spatial arrangement of features.

Common fingerprints

Morgan fingerprints, also called extended connectivity fingerprints, are built by iteratively hashing the environment around each atom. They are widely used for similarity searching and machine learning.

MACCS keys are a fixed set of structural keys based on predefined substructures. They are interpretable but less flexible than hashed fingerprints.

Daylight-like path fingerprints encode linear paths of atoms and bonds. They are useful for scaffold and substructure similarity.

The exact implementation matters. Two tools that both offer a "Morgan fingerprint" may use different radii, lengths or hashing conventions. Report the parameters.

Similarity coefficients

The Tanimoto coefficient is the most common measure for binary fingerprints. It is the number of shared bits divided by the number of bits present in either molecule.

A value of 1 means identical fingerprints; 0 means no shared bits. The coefficient depends on the fingerprint length and the number of features. A short fingerprint tends to give higher similarity values. Collisions and shared bits are more likely in a short vector.

Other coefficients include Dice and cosine. They rank compounds differently. Use one coefficient consistently and state it.

Thresholds

A common rule of thumb is that a Tanimoto similarity above roughly 0.7 indicates a meaningful resemblance. The threshold is not universal. It depends on the fingerprint, the library and the question.

For scaffold hopping, a lower similarity may be useful. For finding close analogues, a higher threshold may be appropriate. Do not treat a threshold as a property of chemistry.

Similarity is not activity

Two molecules can be structurally similar and have very different activities. A small change in a functional group can switch a compound from active to inactive. These are sometimes called activity cliffs.

A similarity search finds analogues, not actives. The result should be tested. A model that predicts activity from similarity assumes that similar structures have similar activities, which is not always true.

Library searching and diversity

Similarity searching can find compounds in a large library that resemble a query. It can also be used to select a diverse subset by picking compounds that are dissimilar to each other.

For diversity selection, the choice of fingerprint and threshold determines the subset. A diverse set by one fingerprint may not be diverse by another. State the method.

Substructure and scaffold searches

A substructure search asks whether a molecule contains a specific pattern. It is a exact query, not a similarity query. A scaffold search extracts the core ring system and compares scaffolds.

These methods answer different questions from similarity. A high similarity score does not mean that a molecule contains the query substructure.

Practical checks

  • Use a standardised structure before calculating a fingerprint.
  • Report the fingerprint type, radius, length and software.
  • Report the similarity coefficient.
  • Do not compare scores from different fingerprints.
  • Test the top hits experimentally.

Activity cliffs and model validation

A similarity model can fail at an activity cliff, where a small structural change produces a large change in activity. The model sees similar fingerprints and predicts similar activity, but the reality is different.

To test a similarity-based model, hold out compounds and check whether the model ranks them correctly. A scaffold split is more demanding than a random split because it tests the model on new chemotypes. A random split can overstate performance because the test compounds resemble the training compounds.

Report the split, the metric and the baseline. A model that is no better than a simple similarity search is not adding value.

Standardisation

Before computing a fingerprint, standardise the structure. Remove salts, neutralise charges, canonicalise tautomers and handle stereochemistry consistently.

Different standardisation choices produce different fingerprints and different similarity scores. A salt form and its free base should not be treated as two unrelated compounds, but they are not identical either. Record the standardisation.

Reporting

Report the fingerprint type, the radius, the length, the software and the similarity coefficient. State the threshold and how the hits were ranked. If a model was used, report the training set, the split and the validation metric.

A table of hits with structures and scores is more useful than a single number. The reader should be able to see why a compound was selected.

Key points

  • A fingerprint encodes structural features as a vector.
  • The fingerprint determines what similarity means.
  • Tanimoto is common but not universal.
  • A similarity threshold is a convention, not a law.
  • Similar structures can have different activities.

Common mistakes

  • Comparing Tanimoto scores from different fingerprints.
  • Ignoring salt forms and tautomers.
  • Treating a high similarity as proof of activity.
  • Using a threshold without stating the fingerprint.
  • Selecting a diverse set without reporting the method.

When to ask for help

If the library is large, if the compounds are heterogeneous, or if a similarity result needs to be turned into a screening set, ask for a review. You can order an analysis or read the QSAR validation guide. The Cheminformatics & QSAR Modelling course covers fingerprints, the QSAR validation guide covers model checks, and the RDKit documentation describes the implementations.

Sources and further reading

When to ask for help. If your data or design do not fit a tutorial, order an analysis and we will reply with a fixed price.

Written by the Solagene team for research and education. Found an error? Tell us and we will correct it.