It seems the bins for the distances (tuple (0,2,0)) did not pass the triangle 
inequality test and was deemed invalid. Setting `trianglePruneBins` to False 
when you construct the SigFactory should fix it:

> sigFactory = 
> SigFactory(featFactory,minPointCount=2,maxPointCount=3,trianglePruneBins=False)


Hope it helps.

Eddie

On Sep 3, 2013, at 11:26 AM, Patrick Walters <wpwalt...@gmail.com> wrote:

> Hi All,
> 
> I was working through the 2D pharmacophore example in the "Getting Started" 
> docs
> 
> http://www.rdkit.org/docs/GettingStartedInPython.html#d-pharmacophore-fingerprints
> 
> and I threw an exeception that I don't understand.   Here's my code
> 
> ==================================
> #!/usr/bin/env python
> 
> from rdkit import Chem
> from rdkit.Chem import ChemicalFeatures
> from rdkit.Chem.Pharm2D.SigFactory import SigFactory
> from rdkit.Chem.Pharm2D import Generate
> 
> mol = Chem.MolFromSmiles("CC12CCC3C(CCc4cc(O)ccc34)C2CC(O)C1O")
> 
> fdefName = 'MinimalFeatures.fdef'
> featFactory = ChemicalFeatures.BuildFeatureFactory(fdefName)
> 
> sigFactory = SigFactory(featFactory,minPointCount=2,maxPointCount=3)
> sigFactory.SetBins([(0,2),(2,5),(5,8)])
> sigFactory.Init()
> print sigFactory.GetSigSize()
> 
> Generate.Gen2DFingerprint(mol,sigFactory)
> 
> ==================================
> 
> MinimalFeatures.fdef comes from $RDBASE/Docs/Book/data/MinimalFeatures.fdef
> 
> Here's the exception
> 
> ===================================
> 
>   File "./test2.py", line 18, in <module>
>     Generate.Gen2DFingerprint(mol,sigFactory)
>   File 
> "/Users/walters/software/RDKIT/2013_09_01/rdkit-master/rdkit/Chem/Pharm2D/Generate.py",
>  line 154, in Gen2DFingerprint
>     _ShortestPathsMatch(match,perm,sig,dMat,sigFactory)
>   File 
> "/Users/walters/software/RDKIT/2013_09_01/rdkit-master/rdkit/Chem/Pharm2D/Generate.py",
>  line 69, in _ShortestPathsMatch
>     idx = sigFactory.GetBitIdx(featureSet,dist,sortIndices=False)
>   File 
> "/Users/walters/software/RDKIT/2013_09_01/rdkit-master/rdkit/Chem/Pharm2D/SigFactory.py",
>  line 248, in GetBitIdx
>     raise IndexError,'distance bin not found: feats: %s; dists=%s; bins=%s; 
> scaffolds: %s'%(fams,dists,self._bins,self._scaffolds)
> IndexError: distance bin not found: feats: ['Acceptor', 'Aromatic', 'Donor']; 
> dists=[1, 5, 1]; bins=[(0, 2), (2, 5), (5, 8)]; scaffolds: [0, [(0,), (1,), 
> (2,)], 0, [(0, 0, 0), (0, 0, 1), (0, 1, 0), (0, 1, 1), (0, 1, 2), (0, 2, 1), 
> (0, 2, 2), (1, 0, 0), (1, 0, 1), (1, 0, 2), (1, 1, 0), (1, 1, 1), (1, 1, 2), 
> (1, 2, 0), (1, 2, 1), (1, 2, 2), (2, 0, 1), (2, 0, 2), (2, 1, 0), (2, 1, 1), 
> (2, 1, 2), (2, 2, 0), (2, 2, 1), (2, 2, 2)], 0]
> 
> ======================================
> 
> Can someone tell me what I'm doing wrong? At first I thought I just needed to 
> increase the maximum of the last bin boundary, but that doesn't seem to do it.
> 
> Thanks in advance,
> 
> Pat
> 
> 
> ------------------------------------------------------------------------------
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk_______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to