Dear colleagues, I am trying to fix a molecule (originally in PDB format - what can you expect?) which is a fluro-chloro-benzene with a hydrogen missing. I have somehow already converted it into MDL MOL format (see attached). The carbon atom with the missing hydrogen was set to have a formal charge of -1. I loaded it into RDKit, looked for the atom with a formal charge of -1 and reset its formal charge to 0. Then I used the AddHs() function to add the missing hydrogen. I also inquired the partial charges of all atoms using the GetMMFFPartialCharge() function. However, nothing seems to have changed after the fix. I got two questions. (1) why is it that no hydrogen atom was added by AddHs() ? (2) in any case, even if the hydrogen was not added, why is it that the sum of all MMFFPartialCharges does not equal the net formal charge of the molecule? My python script is attached. Thank you for your insight. Ling
bnz.mol
Description: Binary data
from rdkit import Chem from rdkit.Chem import AllChem from rdkit.Chem import ChemicalForceFields import sys
mol = Chem.MolFromMolFile('bnz.mol', removeHs=False)
mp = AllChem.MMFFGetMoleculeProperties(mol)
sys.stderr.write("No. of atoms before fix = {:n}\n".format(mol.GetNumAtoms()))
# Print out all partial charges
t=0.0
for i in range(mol.GetNumAtoms()):
q = mp.GetMMFFPartialCharge(i)
t = t+q
print q
sys.stderr.write("Total Charge before fix = {}\n".format(t))
# Fix the molecule - first fix the formal charge
for i in range(mol.GetNumAtoms()):
atom = mol.GetAtomWithIdx(i)
if atom.GetFormalCharge()== -1:
sys.stderr.write("formal charge changed for atom {}\n".format(i))
atom.SetFormalCharge(0)
# double check that the formal charge has been changed.
for i in range(mol.GetNumAtoms()):
atom = mol.GetAtomWithIdx(i)
if atom.GetFormalCharge()== -1:
sys.exit("ERROR: Atom {:n} Not Changed\n".format(i))
# Fix the molecule - now add hydrogens
m2 = Chem.AddHs(mol, addCoords=True)
mp2 = AllChem.MMFFGetMoleculeProperties(m2)
sys.stderr.write("No. of atoms after fix = {:n}\n".format(m2.GetNumAtoms()))
# Print out all partial charges
t=0.0
for i in range(m2.GetNumAtoms()):
q = mp2.GetMMFFPartialCharge(i)
t = t+q
print q
sys.stderr.write("Total Charge after fix = {}\n".format(t))
------------------------------------------------------------------------------ One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________ Rdkit-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

