Hi Greg,

Thank you very much for your response and for the example. I am now trying to 
understand how to two functions work.

I have a few questions about ShapeProtrudeDist and ShapeTanimotoDist.

  1.  In ./Code/Geometry/GridUtils.cpp lines 28-31 in tanimotoDistance and 
lines 46-49 in protrudeDistance seem the same to me. What is the difference 
between them? How does one calculate the dist and inter and the other the 
totProtrude and intersectVolume? And why on line 31 is inter a double, whereas 
on line 49, intersectVolume an unsigned int?
  2.  I follow your example below, that the ShapeProtrudeDist is 0.0 but could 
you point me to where in the code it does the check for which is the smaller 
shape?
  3.  Am I right in understanding that the ShapeProtrudeDist is the amount of 
volume protrusion of the smaller molecule (from the larger molecule) as a 
percentage with respect to the total volume of the smaller?

Thanks very much for the help!


Susan
________________________________
From: Greg Landrum [[email protected]]
Sent: 14 February 2018 06:25
To: Susan Leung
Cc: [email protected]
Subject: Re: [Rdkit-discuss] Tversky Shape similarity

Hi Susan,

There isn't currently a function available to calculate Tversky distance using 
shapes (though it wouldn't be terribly difficult to add), but you can use the 
ShapeProtrudeDist to generate a measure for comparing two molecules of unequal 
size. Here's a simple demonstration:

In [3]: m = Chem.AddHs(Chem.MolFromSmiles('CC'))

In [4]: AllChem.EmbedMolecule(m)
Out[4]: 0

In [5]: nm = Chem.RWMol(m)

In [6]: nm.RemoveAtom(7)

In [7]: nm.RemoveAtom(6)

In [8]: nm.RemoveAtom(5)

In [9]: from rdkit.Chem import rdShapeHelpers

In [13]: rdShapeHelpers.ShapeTanimotoDist(m,nm,ignoreHs=False)
Out[13]: 0.09966499162479062

In [15]: rdShapeHelpers.ShapeProtrudeDist(m,nm,ignoreHs=False)
Out[15]: 0.0


Note that by default ShapeProtrudeDist will reorder the arguments so that it's 
always looking at the fraction of the larger shape protrudes from the smaller 
shape.

I hope this helps,
-greg


On Tue, Feb 13, 2018 at 2:07 PM, Susan Leung 
<[email protected]<mailto:[email protected]>> wrote:
Dear all,

I would like to compute the shape overlap between two molecules. I understand 
that there is rdShapeHelpers.ShapeTanimotoDist however I would like to compare 
the two molecules in a tversky manner.

For example I have mol1 and mol2 and I want a score which penalises mol1 for 
failing to cover mol2 but do not wish to penalise mol1 for having extra volume.

Best wishes,

Susan

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to