OpenBabel cannot render to SVG any SMILES strings of a similar form to "C.Cl" -- consisting of two atoms in the organic subset separated by a dot. This is how to reproduce the error:
>>> import openbabel >>> smiles = "C.Cl" >>> ob = openbabel.OBConversion() >>> ob.SetInAndOutFormats("smi", "svg") True >>> out = openbabel.OBMol() >>> ob.ReadString(out, smiles) True >>> ans = ob.WriteString(out) ============================== *** Open Babel Error in SVGFormat Molecule needs 2D coordinates to display in SVGformat
Some examples of strings that don't work:
C.Cl
C.C
Cl.Br
Some examples of strings that work, in contrast:
C.CC
C.[H][Cl]
CBr.C
Note: I don't know which Milestone to place this under.
I am using the Python bindings for OpenBabel (pip install python-openbabel).
$ pip freeze | grep openbabel
openbabel==1.6
Edit: I'm not using pip-install python-openbabel, I'm using apt-get install python-openbabel.
$ apt-show-versions python-openbabel python-openbabel/precise uptodate 2.3.0+dfsg-3ubuntu3