Hi,

> Could anyone help to me find the calculations of Hydrogen Bond acceptor and 
> Donor By Babel.


[By the way, is there any chance to include HBA / HBD / numbers of
rotatable bonds in obprop ? Would surely be nicer code than my own
scripts :-) ]

Look for exemple here
http://baoilleach.blogspot.com/2007/07/pybel-hack-that-sd-file.html

and you could try this:


#!/usr/bin/python
import pybel

### HBD ### # Lipinski RO5 definition
HBD_RO5 = pybel.Smarts("[#7,#8;!H0]") # Any nitrogen or oxygen with at
least one attached hydrogen

### HBA ### # Lipinski RO5 definition
HBA_RO5 = pybel.Smarts("[#7,#8]") # Any nitrogen or oxygen,
idependantly of real HBD caracter

def moredesc(mol):
    ans = {}
    ans['HBD_RO5']       = len(HBD_RO5.findall(mol))
    ans['HBA_RO5']       = len(HBA_RO5.findall(mol))
    return ans

print "name\tHBD_RO5\tHBA_RO5"

#for mol in pybel.readfile("mol2", "tmp.mol2"):
#for mol in pybel.readfile("sdf", "tmp.sdf"):
for mol in pybel.readfile("smi", "tmp.smi"):
    descriptors_moredesc = moredesc(mol)
    print mol.OBMol.GetTitle(), "\t", descriptors_moredesc['HBD_RO5'],
"\t", descriptors_moredesc['HBA_RO5']

____

Sure, it depends of your definition of HBD/HDA, and the kind of
library you scan.

For my purpose, I use for HBA:
HBA = pybel.Smarts("[$([#7,#8]);!$([nX3,NX4,#7v5]);!$([NX3][c,C&X3,C&X2])]")
# Only N and O, excluded: pyrrole N (nX3), tetrasubstituted N (NX4), N
in nitro (#7v5), amid nitrogen and e.g. Phe-NH2 are excluded

Regards,
Pascal

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
OpenBabel-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to