I need to get the H atom 3D positions on hydrogen bond donors in a molecule.
Thanks to the great documentation I found out how to get the H bond donor
atoms, so I thought I could move from there to get the H 3D co-ordinates.
A snippet on a SMILES generated molecule (I tried this with 3D molecules,
and I get the same result)
#!/usr/bin/env python
import os
from rdkit import Chem
from rdkit import RDConfig
from rdkit.Chem import ChemicalFeatures
mol = Chem.MolFromSmiles("C[NH]C") # no 3D coordinates, but you get the
drift - embed molecule if you want some
fdefName = os.path.join(RDConfig.RDDataDir, 'BaseFeatures.fdef')
factory = ChemicalFeatures.BuildFeatureFactory(fdefName)
feats = factory.GetFeaturesForMol(mol)
for f in feats:
if f.GetFamily() == 'Donor':
print "found donor"
for neighbouring_atom in
mol.GetAtomWithIdx(f.GetAtomIds()[0]).GetNeighbors(): # this hardcoded
index is incident prone
print neighbouring_atom.GetSymbol()
Output:
found donor
C
C
# Where is my H atom?
Note that in my 3D example (not reproduced here), I have Hs defined in the
mol2 file.
-
Jean-Paul Ebejer
Early Stage Researcher
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss