Hello,

  I encountered with an issue which I cannot understand and solve. This might be a bug or a feature. After removal of some specific hydrogens I could not add them back. Is it expected behavior or should I create an issue on github?

print('---- load mol ----')
m = Chem.MolFromSmiles('c1ccccc1O')
print(Chem.MolToSmiles(m, allHsExplicit=True))
print('---- add Hs ----')
m = Chem.AddHs(m)
print(Chem.MolToSmiles(m, allHsExplicit=True))
print('---- remove H ----')
em = Chem.EditableMol(m)
em.RemoveAtom(7)
print(Chem.MolToSmiles(em.GetMol(), allHsExplicit=True))
print('---- add Hs ----')
mm = Chem.AddHs(em.GetMol())
print(Chem.MolToSmiles(mm, allHsExplicit=True))
print('---- update property cache ----')
mm.UpdatePropertyCache()
print(Chem.MolToSmiles(mm, allHsExplicit=True))

output:

---- load mol ----
[OH][c]1[cH][cH][cH][cH][cH]1
---- add Hs ----
[H][O][c]1[c]([H])[c]([H])[c]([H])[c]([H])[c]1[H]
---- remove H ----
[H][O][c]1[c][c]([H])[c]([H])[c]([H])[c]1[H]
---- add Hs ----
[H][O][c]1[c][c]([H])[c]([H])[c]([H])[c]1[H]
---- update property cache ----
[H][O][c]1[c][c]([H])[c]([H])[c]([H])[c]1[H]

Pavel.

_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to