RDKit Version: '2020.03.3'
Operating system: MacOS, Linux
Are you using conda? yes
If you are using conda, which channel did you install the rdkit from? conda-forge
I wanted to quickly test out the pharmacophore features as shown in this blog post and noticed that the encoded feature directions don't seem to point in the right direction.
I tested this out on lorlatinib, which has both cases for it's aromatic fluorine and carbonyl. E.g. from the Chem.Features.FeatDirUtils.py:
def GetAcceptor1FeatVects(conf, featAtoms, scale=1.5) :
"""
Get the direction vectors for Acceptor of type 1
This is a acceptor with one heavy atom neighbor. There are two possibilities we will
consider here
1. The bond to the heavy atom is a single bond e.g. CO
In this case we don't know the exact direction and we just use the inversion of this bond direction
and mark this direction as a 'cone'
2. The bond to the heavy atom is a double bond e.g. C=O
In this case the we have two possible direction except in some special cases e.g. SO2
where again we will use bond direction
As shown on the right, the aromatic fluorine gets tagged as case 2 instead of case 1 and the carbonyl vice versa (i.e. we want the fluorine to have the directional cone, and the carbonyl to have two possible directions for their lone pairs):
I believe the reversal is caused by line 380 of FeatDirUtilsRD.py, where '>' should be replaced with '==' to satisfy the condition on line 385:
singleBnd = mol.GetBondBetweenAtoms(aid,heavyAt.GetIdx()).GetBondType() > Chem.BondType.SINGLE
# special scale - if the heavy atom is a sulfur (we should proabably check phosphorous as well)
sulfur = heavyAt.GetAtomicNum()==16
if singleBnd or sulfur:
v1 = conf.GetAtomPosition(heavyAt.GetIdx())
Updating this line accordingly seems to fix this issue:
RDKit Version: '2020.03.3' Operating system: MacOS, Linux Are you using conda? yes If you are using conda, which channel did you install the rdkit from? conda-forge
I wanted to quickly test out the pharmacophore features as shown in this blog post and noticed that the encoded feature directions don't seem to point in the right direction.
I tested this out on lorlatinib, which has both cases for it's aromatic fluorine and carbonyl. E.g. from the Chem.Features.FeatDirUtils.py:
As shown on the right, the aromatic fluorine gets tagged as case 2 instead of case 1 and the carbonyl vice versa (i.e. we want the fluorine to have the directional cone, and the carbonyl to have two possible directions for their lone pairs):
I believe the reversal is caused by line 380 of FeatDirUtilsRD.py, where '>' should be replaced with '==' to satisfy the condition on line 385:
Updating this line accordingly seems to fix this issue: