Hi All,
thanks for the suggestions.

Greg, that's part of what's needed but there's also some more complex logic
needed. For instance, if the atom the H is attached to is rotatable e.g. an
OH group) then it is more complex than if it is fixed (e.g a N in a ring).
I was wondering whether anyone had already encoded these types of rules.

BTW I also found https://oddt.readthedocs.io/en/latest/ which seems to
handle a whole range of interaction types nicely, and can use RDKit as its
underlying toolkit (as well as OBabel).

Tim

On Tue, Sep 8, 2020 at 1:24 PM Greg Landrum <greg.land...@gmail.com> wrote:

> 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