Hello, I am trying to adjust the protonization based on the PH for a given molecule and I am using pybel and openbabel for python. I am using the following code:
>>> mol = pybel.readstring('smi', 'C1=CC=C(C=C1)C[C@H](C(=O)[O-])[NH3+]') > >>> len(mol.atoms) > 16 > >>> mol.OBMol.AddHydrogens(True, True, 7.4) > True > >>> len(mol.atoms) > 15 >>> mol.write('smi').rstrip() > 'c1ccc(cc1)C[C@H](C(=O)[O-])[NH3+]' > >>> mol.write('inchi').rstrip() > ============================== > *** Open Babel Warning in InChI code > #0 :Proton(s) added/removed > > 'InChI=1S/C9H11NO2/c10-8(9(11)12)6-7-4-2-1-3-5-7/h1-5,8H,6,10H2,(H,11,12)/t8-/m1/s1' > >>> mol.write('inchikey').rstrip() > ============================== > *** Open Babel Warning in InChI code > #0 :Proton(s) added/removed > 'COLNVLDHVKWLRT-MRVPVSSYSA-N' It seems that there are two issues after the conversion is successfully done. 1. When I output the SMILES, it is not affected, however the inchi and inchikey are changed >>> mol.write('smi').rstrip() > 'c1ccc(cc1)C[C@H](C(=O)[O-])[NH3+]' > >>> mol.write('inchikey').rstrip() > ============================== > *** Open Babel Warning in InChI code > #0 :Wrong 0D stereo descriptor(s): #1; Proton(s) added/removed; Omitted > undefined stereo > 'COLNVLDHVKWLRT-UHFFFAOYSA-N' > >>> mol.write('inchi').rstrip() > ============================== > *** Open Babel Warning in InChI code > #0 :Wrong 0D stereo descriptor(s): #1; Proton(s) added/removed; Omitted > undefined stereo > 'InChI=1S/C9H11NO2/c10-8(9(11)12)6-7-4-2-1-3-5-7/h1-5,8H,6,10H2,(H,11,12)' 2. The original stereochemistry information of the molecule is lost now. I was wondering if someone can help me to figure out why the SMILES is not updated after the PH-correction and why the stereochemistry is lost? Thanks, Sam
------------------------------------------------------------------------------
_______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss