7
$\begingroup$

Molecular graphics software is usually interactive.

But I am looking for a library or program that would be able to render a given molecule based on the commands from another program. I would like to give it a molecule description, the vantage point, options, etc, and it should produce the picture without opening any windows.

The input is the same data as contained in an XYZ file (or the file itself), the expected output is a 3D molecule drawing.

What is the easiest way to do this?

$\endgroup$
  • 2
    $\begingroup$ From the top of my head: Open Babel; chemfig (LaTeX package); RDKit (Python). Is that what you are after? $\endgroup$ – andselisk Feb 12 at 22:24
  • 2
    $\begingroup$ Try Jmol, many of the 3D rendered molecules you see on wikipedia use this. $\endgroup$ – porphyrin Feb 13 at 8:07
  • $\begingroup$ @porphyrin Thank you, Jmol works. Their "jmoldata" command (JmolData.jar based) is able to convert the xyz file to nicely rendered 3D image based on the provided Jmol script. $\endgroup$ – Jennifer M. Feb 13 at 10:51
4
$\begingroup$

The "jmoldata" command (using JmolData.jar from Jmol) converts xyz/pdb and many other molecule formats to nicely rendered 3D images based on the user-provided Jmol scripts.

(answer based on the hint from the user @porphyrin)

$\endgroup$
1
$\begingroup$

Before monitors had graphics capabilities, all graphics programs worked that way. For macromolecules, you could use molscript, and for smaller molecules, you could use ORTEP. Both are still available, and are script-driven.

Molscript is open source now and lives on Github. You write a script describing how to show the molecule (there is a generic script you can use, or write one specifically for each structure), and choices of output formats (PostScript, Raster3D and VRML).

For small molecules, a good option would be Jmol in its java standalone version. Using command line options, you can load a file with coordinates, a generic script, turn of the graphics display and choose an output file format.

$\endgroup$
  • 4
    $\begingroup$ Could you probably add a brief description/links/examples to make it look more like an answer and not a comment? Also, from what I remember, ORTEP is like half-century old and some implementations of it are proprietary and is overall a pain to work with on both Windows and Linux. I'm not familiar with molscript though. $\endgroup$ – andselisk Feb 12 at 23:26
  • 1
    $\begingroup$ I used MolScript from 1999 through 2006 to generate figures. It's solid and the requirements are minimal. $\endgroup$ – Todd Minehardt Feb 13 at 3:01
  • 1
    $\begingroup$ @ToddMinehardt MolScript isn't supported any more, and doesn't build on most modern systems. $\endgroup$ – Jennifer M. Feb 13 at 5:21
  • 2
    $\begingroup$ Back in the computational chemistry course we used wxMacMolPlt to write the basic input for our calculations. When my output file had some errors I would simply copy paste the optimized geometry coordinates back into the software. It won't generate bonds but you can get the 3D model from the coordinates for example. Depending on the software you can also plot the output file using Avogadro if the file format is accepted. $\endgroup$ – Justanotherchemist Feb 13 at 7:43

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.