Hi,
I keep having problems with charges and hydrogens using OpenBabel 2.3.2.
I wrote the attached test and results are kinda disappointing.
For benzoic acid, for example, I get the following values:
1. SMILES | partial (formal): -0.0000 (0.0)
2. Gasteiger | partial (formal): -0.6059 (0.0)
First step refer to the molecule generated by reading SMILES string; second step shows
results obtained after adding hydrogens for pH 7.4 (OBMol.AddHydrogens) and calculating
Gasteiger charges (ob.OBChargeModel)
Both partial charges and protonation are wrong.
The sum of partial charges is never 0.0 (not even for ethane).
On the other hand, formal charge is always 0, meaning that protonation is not correct, but
I couldn't find a way to add hydrogens at a given pH.
There have been bug reports [1] relating charges and protonation already, pointing to the
danger of the results obtained in this way.
Is there any word from developers on the matter?
Stefano
[1] http://sourceforge.net/p/openbabel/bugs/710/
--
Stefano Forli, PhD
Staff Scientist
Molecular Graphics Laboratory
Dept. of Integrative Structural
and Computational Biology, MB-112F
The Scripps Research Institute
10550 North Torrey Pines Road
La Jolla, CA 92037-1000, USA.
tel: +1 (858)784-2055
fax: +1 (858)784-2860
email: fo...@scripps.edu
http://www.scripps.edu/~forli/
import openbabel as ob
import pybel
import sys
smiles = [ ( 'O=C(O)c1ccccc1', 'benzoic_acid'),
('n1ccsc1', 'thiazole'),
('CC(O)=O', 'acetic_acid'),
('OS(=O)(=O)O', 'sulfuric_acid'),
('CCN','ethylamine'),
('CC', 'ethane'),
('C', 'methane'),
('N', 'ammonia'),
]
polaronly=False
correctForPH=True
pH=7.4
for smi, name in smiles:
print "======= %s [%s]" % (name, smi)
molpybel = pybel.readstring('smi', smi)
mol = molpybel.OBMol
partialCharge1 = sum( [x.GetPartialCharge() for x in ob.OBMolAtomIter(mol)] )
print "1. SMILES | partial (formal): %2.4f (%1.1f)" % (partialCharge1,
mol.GetTotalCharge())
molpybel.make3D()
molpybel.write('mol2', '%s_pre.mol2' % name, overwrite=True)
mol.DeleteHydrogens()
mol.AddHydrogens(polaronly, correctForPH, pH)
charger = ob.OBChargeModel.FindType('gasteiger')
charger.ComputeCharges(mol)
partialCharge2 = sum( [x.GetPartialCharge() for x in ob.OBMolAtomIter(mol)] )
print "2. Gasteiger | partial (formal): %2.4f (%1.1f)" % (partialCharge2,
mol.GetTotalCharge())
molpybel = pybel.Molecule(mol)
molpybel.write('mol2', '%s.mol2' % name, overwrite=True)
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss