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 <susan.le...@st-hildas.ox.ac.uk
> 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
> Rdkit-discuss@lists.sourceforge.net
> 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
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss