Hi Guillaume,
On Tue, Sep 13, 2016 at 10:12 PM, Guillaume GODIN <
[email protected]> wrote:
> 1 Does 3D coordinates of a conformer is in Angstroms ?
>
> If you read the conformer from a file, for example a mol file, then the 3D
coordinates are in whatever units they were in in that file. This is
usually Angstrsom.
If you generate the conformation using one of the RDKit embedding
functions, then they are certainly in Angstroms.
> 2 How to enumerate all HBonding to determine the bond length ?
>
Interesting question. Here's a python function that might be a starting
point:
def
findHBonds(m,confId=-1,possiblePartners='[#8,#7]',possibleHs='[#1][#8,#7]',distThresh=2.5):
conf = m.GetConformer(confId)
partners =[x[0] for x in
m.GetSubstructMatches(Chem.MolFromSmarts(possiblePartners))]
hs= [x[0] for x in
m.GetSubstructMatches(Chem.MolFromSmarts(possibleHs))]
res = []
for h in hs:
ph = conf.GetAtomPosition(h)
for partner in partners:
if m.GetBondBetweenAtoms(h,partner) is not None:
continue
d = conf.GetAtomPosition(partner).Distance(ph)
if d<=distThresh:
res.append((h,partner,d))
return res
In order to allow flexibility about what an H bond is, I left the
definitions of the acceptors (partners in the above code) and polar Hs
(just Hs in the above code) as SMARTS definitions so that they can be
customized.
------------------------------------------------------------------------------
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss