Menu

#939 Canonical SMILES errors

2.3.x
open
nobody
None
1
2014-08-22
2014-08-05
No

This is all referring to the OpenSMILES spec:
http://www.opensmiles.org/opensmiles.html

The SMILES string "C([H])([H])([H])([H])([H])([H])([H])([H])([H])" canonicalizes to "[CH10]", which according to the OpenSMILES spec is not valid --

hcount ::= 'H' | 'H' DIGIT

To reproduce this issue:

$ python
>>> import openbabel
>>> obc = openbabel.OBConversion()
>>> obc.SetInAndOutFormats("smi", "can")
True
>>> outMol = openbabel.OBMol()
>>> obc.ReadString(outMol, "[C]([H])([H])([H])([H])([H])([H])([H])([H])([H])([H])")
True
>>> print obc.WriteString(outMol)
[CH10]

I'm using apt-get install python-openbabel.

$ apt-show-versions python-openbabel
python-openbabel/precise uptodate 2.3.0+dfsg-3ubuntu3

Discussion