VMD Cheat Sheet
Command-Line Options
When started, the following command-line parameters may be given to VMD. Note that if a command-line parameter does not start with a dash (-), and is not part of another option, it is assumed to be a PDB filename. Thus, the command
will start VMD and load a molecule from the file molecule.pdb.
| Option | Function |
| -? or -h | Print a summary a command-line options to the console. |
| -m filename1 filename2 | load multiple molecules |
| -e filename | execute the text commands in filename, and then resume normal operation. |
| -psf filename | Load the specified PSF (need a PDB or DCD file too) |
| -pdb filename | Load the specified molecule (in PDB format) at startup. |
| -dcd filename | Load the specified binary DCD (need a PDB or PSF file too) |
| -disp option | type of graphical display (win => standard, text or none => none) |
| -pos x y | position for the graphics display window. |
| -size x y | size for the graphics display window |
| -nt | Do not display the VMD title at startup. |
| -startup filename | Use filename as the VMD startup command script |
| -init filename | Use filename as the file containing VMD initialization data |
To see the comand line help info screen type:
Atom Selections
To start off, here are some examples of valid selection commands in VMD. Following these will be a more in depth description of how selections work.
| name CA |
| resid 35 |
| name CA and resname ALA |
| backbone |
| not protein |
| protein (backbone or name H) |
| name 'A 1' |
| name 'A *' |
| name "C.*" |
| mass < 5 |
| numbonds = 2 |
| abs(charge) > 1 |
| x < 6 and x > 3 |
| sqr(x-5)+sqr(y+4)+sqr(z) > sqr(5) |
| within 5 of name FE |
| exwithin 3 of protein |
| protein within 5 of nucleic |
| same resname as (protein within 5 of nucleic) |
| protein sequence "C..C" |
| name eq $atomname |
| protein and @myselection |
Barry's .vmdrc functions
Mouse mode
R enter rotate mode; stop rotation
T enter translate mode
S enter scaling mode
C assign rotation center
0 query item; show labels menu
1 pick atom
2 pick bond (2 atoms)
3 pick angle (3 atoms)
4 pick dihedral (4 atoms)
5 move atom
6 move residue
7 move fragment
8 move molecule
9 move highlighted rep
View
~` reset view
Q view from positive direction of x axis
W view from positive direction of y axis
E view from positive direction of z axis
F flip view 180º (view from the back of the current view)
X spin about x axis
Y spin about y axis
Z spin about z axis
J rotate 2º about x
K rotate -2º about x
L rotate 2º about y
H rotate -2º about y
Representations
N - apply preselected graphical representation
(new cartoon colored by index)
I - apply preselected graphical representation
(trace colored by index)
U - apply preselected graphical representation
(trace colored by molecule)
A - apply representations from the top molecule
to all other molecules
#U - make the selections of the top molecule
# to auto update each frame
___Background
V - set white background and 'exp2' depth cue
B - set black background without depthcue
P - switch depthcue on and off
Additional graphics
O (o) - draw coordinate cylinders in origin
(red x, green y, blue z)
G - draw coordinate grid
(red x, green y, blue z).
One tick 1Ã…, small square
5Ã… big square 10Ã….
D - remove all the graphics added
Menus
\[ - show main menu
\] - show files menu, and set the current folder
as of the top molecule file
' - show graphics (Graphical Representations) menu
\\ - show sequence menu
\; - show tkcon Tcl console (only works after
the first menu use)
Animation
+ move to next frame
- move to previous frame
. > play animation forward
, < play animation reverse
/ ? stop animation
Modifications
NOT IMPLIMENTED
#M - center molecule to the origin
#` ~ - orient top molecule (< 50,000 atoms)
by principal axes
(requires Orient script written
by Paul Grayson and linear algebra
from Hume Integration Software)
Text Commands (for the console):
h - Show this list of Hot keys and Text commands
n - Loads coordinates from the filelist and
adds them as new files.
Syntax:
n {file1.coor file2.pdb file3.dcd};
n {/net/home/bgrant/} {file1.dcd} 10
Filenames can be separated by new lines.
First argument can be path to files,
it can be omitted or empty.
The third argument can be step for
trajectory reading or can be omitted.
Filename can include full path.
a - Loads coordinates from the filelist and adds
them as new frames to the top molecule
Syntax:
a {file1.coor file2.pdb file3.dcd};
a {/net/home/bgrant/} {file1.dcd} 10
Filenames can be separated by new lines.
First argument can be path to files,
it can be omitted or empty.
The third argument can be step for
trajectory reading or can be omitted.
Filename can include full path.
pdb - Write current frame of the top file
to a pdb file _.pdb
cell - Sets the cell size for periodic images.
Usage:
cell {a, b, c, alpha, beta, gamma}
cell {line from xsc file}
cell {parameters from NAMD configuration}
cell {xsc filename}
E.g.
'cell {100 110 120 90 90 60}'
'cell {sim-mscs-007.xsc}'
lbl - Labels each atom in the 'selectionText' with
information 'labelInfo', with
arbitrary prefix 'labelPrefix',
color 'color' and font size 'size'.
Syntax:
'lbl <|selectionText>
<|labelInfo>
<labelPrefix> <color> <|size>'
E.g.
'lbl \{resid 1 to 10 and name CA\}'
'lbl \{name CA\} \{resname resid\} \{ \} blue 0.5'
#morph - !NOT IMPLEMENTED! Adds frames with linear
interpolation between the existing
frames of the top molecule.
Usage:
'morph
'
'morph
'
E.g.
'morph 10'
'morph 2 linear'
'morph 3 cycle'
'morph 100 sin2'
'morph 3:10:4 linear'
Text Commands
VMD understands commands which start with the following words. See below for a more complete synopsis.
- animate: Play/Pause/Rewind a molecular trajectory.
- axes: Position a set of XYZ axes on the screen.
- color: Change the color assigned to molecules, or edit the colormap.
- display: Change various aspects of the graphical display window.
- exit: Quit VMD.
- help or ?: Display this help file with an HTML viewer.
- label: Turn on/off labels for particular atoms, bonds, angles, or dihedral angles.
- light: Control the light sources used to illuminate graphical objects.
- logfile: Log commands to a text file or the VMD console.
- menu: Control or query the on-screen GUI menu forms.
- mol: Load, modify, or delete a molecule in VMD.
- molecule: Same as mol.
- mouse: Change the current state (mode) of the mouse.
- play: Start executing text commands from a specified file.
- quit: Same as exit.
- remote: Set up VMD to connect to or start a remote simulation program (optional).
- render: Output the currently displayed image (scene) to a file.
- rock: Rotate the current scene continually at a specified rate.
- rot: Rotate the current scene around a given axis by a certain angle.
- rotate: Same as rot.
- rotation: Same as rot.
- scale: Scale the current scene up or down.
- stage: Position a checkerboard stage on the screen.
- trans: Translate the objects in the current scene.
- translate: Same as trans.
- user: Add user-customized commands to the graphics display pop-up menu.
- wait: Specify a number of seconds to wait before reading another command.
Words which complete the above text command are shown below
animate
Play/Pause/Rewind a molecular trajectory.
| forward | Play animation forward |
| for | Same as forward |
| reverse | Play animation backward |
| rev | Same as reverse |
| pause | Pause animation |
| prev | GO to previous frame |
| next | GO to next frame |
| skip n | Set stride to n+1 frames |
| delete all | Delete all frames from memory |
| speed n | Set animation speed to n |
| style once | Set to play animation once |
| style loop | Set to loop through animation continuously |
| style rock | Set to play animation foward and back continuously |
| goto start | GO to first frame |
| goto end | GO to last frame |
| goto n | GO to frame n |
| read filename nb ne ns molecule_number | read molecule data |
| write filename nb] ne ns molecule_number | Write data for molecule |
| delete nb ne ns molecule_number | Delete data for molecule |
| readdel filename nb ne ns molecule_number | Read data for molecule overwriting existing data |
note. the last few comands operate on data from molecule_number from filename, beginning with frame nb, ending with frame ne, with a stride of ns+1
axes
Position a set of XYZ axes on the screen.
| location (option) | Position axes (off , origin , lowerleft , lowerright , upperleft , upperright) |
center rotation
Position the center of rotation to a point, in this case the origin (0,0,0).
| molinfo 0 set center "{0.0 0.0 0.0}" |
Center on an atom selection:
| set sel [atomselect top "resid 770 to 778"] |
| set center [list [measure center $sel]] |
| molinfo 0 set center $center |
color
Change the color assigned to molecules, or edit the colormap. All color values are in the range 0 ... 1.
| category name color | Set color of object specified by category and name to color |
| scale method (option) | Set type of scale (RGB , RWB , BlkW) |
| scale midpoint x | Set midpoint of color scale to x, in the range 0 ... 1 |
| scale min x | Set minimum of color scale to x, in the range 0 ... 1 |
| scale max x | Set maximum of color scale to x, in the range 0 ... 1 |
| change (options) color | Reset given property of color to default value ( alpha , shininess , rgb , ambient , diffuse , specular ) |
| change (options) color othercolor | Set given property of color to match othercolor |
| change (options) color value | Set given (scalar) property of color to value ( alpha , shininess ) |
| change (options) color r g b | Set given (3-valued) property of color to r g b (rgb , ambient , diffuse , specular ) |
debug
Turn on/off printing of debugging messages.
This will have no effect if VMD was compiled without the debugging option.
| on , off | Turn debug on or off |
| level n | Set debug level to n |
display
Change various aspects of the graphical display window.
| reshape | Reshape the display |
| resetview | Reset the view |
| eyesep value | Set the eye separation to value |
| focallength value | Set the focal length to value |
| height value | Set the screen height to value |
| distance value | Set the screen distance to value |
| antialias < on , off > | Turn antialiasing on or off |
| depthcue < on , off > | Turn depth cueing on or off |
| stere (options) | Change the stereo mode (off , sidebyside , crystaleyes) |
| nearclip < set , add > value | Add to or set near clipping plane position |
| farclip < set , add > value | Add to or set far clipping plane position |
exit
Quit VMD.
| confirm | Ask user before quitting |
| now | Quit without asking |
help or ?
Display this help file with an HTML viewer.
| help (command)
Jump to help for command |
label
Turn on/off labels for particular atoms, bonds, angles, or dihedral angles.
| add category [atom1 ... atomN] | Add a label involving the N atoms to the given category |
| list category | list all labels in the given category |
| show category (all , label_number) | Turn on labels in the given category |
| hide category (all , label_number) | Turn off labels in the given category |
| delete category (all , label_number) | Delete labels in the given category |
| graph category label_number (command) | Show a graph of a label from the given category |
The data will be written to a file, and the specified command will be run to graph the data. %s in the command string will be replaced by the temporary filename
light
Control the light sources used to illuminate graphical objects. There are four light sources, numbered 0 to 3
| light_number on | Turn a light on |
| light_number off | Turn a light off |
| light_number highlight | Display a line indicating the position of a light source |
| light_number unhighlight | Hide the line indicating the position of a light source |
| light_number rot < x , y , z > angle | Rotate a light (at infinity) angle degrees about a given axis |
logfile
Turn on/off logging a VMD session to a log file. This will create a log file with commands for all the actions taking during the session.
The log file may be played back later by using the play command.
| console | Log commands to the VMD text console |
| filename | Turn on logging to filename |
| off | Turn off logging |
menu
Control or query the on-screen GUI menu forms.
| menu_name on | Turn a menu on |
| menu_name off | Turn a menu off |
| menu_name loc | Print the location of a menu |
| menu_name move x y | Turn a menu on |
mol or molecule
Load, modify, or delete a molecule in VMD.
In the following, molecule_number is a string describing which molecules are affected by the command.
It is of the form < m1,m2,....,mN >, where mN is either (all, top, active, inactive, displayed, on, off, fixed, free) or one of the unique integer ID codes assigned to the molecules when they are loaded.
| < new , load > structure_file_type structure_file (coordinate_file_type coordinate_file) | Load a new molecule from given file(s) |
| list (all , top , active , displayed , none , molecule_number ) | Print information about molecules |
| color color_method | Change the default atom coloring method setting |
| representation rep_method | Change the default rendering method setting |
| selection select_method | Change the default atom selection setting |
| modcolor rep_number molecule_number color_method | Change the current coloring method for the given representation in the given molecule |
| modstyle rep_number molecule_number rep_method | Change the current rendering method (style) for the given representation in the given molecule |
| modselect rep_number molecule_number select_method | Change the current atom selection for the given representation in the given molecule |
| addrep | Using the current default settings for the atom selection, coloring, and rendering methods, add a new representation to the top molecule |
| delrep rep_number molecule_number | Deletes the given representation from the specified molecule |
| delete (options) | Delete molecules (all , top , active , displayed , none , molecule_number) |
| active (options) | Make molecules active (all , top , active , displayed , none , molecule_number) |
| inactive (options) | Make molecules inactive (all , top , active , displayed , none , molecule_number) |
| on (options) | Turn molecules on (all , top , active , displayed , none , molecule_number) |
| off (options) | Turn molecules off (all , top , active , displayed , none , molecule_number) |
| fix (options) | Fix molecules (all , top , active , displayed , none , molecule_number) |
| free (options) | Unfix molecules (all , top , active , displayed , none , molecule_number) |
| top molecule_number | Set the top molecule |
mouse | Change the current state (mode) of the mouse.
| mode 0 | Set mouse mode to rotation |
| mode 1 | Set mouse mode to translation |
| mode 2 | Set mouse mode to scaling |
| mode 3 N | Set mouse mode to rotate light N |
| mode 4 N | Set mouse mode to picking mode N |
play
Start executing text commands from a specified file, instead of from the console. When the end of file is reached, VMD will resume reading commands from the previous source. This command may be nested, s|commands being read from one file can include commands to read other files.
| filename | Execute commands from filename |
quit
Same as exit
render
Output the currently displayed image (scene) to a file
| list | List the available rendering methods |
| method filename | Render the global scene to filename using method |
| method filename command | Render the global scene to filename, then execute `command' |
note. Any %s in `command' are replaced by the filename
rock
Rotate the current scene continually at a specified rate |
| off | Stops rocking |
| < x , y , z > by step | Rock around the given axis at a rate of step degrees per redraw |
| < x , y , z > by step n | Rock around the given axis at a rate of step degrees per redraw for n steps, reverse, and repeat |
rot or rotate
Rotate the current scene around a given axis by a certain angle |
| stop | Stop all rotation, same as rock off |
| < x , y , z > by angle | Rotate around the given axis angle degrees |
| < x , y , z > to angle | Rotate the given axis to the absolute position angle |
| < x , y , z > < by , to > angle step | Rotate at a rate of step degrees per redraw |
scale
Scale the current scene up or down.
| by f | Multiply scene scaling factor by f |
| to f | Set scene scaling factor to f |
simulation
Same as sim
stage
Position a checkerboard stage on the screen |
| location < off , origin , bottom , top , left , right , behind > |
| panels n | Set number of panels in stage |
trans
Translate the objects in the current scene.
| by x y z | Translate by vector (x,y,z) in screen units |
| to x y z | Translate to the absolute position (x,y,z) in screen units |
translate
Same as trans.
user
Add user-customized hotkey commands to the graphics window and input devices
| add key key (command) | Assign the given text command to the hotkey key |
When key is then pressed while the mouse is in the display window, the specified command will be executed.
| print keys | Print out the current definition of the hotkeys |
wait
Specify a number of seconds to wait before reading another command.
Povay tmp files
temporary povray file is written to the working directory. However, you
may want to use the attached script instead. This will write your scene in
two parts, a .pov file containing all meta data, such as the lights, camera
and #defaults, and an include file (.inc) which contains the structure. In
this way you have maximum control over your scene without having to edit a
huge povray file. You may even want to consider splitting your scene up in
separate parts (taken from the same perspective), which you combine in a
global .pov file using #include statements. This will give even more control
with regards to modifications to the scene.
The magic word in pymol (after run make_pov.py) is make_pov
NB. the .pov file contains a commented statement with regards to a povray
script, which allows transforming scenes and objects from model space to
camera space and vice versa.
# make_pov.py
# Do "run make_pov.py" from within pymol and then execute the script
# with "make_pov('povray.inp')" to create the povray.inp file.
#
from pymol import cmd
def make_pov(file, meta=True):
f1, f2 = file, file:-4 + '.inc'
(header,data) = cmd.get_povray()
povfile = open(f1,'w')
if meta: povfile.write(header)
povview = cmd.get_view()
povfile.write("""\n
// Uncomment the following lines if you have the pymolmacro.inc include file and want to use it.
/*
#include \"pymolmacro.inc\"
PYMOL_VIEW( %10.5f, %10.5f, %10.5f,
%10.5f, %10.5f, %10.5f,
%10.5f, %10.5f, %10.5f,
%10.5f, %10.5f, %10.5f,
%10.5f, %10.5f, %10.5f,
%10.5f, %10.5f, %10.5f )
povfile.write('#include "%s"\n\n' % f2)
povfile.close()
povfile = open(f2,'w')
povfile.write(data)
povfile.close()
cmd.extend('make_pov',make_pov)
mol defaul to change things
There is a new "mol default" command that you can use to alter default graphical representations
in the test versions of VMD 1.8.4. Here's an example of how you'd use it in your .vmdrc file:
mol default color {colorID 5}
mol default style {NewCartoon 0.300000 6.000000 4.100000 0}
mol default selection {name CA}
mol default material {Transparent}
DCD trajectory display
You can use the CatDCD program to strip
away atoms you're not interested in seeing. Typically, you'd use atom
selections in VMD to generate an 'index' file that CatDCD can use to
select the atoms you want to keep. You'd also produce matching psf/pdb files
using the '$sel writeXXX' atom selection file writing feature in VMD.
Once you have matching PSF/PDB/DCD files, you could then load it all up
into VMD.
matrix routines
To rotate a molecule so the long axis will be aligned to Z you can do this by using the VMD matrix routines, documented at:
http://www.ks.uiuc.edu/Research/vmd/current/ug/node172.html
For example, if the long axis of your molecule is along
the vector {a b c}, you can rotate it to align it with the z axis as
follows:
This performs your task in two steps: transvec inv rotates your vector
to be along the x axis, and then transaxis rotates about the y axis to
align your vector with z.
RMSD
You can calculate RMSD for any collection of atoms you like using the 'measure rmsd' command:
You may need to use 'measure fit' and '$sel move' if you need to align
structures first.
cavity/pocket representation
For cavities and pores, you could try using the new volumetric map
generation plugin, found in the Extensions->Analysis->VolMap Tool menu
in the main VMD window. (requires VMD 1.8.4, not available in older versions)
To display cavities or pores you'd generate a density or occupancy map,
and then display the map with an isosurface with a isovalue of zero,
or a near-zero value to show the regions not containing atoms. Much would
depend on the details of your structure of course, but it should be possible
to do this with the built-in VolMap tool, or by using the 'volmap'
text command if the graphical tool doesn't afford enough control for
your purposes.
The previously most common way of displaying pores in VMD was via
the HOLE program by Oliver Smart, and load the resulting sphere set into
VMD with an example script for this purpose in the VMD script library.
The HOLE program and scripts work with older versions of VMD as well as
the latest version.
Dr. Smart's home page (contact him to get HOLE):
VMD hole script:
Another approach is to use VOLBL to calculate the volume of cavities and represented the
cavity-bordering atoms by their VDW radii, after changing the VDW radii
values to those used in VOLBL. You can have a look at BJ: 85 p. 886-896
(2003).
Draw things
See the HowTos page DrawVMD
Running in Text Mode
(still interactive), or in a pure batch mode with
| vmd -dispdev text -eofexit < input.tcl > output.log |
Adding plugins
You can either copy them over an existing one,
or load it on-the-fly with commands like these (your filesystem paths):
| plugin dlopen /home/user/myplugins/dlpolyplugin.so |
| plugin update |
Comments (0)
You don't have permission to comment on this page.