Stream line your configuration plotting -- Scripting in VMD (I)

Hello world!

I want to show how to write script in VMD to stream line your visulization. VMD is a visualization software developed in UIUC. The default setting of VMD, compared to other softwares like VESTA, Atomeye, Avogadro, is quite 1990s. But it has a huge potential. After you know it well, you can easily fake it as any other visualization software :P

VMD is a fancy machine that every tiny part can be tuned. The best feature is definitely scripting interface. Most of the time I work with a huge batch of simulation with the same materials, usually the same supercell. VMD allows me to visualize 100 configurations with the same rendering setting: same color and size for certain species, same bond linking. This software is the best friend for lazy grad students like me.

Well, things always come with a price. The learning curve for the scripting is quite deep. You need to know how to program and also a bit about TCL scripting language (or at least how to stackoverflow tcl language). You need to know what VMD can do generally and have some experience with using its GUI interface. In this tutorial series, I assume that you already know all of this. If you don’t, please check the links below to get yourself familiar with the basic knowledge of VMD.

TCL basic https://www.tcl.tk/man/tcl8.5/tutorial/tcltutorial.html

Installation in guide : http://www.ks.uiuc.edu/Research/vmd/current/ig/ig.html

User guide: http://www.ks.uiuc.edu/Research/vmd/current/ug/ug.html

Useful tool: atomsk: http://atomsk.univ-lille1.fr/

Guide to render png with VMD: https://ourphysics.org/wiki/index.php/How_to_make_images_for_publication_using_VMD

install Tachyon to enable png format rendering: https://lixinsun.mit.edu/blog/compile-tachyon-libpng-linuxmacos-vmd-rendering

VMD cheat sheet by me : https://scholar.harvard.edu/lixinsun/blog/vmd-cheat-sheet

how to open the TCL interface in VMD

Control Panel -> Extension -> TK console

Or use the terminal window which you opened VMD

In this interface, you can use some basic bash command like “cd”, “ls”, “pwd” to change your work folder.

You can also source the script that you write or the script you download from other sources.

Check out the official script library: http://www.ks.uiuc.edu/Research/vmd/script_library/ and try to source some of the script as exercise.

In the next blog, I’ll show how to write a simple script to render 100 figures at a time!

See also: Tutorial