The process of creating 2D depictions is explained in detail here. This way, it is possible to create a 2D image via running e.g.

obabel -O 2d_depiction.png

However, how do I generate a ball and stick 3d depiction (as image) instead?

  • 1
    $\begingroup$ Try: obabel -L pov $\endgroup$
    – vapid
    Oct 26 '16 at 13:55
  • 2
    $\begingroup$ By the way, there is a specific Open Babel forum to ask such questions.. $\endgroup$ Oct 26 '16 at 16:04

Open Babel does not generate "ball and stick 3D depictions" directly, because it's not a molecular visualization program.

That's why we started Avogadro.

There are a few formats supported in Open Babel to write out 3D depictions, e.g.:

But you can make a pseudo-3D "ball and stick" depiction in the SVG format:

enter image description here

obabel [file] -O file.svg -xS

  • 2
    $\begingroup$ Personally, I'd recommend using a visualization software to make sure I get the view angle set the way I want. The only reason we added the -xS option was to generate previews for 100,000 molecules in PQR search results. $\endgroup$ Oct 26 '16 at 16:02
  • $\begingroup$ Nice answer, thanks : ) Yeah, I know that automatic 3D structure depiction will most often lead to a bad view angle. But I just need them for quick evaluation of MD results and I am planning to integrate the visualization into the IPython notebook. $\endgroup$ Oct 26 '16 at 16:16
  • 1
    $\begingroup$ If you're integrating into iPython, you might also want to look at 3DMol.js which will give you interactive JavaScript views. e.g. py3Dmol $\endgroup$ Oct 26 '16 at 16:48
  • $\begingroup$ 3DMol.js how could I overlook that, and I looked for molecular graphics packages a lot. If I could I would up vote two times for that comment : ) $\endgroup$ Oct 28 '16 at 22:16
  • 1
    $\begingroup$ I just tried it and managed to get py3Dmol running in like 2 min. $-$ interactive molecule visualization in the IPython notebook made easy : ) $\endgroup$ Oct 28 '16 at 22:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.