I would like to get the molecular structure as SMILES from Gaussian output files. OpenBabel seems to be the tool made for such tasks. However, the structure is not always correct.
One example:
OpenBabel conversion Gaussian09 to SMILES (left):
N1(c2ccccc2)[C]2C=CC=CC2=[N]=C1c1ccccc1
SMILES generated by some drawing program (right):
C12=CC=CC=C1N(C3=CC=CC=C3)C(C4=CC=CC=C4)=N2
Is there a way (maybe a special option in OpenBabel which I missed) to directly get a correct output or to do some "postprocessing" to correct the SMILES afterward for example with RDKit or others?
Update:
One way to increase the yield of correct output seems to be the following. If you convert the Gaussian output to InChI first, for the above example you'll get:
InChI=1S/C19H14N2/c1-3-9-15(10-4-1)19-20-17-13-7-8-14-18(17)21(19)16-11-5-2-6-12-16/h1-14H
Then, if you convert this InChI to SMILES, you'll get:
c1ccc(cc1)c1nc2ccccc2n1c1ccccc1
Which results in the right picture above.
However, even with this workaround some compounds, e.g. with ...C#N...
triple bonds are sometimes still incorrect.
I placed a bug report on GitHub. Let's see...
Any strategies, tips, and tricks to reliably and directly get a correct SMILES output are appreciated.