Re: [Rdkit-discuss] Angstroms Hydrogen bonding

2016-09-14 Thread Peter Gedeck
Hello Here are a few suggestion you can try that may speed up your code. Instead of GetSubstructMatches, you can use the list of neighbours of each atom. Here is something that may work, it creates an iterator that will return all the atoms for bond angles. I did not test it, however it may give

Re: [Rdkit-discuss] FindChiralCenters in MOL/SDF files howto

2016-09-14 Thread Dimitri Maziuk
On 09/14/2016 02:23 PM, Dimitri Maziuk wrote: > lbl=mol.GetAtomWithIdx(s[0]).GetSymbol() + str(s[0]+1) > print label, ":", s[1] ^^^ Should be lbl -- Dimitri Maziuk Programmer/sysadmin BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu signature.asc Description: OpenPGP

[Rdkit-discuss] FindChiralCenters in MOL/SDF files howto

2016-09-14 Thread Dimitri Maziuk
I don't know if this fits in the Getting Started, or Cookbook, or if TPTB decide to wikify the docs and it should go there, but anyway, here goes. With thanks to everyone responsible, of course. It does need corrections/clarifications. - # MOL/SDF FindChiralCenters

Re: [Rdkit-discuss] Angstroms Hydrogen bonding

2016-09-14 Thread Guillaume GODIN
Dear Greg, I found my mistake I need the bond angle not the torsion. I add this function for that... from numpy import (array, dot, arccos, clip,zeros,degrees) from numpy.linalg import norm def cangle(v1,v2): c=dot(v1,v2)/norm(v1)/norm(v2) # -> cosine of the angle return arccos(clip

Re: [Rdkit-discuss] Angstroms Hydrogen bonding

2016-09-14 Thread Guillaume GODIN
Hi Greg, here the first code prototype of the article mappiing in rdkit: for the moment I have some issues with angle the rest start to be ok Can you look at it and see if my interpretation is ok ? BR, Guillaume --- import sys import re from rdkit import Chem from rdkit.Chem

Re: [Rdkit-discuss] Angstroms Hydrogen bonding

2016-09-14 Thread Greg Landrum
On Wed, Sep 14, 2016 at 4:16 AM, Guillaume GODIN < guillaume.go...@firmenich.com> wrote: > Your solution is perfect! > > > glad it worked > I am currently implementing this article "http://www.mdpi.com/1420- > 3049/20/10/18279" using RDKit. > > Interesting, I hadn't seen that one. > It's now

Re: [Rdkit-discuss] Angstroms Hydrogen bonding

2016-09-14 Thread Maciek Wójcikowski
Hi Guillaume, Greg's solution is great for intra-molecular H-Bonds. If you want to achieve inter-molecular ones then it's a bit more complicated. I did such implementation in my package ODDT [https://github.com/oddt/oddt], which also uses RDKit. You can find the hbond function in interactions modu

Re: [Rdkit-discuss] Angstroms Hydrogen bonding

2016-09-14 Thread Guillaume GODIN
Dear Greg, Your solution is perfect! BTW, I was also looking for the intramolecular H-H distances, and your function can be a modify to do this too: def findintramolecularHH(m,confId=-1,possiblePartners='[#1][*]',possibleHs='[#1]',distThresh=2.5): conf = m.GetConformer(confId) partn

Re: [Rdkit-discuss] Angstroms Hydrogen bonding

2016-09-14 Thread Greg Landrum
Hi Guillaume, On Tue, Sep 13, 2016 at 10:12 PM, Guillaume GODIN < guillaume.go...@firmenich.com> 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 fi