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:

enter image description here

OpenBabel conversion Gaussian09 to SMILES (left):


SMILES generated by some drawing program (right):


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?


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:


Then, if you convert this InChI to SMILES, you'll get:


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.

  • 2
    $\begingroup$ The left structure simply is wrong; that should probably be a bug report for open Babel. Do you have other examples? Also the smiles generated for the right side not apply aromaticity, so I wouldn't regard this as correct either. $\endgroup$ Jul 31, 2019 at 18:45
  • 1
    $\begingroup$ Often structures containing Benzimidazoles are wrong... I will check a bug report for OpenBabel. $\endgroup$
    – theozh
    Jul 31, 2019 at 19:56
  • $\begingroup$ @Martin - マーチン♦, by the way, do you maybe know what exact section OpenBabel is extracting from the Gaussian output file (start/end keywords or headers)?. I found that if you convert first to InChI and then afterwards convert these InChI to SMILES gives a higher "yield" of correct SMILES structures (but still not 100%). $\endgroup$
    – theozh
    Aug 1, 2019 at 8:36
  • $\begingroup$ I don't know, but I assume it's extracting the molecular structure, then probably forms internal coordinates, flattens the molecule, form a graph, translates it to smiles, canonicalise it. InChI just is probably less ambiguous. As for why it might yield 'correct (er)' results, I'm guessing the algorithm is different and more robust. In any case, a canonical smiles should have a 1:1 correspondence to InChI. But still, I'm guessing here... And open Babel is way too complex for me to understand or look into. $\endgroup$ Aug 2, 2019 at 17:31
  • $\begingroup$ Do feel free to submit your findings as an answer! :) $\endgroup$ Feb 28, 2020 at 21:53


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.