calculate 3d pharmacophore fingerprint in rdkit

I read document about RDKit for the first time in a while and found nice snippet.
A 3D Pharmacophore finger print can be caluclated very easily.

from rdkit import Chem, DataStructs, RDConfig
from rdkit.Chem import AllChem
from rdkit.Chem.Pharm2D import Gobbi_Pharm2D, Generate

mol = Chem.MolFromSmiles( 'O=C2C(Cc1ccc(cc1)C(C(=O)O)C)CCC2' )
AllChem.EmbedMolecule( mol ) #gen 3d

factory = Gobbi_Pharm2D.factroy
#calc 3d p4 fp
fp = Generate.Generate2DFingerPrint( mol, factory, dMat = Chem.Get3DDistanceMatrix(mol )
# dMat option is Key!

If dMat = None( default setting), fp means 2D Pharamcophore fingerprint, but now I passed dMat so the fingerprint has 3D information.

Now 3D pharmacophore fingerprint in hand, it means I can try to 3D QSAR or 3D fingerprint based filtering.

I’ll try to do it ASAP. ;-)


Published by iwatobipen

I'm medicinal chemist in mid size of pharmaceutical company. I love chemoinfo, cording, organic synthesis, my family.

7 thoughts on “calculate 3d pharmacophore fingerprint in rdkit

    1. Thank you for your query. If you want to get pharmacophore, you can use rdkit.Chem.Pharm3D class. What I want to get is pharmacophore fingerprint. Fingerprint generation method is not implemented in Pharm3D class.

      You can find same approach in RDKit CookBook.
      ”A 3D pharmacophore fingerprint can be calculated using the RDKit by feeding a 3D distance matrix to the 2D-pharmacophore machinery.”
      This is because RDKit defines the pharmacophore as SMARTS strings. It does not depend on whether input molecule is 2D or 3D.
      Key point is distance matrix, it provides the 3D distance relationships of features.
      And if you want to draw pharmacophore in 3D. How about following approach?

      Is it answer for you?

      1. So if I understand correctly.
        A compound will always have the same 2 D pharmacophore fingerprint.
        But its 3D pharmacophore fingerprint may be different depending on its conformation.
        For example:
        Let say two mol objects of the same compound in two different conformations: ,mol_conf2 mol_conf2

        fp1 = Generate.Generate2DFingerPrint( mol, factory, dMat = Chem.Get3DDistanceMatrix(mol_conf1)
        fp2 = Generate.Generate2DFingerPrint( mol, factory, dMat = Chem.Get3DDistanceMatrix(mol_conf2)

        so fp1 is different from fp2. Right?

        And the last question: Is there a way to visualize the common 3d pharmacophore between two compounds?

      2. That’s right, 3D pharmacophore depends not only structure but also its conformation.
        And if you want to visualize pharmacophores in rdkit, I think you can do it by using Chem.Features module. But I never try it.

  1. Thank you for sharing your scripts. They are very useful. Have you ever tried to cluster a set of compounds based on 3D pharmacophore fingerprints? Thank you!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: