Hi Chris,

Error reported a bin (0,2,0) which does not satisfy the triangle rule. I cannot check it, but I suppose that the error may disappear if you set trianglePruneBins=False in SigFactory, but this would be a workaround not a proper solution I think.

Pavel.

On 12/08/2021 10:25, Chris Swain via Rdkit-discuss wrote:
Hi,

I’m trying to generate 2Dpharmacophore fingerprints as described here

https://www.rdkit.org/docs/GettingStartedInPython.html#d-pharmacophore-fingerprints <https://www.rdkit.org/docs/GettingStartedInPython.html#d-pharmacophore-fingerprints>

For the majority of molecules this works fine but for a few I get this error, any idea what the issue is?

Chris

qmol = Chem.MolFromSmiles('COc1ccc(C(C)C)cc1CN[C@H]1C2CCN(CC2)[C@H]1C(c1ccccc1)c1ccccc1')
fpquery = Generate.Gen2DFingerprint(qmol,sigFactory)
fpquery

---------------------------------------------------------------------------
ValueError                                 Traceback (most recent call last)
~/miniconda3/lib/python3.7/site-packages/rdkit/Chem/Pharm2D/SigFactory.py  
inGetBitIdx(self, featIndices, dists, sortIndices)
248                  print('\tbins:',  repr(self._bins),  type(self._bins))
--> 249bin_=  self._findBinIdx(dists,  self._bins,  self._scaffolds[len(dists)])
250          except  ValueError:

~/miniconda3/lib/python3.7/site-packages/rdkit/Chem/Pharm2D/SigFactory.py  
in_findBinIdx(self, dists, bins, scaffolds)
167              whichBins[i]  =  where
--> 168res=  scaffolds.index(tuple(whichBins))
169          if  _verbose:

ValueError: (0, 2, 0) is not in list

During handling of the above exception, another exception occurred:

IndexError                                 Traceback (most recent call last)
<ipython-input-23-254e36ab25ba>  in<module>
1  qmol=  
Chem.MolFromSmiles('COc1ccc(C(C)C)cc1CN[C@H]1C2CCN(CC2)[C@H]1C(c1ccccc1)c1ccccc1')
----> 2fpquery=  Generate.Gen2DFingerprint(qmol,sigFactory)
3  fpquery

~/miniconda3/lib/python3.7/site-packages/rdkit/Chem/Pharm2D/Generate.py  
inGen2DFingerprint(mol, sigFactory, perms, dMat, bitInfo)
160      for  matchin  matchesToMap:
161        if  sigFactory.shortestPathsOnly:
--> 162idx=  _ShortestPathsMatch(match,  perm,  sig,  dMat,  sigFactory)
163          if  idxis  not  None  and  bitInfois  not  None:
164            l=  bitInfo.get(idx,  [])

~/miniconda3/lib/python3.7/site-packages/rdkit/Chem/Pharm2D/Generate.py  
in_ShortestPathsMatch(match, featureSet, sig, dMat, sigFactory)
71      dist[i]  =  d
72 ---> 73idx= sigFactory.GetBitIdx(featureSet, dist, sortIndices=False)
74    if  _verbose:
75      print('\t',  dist,  minD,  maxD,  idx)

~/miniconda3/lib/python3.7/site-packages/rdkit/Chem/Pharm2D/SigFactory.py  
inGetBitIdx(self, featIndices, dists, sortIndices)
252              fams=  [fams[x]  for  xin  featIndices]
253              raise IndexError('distance bin not found: feats: %s; dists=%s; 
bins=%s; scaffolds: %s' %
--> 254(fams, dists, self._bins, self._scaffolds)) 255 256 return startIdx+ offset+ bin_

IndexError: distance bin not found: feats: ['Acceptor', 'Aromatic', 
'Hydrophobe']; 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]



_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to