Hi Tim,

Assuming that you already have the indices of the atoms that you're
interested in looking at, it's pretty easy to calculate the angle between
three arbitrary atoms. Here's an example:

In [3]: m = Chem.AddHs(Chem.MolFromSmiles('COCCCCCO'))

In [4]: AllChem.EmbedMolecule(m)
Out[4]: 0

In [5]: conf = m.GetConformer()

In [6]: ps = [conf.GetAtomPosition(x) for x in range(conf.GetNumAtoms())]

The atom0 - atom1 - atom2 angle:
In [7]: (ps[1]-ps[0]).AngleTo(ps[1]-ps[2])
Out[7]: 1.8295300825582068


Those happened to be bonded, but that's not necessary, here's the atom1 -
atom6 - atom3 angle:
In [15]: (ps[6]-ps[1]).AngleTo(ps[6]-ps[3])
Out[15]: 0.4862648980647286

Is that what you're looking for?

-greg



On Mon, Sep 7, 2020 at 3:06 PM Tim Dudgeon <tdudgeon...@gmail.com> wrote:

> Hi RDKitters,
> I was wondering whether anyone has any RDKit code that checks on the
> geometry of a H-bond.
> e.g. once a donor and acceptor are located within a reasonable distance of
> each other to check on the angles involved to establish if that is a
> reasonable H-bond.
> Tim
>
>
> _______________________________________________
> 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