Example Tcl Scripts for Molecular Visualization in VMD
The following are some small Tcl scripts for VMD, a program for visualizing molecular dynamics. These scripts demo some graphics and show the conformational change in hemoglobin when the heme is bound. The scripting syntax for VMD is poorly documented, so these scripts may be of use to people trying to get their scripts working.
Start VMD and do Extensions->Tk Console
In the console, CD to the working folder
Open Graphics->Representations to show graphics info
source 1.tcl
source 2.tcl
source 3.tcl
source 4.tcl
1.tcl
display resetview
display update on
display update ui
mol load pdb 1GZX.pdb
mol modstyle 0 0 NewCartoon
mol modcolor 0 0 Chain
2.tcl
mol selection heme
mol addrep 0
mol modstyle 1 0 licorice
mol modcolor 1 0 element
3.tcl
mol selection "oxygen within 4 of heme"
mol addrep 0
mol showrep 0 0 off
mol modstyle 2 0 VDW
mol modcolor 2 0 element
4.tcl
mol showrep 0 2 off
mol showrep 0 0 on
display resetview
mol selection polar
mol addrep 0
mol modstyle 3 0 dotted
mol modcolor 3 0 conformation
1GZX.pdb 1a3n-aligned.pdb