Jump to content

Talk:Mod:Hunt Research Group/VMDTips

From ChemWiki

Tricks and Tips

quick way to identify commands

  • Turn on the TkConsole and log commands
go to Extensions and turn on the TkConsole, then goto File select log Tcl commands to Console, this logs the command of anything you do on the GUI and thus allows you to quickly determine a number of commands for scripts

hide a molecule

  • double click on the "D" under molecule in the main VMD window

change one of the predefined colours

  • this is the color command link
  • must be applied to an existing colour name
  • format is where color=color_name and r g b are numerical values (can be read off the slider)
change rgb color r g b
  • example which changes the colour blue2 to a light blue is
color change rgb blue2 0.500000 0.700000 0.970000

Color by random property

Sometimes it is convenient to color the atoms of a molecule according to a specific property. VMD provides the possibility to do so, namely via the implemented color option according to the B-factor of an atom. To do so, make a PDB file of the molecule of interest, e.g. water

ATOM      1  OH  OSP3    1       4.013   0.831  -9.083  1.00  0.00              
ATOM      2 1HH  OSP3    1       4.941   0.844  -8.837  1.00  0.00              
ATOM      3 2HH  OSP3    1       3.750  -0.068  -9.293  1.00  0.00              
TER

and change the B-factor array (which is the last column, here all 0.00) to the desired property, for example

ATOM      1  OH  OSP3    1       4.013   0.831  -9.083  1.00  2.00              
ATOM      2 1HH  OSP3    1       4.941   0.844  -8.837  1.00  1.00              
ATOM      3 2HH  OSP3    1       3.750  -0.068  -9.293  1.00  3.00              
TER

Save the changes, then open the PDB file in VMD. Click on Graphics => Representations, then select "Beta" in the Coloring Method drop-down menu. The color scale data range can be changed when clicking on Trajectory in the same window and changing the values in Color Scale Data Range.

Graphical Representations Window
Graphical Representations Window

Thus, every property, such as partial charge change, rmsd, how much you like an atom :) ... can be visualised easily.

Colored water molecule according to the property saved to the B-factor array.
Colored water molecule according to the property saved to the B-factor array.