Next: Trajectories and Movie Making
Up: VMD Tutorial
In this section you will learn the basic functions of VMD. We will start with loading a molecule, displaying the molecule, and rendering publication-quality molecule images. This section uses the protein ubiquitin as an example molecule. Ubiquitin is a small protein responsible for labeling proteins for degradation, and is found in all eukaryotes with nearly identical sequences and structures.
Working with a Single Molecule
Loading a Molecule
The first step is to load our molecule. A pdb
1ubq.pdb (Vijay-Kumar et al., JMB, 194:531, 1987),
that contains the atom coordinates of ubiquitin is
provided with the tutorial.
Loading a Molecule.
- Start a VMD session. In the VMD Main window, choose File
New Molecule... (Fig. 4(a)). Another window, the Molecule
File Browser window (Fig. 4(b)), will appear on your screen.
- Use the Browse... (Fig. 4(c))
button to find the file
1ubq.pdb in vmd-tutorial-files directory. Note that when you select
the file, you will be back in the Molecule File Browser window.
In order to actually load the file you have to press Load
(Fig. 4(d)). Do not forget to do this!
Now, ubiquitin is shown in the OpenGL Display window. You may close the Molecule File Browser window
at any time.
Displaying the Molecule
In order to see the 3D structure of our protein, we will use the mouse
in multiple modes to change the viewpoint.
VMD allows users to rotate, scale and translate
the viewpoint of your molecule.
Rotation modes. (a) Rotation axes when holding down the left mouse key. (b) The rotation axis when holding down the right mouse key.
- In the OpenGL Display, press the left mouse button down and move the mouse. Explore what
happens. This is the rotation mode of the mouse and allows you to rotate
the molecule around an axis parallel to the screen (Fig.
- If you hold down the right mouse button and repeat the previous step,
the rotation will be done around an axis perpendicular to your screen (Fig.
5(b)) (For Mac users, the right mouse button
is equivalent to holding down the command key while pressing the mouse button).
- In the VMD Main window, look at the Mouse menu (Fig. 6). Here, you
will be able to switch the mouse mode from Rotation
to Translation or Scale modes.
Mouse modes and their characteristic cursors.
- Choose the Translation
mode and go back to the OpenGL Display. You can now move the molecule around when you
hold the left mouse button down.
- Go back to the the Mouse menu and choose the Scale
mode this time. This will allow you to zoom in or out by moving the mouse horizontally
while holding the left mouse button down.
It should be noted that these actions performed with the mouse
only change your viewpoint and do not change the actual coordinates of the molecule atoms.
Another useful option is the Mouse
Center menu item. It allows you to specify the point around which rotations are done.
- Select the Center menu item and pick one atom at one of the
ends of the protein; The cursor should display a cross.
- Now, press r, rotate the molecule with the mouse and see how
your molecule moves around the point you have selected.
- In the VMD Main window, select the Display
Reset View menu item to
return to the default view. You can also reset the view by pressing the ``=" key when you are in the OpenGL Display window.
VMD can display your molecule in various ways by the Graphical Representations shown in Fig. 7. Each representation is defined by four main parameters: the selection of atoms included in the representation, the drawing style, the coloring method, and the material. The selection determines which part of the molecule is drawn, the drawing method defines which graphical representation is used, the coloring method gives the the color of each part of the representation, and the material determines the effects of lighting, shading, and transparency on the representation. Let's first explore different drawing styles.
- In the VMD Main window, choose the Graphics
item. A window called Graphical Representations will appear and
you will see highlighted in yellow (Fig. 7(a)) the current default representation displaying your molecule.
- In the Draw Style tab (Fig. 7(b)) we can
change the style (Fig. 7(d))
and color (Fig. 7(c)) of the representation. In this section we will focus in
the drawing style (the default is Lines).
- Each Drawing Method has its own parameters. For instance, change
the Thickness of the lines by using the controls
on the lower right-hand-side corner (Fig. 7(c)) of the
Graphical Representations window.
The Graphical Representations window.
- Click on the Drawing Method (Fig. 7(d)), and you will see a list of options. Choose VDW (van der Waals). Each atom is now represented by a sphere,
allowing you to see more easily the volumetric distribution of the protein.
- When you choose VDW for drawing method, two new controls would show up in the lower right-hand-side corner (Fig. 7(e)). Use these controls to change the
Sphere Scale to 0.5
and the Sphere Resolution to 13. Be aware that the higher
the resolution, the slower the display of your molecule will be.
- Press the Default
button. This allows you to return to the default
properties of the chosen drawing method.
The previous representations allow you to see the micromolecular
details of your protein by displaying every single atom. More general structural
properties can be demonstrated better by using more abstract drawing methods.
- Choose the Tube style under Drawing Method and observe the backbone of your
protein. Set the Radius at 0.8. You should get something similar to Fig. 8.
- By looking at your protein in the tube drawing method, see if you can distinguish the helices, -sheets and coils present in the protein.
Licorice (left), Tube (center) and NewCartoon (right) representations of Ubiquitin
The last drawing method we will explore is NewCartoon. It gives a simplified representation of a protein based in its
secondary structure. Helices are drawn as coiled ribbons, -sheets as solid
arrows and all other structures as a tube. This is probably the most popular
drawing method to view the overall architecture of a protein.
- In the Graphical Representations window, choose Drawing Method
NewCartoon. You can now easily identify how many helices, -sheets and coils are present in
Now, let's explore different coloring methods for our representations.
- In the Graphical Representations window, you can see that the default coloring method is Coloring Method
Name. In this coloring method, if you choose a drawing method that shows individual atoms, you can see that they have different colors, i.e: O is red, N is blue, C is cyan and S is yellow.
- Choose Coloring Method
ResType (Fig. 7(c)).
This allows you to distinguish non-polar residues (white),
basic residues (blue), acidic residues (red) and polar residues (green).
- Select Coloring Method
Structure (Fig. 7(c)) and
confirm that the NewCartoon representation displays colors consistent with secondary
You can also only display parts of the molecule that you are interested in by specifying you selection in the Graphical Representations
window (Fig. 7(f)).
Graphical Representations window and the Selections tab.
- In the Graphical Representations
window, there is a Selected Atoms text entry (Fig. 7(f)). Delete the word all,
type helix and press the Apply button or hit the Enter/Return key on your keyboard (remember to do this whenever you change a selection).
VMD will show just the helices present in our molecule.
- In the Graphical Representations window choose
the Selections tab (Fig. 9(a)).
In section Singlewords (Fig. 9(b)), you
will find a list of possible selections you can type. For instance,
try to display -sheets instead of helices by typing the appropriate
word in the Selected Atoms text entry.
Combinations of boolean operators can also be used when writing a selection.
- In order to see the molecule without helices and -sheets, type the
following in Selected Atoms: (not helix) and (not betasheet). Remember to press the Apply button or hit the Enter/Return key on your keyboard.
- In the section Keyword (Fig. 9(c))
of the Selections tab, you can see properties that can be used to select parts of a
protein with their possible values. Look at possible values of
the keyword resname (Fig. 9(d)). Display all the
lysines and glycines present in the
protein by typing (resname LYS) or (resname GLY) in the Selected Atoms. Lysines
play a fundamental role in the configuration of polyubiquitin chains.
- Now, change the current representation's Drawing Method to CPK
and the Coloring Method to ResName in the Draw Style tab. In the
screen you will be able to see the different Lysines and Glycines.
- In the Selected
Atoms text entry type water. Choose Coloring Method
Name. You should see the 58 water molecules
(in fact only the oxygens) present in our system.
- In order to see which water molecules are closer to the protein
you can use the command within. Type water and within 3 of protein for Selected Atoms.
This selects all the water molecules that are within a distance of 3
angstroms of the protein.
- Finally, try typing the following selections in Selected Atoms:
Example atom selections.
||Shows the Protein
||The first residue
|(resid 1 76) and (not water)
||The first and last residues
|(resid 23 to 34) and (protein)
The button Create Rep (Fig. 10(a)) in the Graphical Representations window allows you to create multiple representations. Therefore, you can have a mixture of different selections with different styles and colors, all displayed at the same time.
- For the current representation, in Selected Atoms type protein, set the Drawing Method to NewCartoon
and the Coloring Method to Structure.
- Press the Create Rep button (Fig. 10(a)). You should see that a new representation is created.
Modify the new representation to get VDW as the Drawing Method, ResType as the Coloring Method, and resname LYS as the current selection.
- Repeating the previous procedure, create the following two new
|resid 1 76 and name CA
Multiple Representations of Ubiquitin.
- Create the last representation by pressing again the Create Rep button. Select Drawing Method
Surf for drawing method, Coloring Method
Molecule for coloring method, and type protein in the Selected Atoms entry. For this last representation choose Transparent in the Material pull-down menu (Fig. 10(c)). This representation shows protein's volumetric surface in transparent.
- Note that you can select and modify different
representations you have created by clicking on a representation to highlight it in yellow.
Also, you can switch each representation on/off by double-clicking on it. You can also delete a representation by highlighting it and clicking on the Delete Rep button (Fig. 10(b)). At the end
of this section, your Graphical Representations window
should look similar to Fig. 10.
When dealing with a protein for the first time, it is very
useful to find and display different amino acids quickly. The
sequence viewer extension allows you to view the protein sequence, as well as picking and displaying one or more residues of your choice easily.
VMD Sequence window.
- In the VMD Main window, choose the Extensions
Sequence Viewer menu item.
A window (Fig. 11(a)) with a list of the amino acids (Fig. 11(e)) and their properties (Fig. 11(b)&(c)) will appear in your screen.
- With the mouse, try clicking on different residues in the list (Fig. 11(e)) and
see how they are highlighted. In addition, the highlighted residue will
appear in your OpenGL Display window in yellow and bond
drawing method, so you can visualize its location within the protein easily.
- Using the Zoom controls (Fig. 11(f)) you can display the entire
list of residues in the window. This is especially useful for
- To pick multiple residues, hold the shift key and click on the mouse button. Try highlighting residues 11, 48, 63 and 29
- Look at the Graphical Representations window, you should find a new representation
with the residues you have selected using Sequence Viewer Extension. You can modify, hide or delete this representation similar to what you have done before.
Information about residues is color-coded (Fig. 11(d)) in columns and obtained from STRIDE. The
B-value column (Fig. 11(b)) shows the B-value field (temperature
factor). The struct column shows secondary structure (Fig. 11(d)), where each letter
Secondary Structure codes used by STRIDE.
||Extended conformation (-sheets)
The viewpoints and representations that you have created using VMD can be saved as a VMD state. This
VMD state contains all the information needed to reproduce the same VMD session without losing what you have done.
Saving Your Work
- Go to the OpenGL Display window, use your mouse to find a nice view of the protein. We will save this viewpoint using VMD ViewMaster.
- In the VMD Main window, select Extension
ViewMaster. This will open the VMD ViewMaster window.
- In the VMD ViewMaster window, click on the Create New button. Now you have saved your OpenGL Display view point.
- Go back to your OpenGL Display window, use your mouse to find another nice view. If you want you can also add/delete/modify a representation in the Graphical Representations window. When you have found a good view, you can again save it by returning to the VMD ViewMaster window and clicking on the Creat New button.
- Create as many views as you like by repeating the previous step. You can see that in the VMD ViewMaster window, all of your viewpoints are displayed as thumbnails. You can go to a previously-saved viewpoint by clicking on its thumbnail.
- Let's now save the entire VMD session. In the VMD Main window, choose the File
Save State menu item.
Write an appropriate name (e.g., myfirststate.vmd) and save it. The VMD state file myfirststate.vmd contains all the information you need to restore your VMD session, including the viewpoints and the representations.
To load a saved VMD state, start a new VMD session and in the VMD Main window choose File
- Quit VMD.
One of VMD's many strengths is its ability to render high-resolution, publication-quality molecule images. In this section we will introduce some basic concepts of figure rendering in VMD.
Before you render a figure, you want to make sure you set up the OpenGL Display background the way you want. Nearly all aspects of the OpenGL Display are user-adjustable, including background color.
- Start a new VMD session. Load the 1ubq.pdb file in the vmd-tutorial-files directory by following the steps in Section 1.1.
- In the VMD Main window, choose Graphics
Colors.... The Color Controls window should show up. Look through the Categories
list. All display colors, for example, the colors of different atoms when
colored by name, are set here.
- Now we will change the background color. In Categories, select Display. In Names, select
Background. Finally, choose 8 white in Colors. Your OpenGL Display now should have a white background.
- When making a figure, we often don't want to include the axes. To turn of the axes, select Display
Off in the VMD Main window.
All VMD objects are drawn with an adjustable resolution, allowing users
to balance fineness of detail with drawing speed.
- Open the Graphical Representation window via Graphics
Representations... in the VMD Main menu. Modify the default representation to show just the protein, and display it using the VDW drawing method.
- Zoom in on one or two of the atoms, either by using the scroll
wheel on your mouse, or by using Mouse
Mode (shortcut s).
- Notice that with the default resolution setting, the
``spherical'' atoms aren't looking very spherical. In the
Graphical Representations window, click on the representation you set
up before for the protein to highlight it in yellow. Try
adjusting the Sphere Resolution setting to something higher,
and see what a difference it can make. (See Fig. 12.)
Many of the drawing methods have a resolution setting. Try a
few different drawing methods and see how you can easily increase their resolutions. When producing images, you can raise the
resolution until it stops making a visible difference.
The effect of the resolution setting.
[Low resolution: Sphere Resolution
set to 8]
[High resolution: Sphere Resolution
set to 28]
- You may have noticed the Material menu in the
Graphical Representations window (which by default is drawn with Opaque material). Choose the protein representation
you made before, and experiment with the different materials in the Material menu.
- Besides the pre-defined materials in the Material menu, VMD also allows users to create their own materials. To make a new material, in the VMD Main window choose Graphics
Materials.... In the Materials window that
appears, you'll see a list of the materials you just tried out, and
their adjustable settings. Click the Create New button. A new material, Material 12 will be created. Give it the following settings:
Example user-defined material.
- Go back to the Graphical Representations window. In the Material menu, you can see that Material 12 is now on the list. Try using Material 12 for a representation and see what it looks like.
Examples of different material settings.
[The default transparent material.]
[A user-defined material.]
- If your computer supports GLSL Render Mode, you can try to reproduce Fig. 13(b). First turn on the GLSL rendering mode by selecting Display
GLSL in the VMD Main window.
- Modify Material 12 to be more transparent by entering the following values in the Materials window:
Example of a more transparent material.
- Hide all of your current representations and create the following two representations:
Example of representations drawn with different materials.
Since the systems we are dealing with are three-dimensional,
VMD has multiple ways of representing the third dimension. In this
section, we will explore how to use VMD to enhance or hide
In perspective mode, things nearer the camera appear larger. Although
perspective projection provides strong size-based visual depth cues, the
displayed image will not preserve scale relationships or parallelism of lines,
and objects very close to the camera may appear distorted.
Orthographic projection preserves scale and parallelism relationships
between objects in the displayed image, but greatly reduces depth perception.
- The first thing to consider is the projection mode. In the
VMD Main window, click the Display menu. Here we can
choose either Perspective or Orthographic in the drop-down menu. Try switching between Perspective and Orthographic projection modes and see
the difference (Fig. 14).
Comparison of perspective and orthographic projection modes.
Another way VMD can represent depth is through the so-called
``depth cueing''. Depth cueing is used to enhance three-dimensional
perception of molecular structures, particularly with orthographic
- Choose Display
Depth Cueing in
the VMD Main window. When depth cueing is enabled, objects
further from the camera are blended into the background. Depth cueing
settings are found in Display
Settings.... Here you can choose the functional dependence of the
shading on distance, as well as some parameters for this function. To see the effect better, you might want to hide the representation with the Surf drawing method.
- Finally, VMD can also produce stereo images. In the VMD
Main window, look at the Display
showing many different choices. Choose SideBySide (remember to return
to Perspective mode for a better result). You should get something like Fig. 15
- Turn off stereo image by selecting Display
Off in the VMD Main window. Also turn off depth cueing by unselecting the Display
Depth Cueing checkbox in
the VMD Main window.
Stereo image of the ubiquitin protein. Shown here with Cue Mode = Linear,
Cue Start = 1.5, and Cue End = 2.75.
By now we've seen some techniques for producing nice views and representations of the molecule loaded in VMD. Now, we'll explore the use of the VMD built-in snapshot feature and external rendering programs to produce high quality images of your molecule. The ``snapshot''
renderer saves the on-screen image in your OpenGL window and is adequate
for use in presentations, movies, and small figures.
When one desires higher quality images, renderers such as Tachyon and POV-Ray are better choices.
- Hide or delete all your previous representations, and create three new representations in the following table:
|protein and not resid 72 to 76
|protein and helix and name CA
|resname GLY and not resid 72 to 76
- Rendering is very simple in VMD. Once you have the scene set the
way you like it in the OpenGL window, simply choose File
the VMD Main window. The File Render Controls
window will appear on your screen.
- The File Render Controls allows you to choose which renderer you want to use and the
file name for your image. For our first try, let's select snapshot for the rendering method, type in a filename of your choice, and click Start Rendering.
- If you are using a Mac or a Linux machine, an image-processing application might open automatically that shows you the molecule you have just rendered using snapshot. If this is not the case, use any image-processing application to take a look at the image file. Close the application when you are done to continue using VMD.
- Try to render again using different rendering method, particularly
TachyonInternal and POV3. Compare the quality of the images created by different renderers.
Example of a POV3 rendering.
- You have learned the basics of VMD. Quit VMD.
Next: Trajectories and Movie Making
Up: VMD Tutorial