Namd Tutorial Unix
Namd Tutorial Unix
NAMD TUTORIAL
Unix/MacOSX Version
April 2017
Contents
1 Basics of NAMD 7
1.1 What is Needed . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 Generating a Protein Structure File (PSF) . . . . . . . . . . . . . 7
1.3 Solvating the Protein . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.3.1 Ubiquitin in a Water Sphere . . . . . . . . . . . . . . . . 12
1.3.2 Ubiquitin in a Water Box . . . . . . . . . . . . . . . . . . 14
1.4 Ubiquitin in a Water Sphere: Simulation with Non-Periodic Bound-
ary Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.4.1 Configuration File . . . . . . . . . . . . . . . . . . . . . . 16
1.4.2 Run your Simulation . . . . . . . . . . . . . . . . . . . . . 24
1.5 Ubiquitin in a Water Box: Simulation with Periodic Boundary
Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.5.1 Configuration File . . . . . . . . . . . . . . . . . . . . . . 25
1.5.2 Run your Simulation . . . . . . . . . . . . . . . . . . . . . 28
1.6 Ubiquitin in Generalized Born Implicit Solvent . . . . . . . . . . 29
1.6.1 Configuration File . . . . . . . . . . . . . . . . . . . . . . 29
1.6.2 Run your Simulation . . . . . . . . . . . . . . . . . . . . . 30
1.7 Output: Water Sphere Log File . . . . . . . . . . . . . . . . . . . 31
1.8 Analysis of Water Sphere Equilibration . . . . . . . . . . . . . . . 33
1.8.1 RMSD for Entire Protein . . . . . . . . . . . . . . . . . . 33
1.8.2 RMSD for Protein without Last 5 Residues . . . . . . . . 37
2 Analysis 39
2.1 Equilibrium . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.1.1 RMSD for individual residues . . . . . . . . . . . . . . . . 39
2.1.2 Maxwell-Boltzmann Energy Distribution . . . . . . . . . . 42
2.1.3 Energies . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
2.1.4 Temperature distribution . . . . . . . . . . . . . . . . . . 47
2.1.5 Specific Heat . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.2 Non-equilibrium . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
2.2.1 Heat Diffusion . . . . . . . . . . . . . . . . . . . . . . . . 55
2.2.2 Temperature echoes . . . . . . . . . . . . . . . . . . . . . 59
4 Acknowledgments 88
A PDB Files 89
B PSF Files 90
C Topology Files 93
Introduction
This tutorial provides a first introduction to NAMD and its basic capabilities.
It can also be used as a refresher course for the non-expert NAMD user.
The tutorial assumes that you already have a working knowledge of VMD
and that NAMD 2.8 or later has been installed correctly on your computer.
For installation instructions, please refer to the NAMD User’s Guide. For the
accompanying VMD tutorial go to
http://www.ks.uiuc.edu/Training/Tutorials/
The tutorial is subdivided in three sections. The first one covers the basic
steps of a molecular dynamics simulation, i.e., preparation, minimization, and
equilibration of your system. The second section introduces typical simulation
techniques and the analysis of equilibrium properties. The last section deals
with Steered Molecular Dynamics and the analysis of unfolding pathways of
proteins. Finally, brief descriptions of all files needed for the simulations are
provided in the appendices.
For a detailed description of NAMD the reader is referred to the NAMD
User’s guide located at
http://www.ks.uiuc.edu/Research/namd/current/ug/
The examples in the tutorial will focus on the study of ubiquitin – a small
protein with interesting properties. Throughout the text, some material will
be presented in separate “boxes". Some of these boxes include complementary
information to the tutorial, such as information about the biological role of
ubiquitin, and tips or shortcuts for using NAMD. These boxes are not required
for understanding the tutorial and may be skipped if you are short on time.
Boxes with an exclamation sign are especially important and should not be
skipped.
Warning! The goal of this tutorial is to introduce NAMD by per-
forming some short molecular dynamics simulations. Therefore, the
examples provided are optimized so simulations can be done in a rea-
sonable period of time on a common computing facility. This means
that some parameters and conditions under which simulations are
done in this tutorial are not suitable for scientific studies. Whenever
this happens it will be pointed out and alternatives or more ap-
propriate parameters/conditions will be provided in case you want
to improve the simulations and/or you have more computer power
available.
Required programs
The following programs are required for this tutorial:
• Text Editor: Nedit is a text editor which will be used throughout this
tutorial to view and edit some of the files associated with the simulations.
There are others such as pico, emacs, jot, and vi. Feel free to use whichever
text editor you are most comfortable with.
• Plotting Program: We will use the free program xmgrace, available at
http://plasma-gate.weizmann.ac.il/Grace/, to view and analyze out-
put data from NAMD simulations. VMD also has an internal plotting pro-
gram which may be used to examine output directly from NAMD log files.
Other useful graphing programs are Mathematica, http://www.wolfram.com/
(Purchase required), Matlab, http://www.mathworks.com/ (Purchase re-
quired), and gnuplot, http://www.gnuplot.info/ (Free download).
Getting Started
• If you are performing this tutorial at a Computational Biophysics Work-
shop offered by the Theoretical and Computational Biophysics Group, a
copy of the files needed for this tutorial have been set up for you. The
files exist in the directory called Workshop in your home directory. In a
Terminal window type:
cd ~/Workshop/namd-tutorial/namd-tutorial-files
This will place you in the directory containing all the necessary files.
• If you have downloaded this tutorial at home, you will also need to down-
load the appropriate files, unzip them, and place them in a directory of
your choosing. You should then navigate to that directory in a similar
manner as described directly above. The files for this tutorial are avail-
able at http://www.ks.uiuc.edu/Training/Tutorials/.
CONTENTS 6
Mac Users. If you have downloaded this tutorial and are not working
at a Computational Biophysics Workshop, Mac-specific instructions are
provided for you in these boxes. These instructions relate to starting
VMD. The tutorial instructs users to start VMD via the command line,
but this is only possible on a Mac if the user has set up “aliases" be-
forehand. Thus, to avoid changing system settings, we recommend you
simply follow the instructions in these boxes instead. However, if you
are able to set up command line aliases on your computer to launch
VMD, you may do so and then ignore these boxes.
Figure 1: Directory Structure for tutorial exercises. Output for all simulations
is provided in an “example-output” subdirectory within each folder shown.
1 BASICS OF NAMD 7
1 Basics of NAMD
In this section you will learn how to use NAMD to set up basic molecular dy-
namics (MD) simulations. You will learn about typical NAMD input and output
files, in particular, those for protein energy minimization and equilibration in
water.
NOTE: You will be generating output data in this section by performing
simulations and using other features of NAMD. These files are needed for Units
2 and 3. If you are not able to produce the output, correct versions have been
provided for each section and may be found in the example-output folder inside
the directory corresponding to the given simulation or exercise.
• a configuration file, in which the user specifies all the options that NAMD
should adopt in running a simulation. The configuration file tells NAMD
how the simulation is to be run. More in Appendix E.
Force Field Topology File. Later, you will make a psf file for your
system. In doing so, a force field topology file is necessary. This file
contains information on atom types, charges, and how the atoms
are connected in a molecule. Note that the pdb file contains only
coordinates, but not connectivity information! More in Appendix C.
Notice that the latest release (c31b1) also contains the updated CMAP cor-
rection, used in this tutorial. The psf file must be created by the user from
the initial pdb and topology files. The NAMD configuration file is also created
by the user, with commands based on the specific requirements for the MD
simulation.
First, you will remove the water molecules from 1UBQ.pdb, and create a pdb
file of the protein alone.
cd ~/Workshop/namd-tutorial/namd-tutorial-files
3 Load 1UBQ.pdb by clicking File → New Molecule... menu item in the VMD
Main window. In the Molecule File Browser use the Browse... button to
find the file 1UBQ.pdb. Load it by pressing the Load button.
Note that the X-ray structure from the Protein Data Bank does not contain
the hydrogen atoms of ubiquitin. This is because X-ray crystallography usually
cannot resolve hydrogen atoms. The pdb file you will generate with psfgen
along with the psf will contain guessed coordinates for hydrogen atoms of the
structure. Later, energy minimization of the protein will ensure their positions
are reasonable.
1 BASICS OF NAMD 9
4 Choose the Extensions → Tk Console menu item and in the VMD TkCon
window. Be sure you are in the 1-1-build directory. If you are not,
navigate there using the ls command to list files and directories and the
cd command to change directories. Then, type the following commands:
set ubq [atomselect top protein]
$ubq writepdb ubqp.pdb
(Hit the Return key after each command.)
In the previous step you have created the file ubqp.pdb, which contains the
coordinates of the ubiquitin alone without hydrogens, in the 1-1-build direc-
tory.
6 Now, you will create the psf file of ubiquitin. Note that VMD offers an
automatic psf file builder via the VMD Main menu by clicking Extensions
→ Modeling → Automatic PSF Builder. We will create the psf file manually
to teach you exactly how it is done. The psfgen package of VMD is very
useful in this regard. In order to create a psf, you will first make a pgn
file, which will be the target of psfgen.
In a Terminal window type nedit to open the text editor. Type in the
following lines:
package require psfgen
topology top_all27_prot_lipid.inp
pdbalias residue HIS HSE
pdbalias atom ILE CD1 CD
segment U {pdb ubqp.pdb}
coordpdb ubqp.pdb U
guesscoord
writepdb ubq.pdb
writepsf ubq.psf
1 BASICS OF NAMD 10
7 After typing this, save the file by clicking File → Save. Be sure that you
are in the 1-1-build directory and enter the file name as ubq.pgn. Quit
the text editor by clicking File → Exit.
The file you just created contains the necessary commands to create the psf
file of ubiquitin with hydrogen atoms and without water. Each command of the
pgn file is explained:
• Line 1: You will be running psfgen within VMD. This line requires that
the psfgen package is available to be called by VMD.
• Line 2: Load the topology file top_all27_prot_lipid.inp
• Line 3: Change the residue name of histidine to the proper name found
in the topology file. HSE is one of three names for histidine, based on the
protonation state of its side group. See the science box below for more
information.
Launch VMD in text mode. Open VMD in text mode and run the
package psfgen on the file ubq.pgn by typing the following command
in a Terminal window in the 1-1-build directory:
/Applications/VMD\ <version>.app/Contents/vmd/vmd_MACOSX
-dispdev text -e ubq.pgn
In your screen you will see different messages. Warnings are related to the ends
of your molecule and are normal. Your system should have 1231 atoms and 631
with guessed coordinates.
Having run psfgen, two new files will now appear in your 1-1-build directory:
ubq.pdb and ubq.psf. Check this by typing ls in a Terminal. You have created
the psf! You may want to inspect ubq.pdb using nedit .
Figure 2: Flowchart indicating the role of files as used by VMD, NAMD, and
psfgen.
Launch VMD in text mode. Open VMD in text mode and run the
script wat_sphere.tcl by typing the following command in a Terminal
window in the 1-1-build directory:
2 The output of the wat_sphere.tcl script will be the center and ra-
dius of the water sphere. Record these numbers. You will need them
later. The script will have created the pdb and psf files ubq_ws.pdb and
ubq_ws.psf, respectively, of ubiquitin in a water sphere. They will be in
your 1-1-build directory. Check this by typing ls .
4 Launch the graphical version of VMD by typing vmd in the Terminal win-
dow.
We will check the appearance of the immersed molecule by loading the molecule
with both structural and coordinate information.
6 Load the coordinates into the PSF file. Make sure the Load files for: field
in the Molecule File Browser says ubq_ws.psf. Then, click Browse. . ., find
the file ubq_ws.pdb, and load it by pressing the Load button.
1 BASICS OF NAMD 14
You should be able to see your ubiquitin molecule in the center of a beautiful
sphere of water. Changing the representations in VMD will enable you to see it
better.
7 Delete your ubiquitin molecule in a water sphere using the VMD Main
window by clicking on ubq_ws.psf in the window, and selecting Molecule
→ Delete Molecule.
The package require solvate command loads the solvate package, so that
VMD will be able to call it.
The solvate package will put your protein (described in ubq.psf and ubq.pdb)
in a box of water. The -t option creates the water box dimensions such that
there is a layer of water 5Å in each direction from the atom with the largest
coordinate in that direction. The -o option creates the output files ubq_wb.pdb
and ubq_wb.psf for ubiquitin with the water box. You will also obtain the files
combine.pdb and combine.psf which may be eliminated. They are intermedi-
ate files used by the solvate program to transport information into VMD.
Size of Water Box. The water box created is somewhat small for
this study, especially considering that you will pull and unravel the
protein in Unit 3 of this tutorial. Ideally, one should work with a
box which is large enough that the protein does not interact with
its image in the next cell if periodic boundary conditions are used.
Periodic boundary conditions will be explained in section 1.5. Fur-
thermore, if the protein is being pulled, the box should be large
enough that the water will still significantly immerse the protein
when it is fully extended.
2 In the VMD Main window, click File → New Molecule. In the Molecule
File Browser use the Browse... button to find the file ubq_wb.psf. Load
1 BASICS OF NAMD 15
it by pressing the Load button. This will load the structural information
into VMD.
3 In the same Molecule File Browser, browse for ubq_wb.pdb and load it. In
the display, check if the water box surrounds ubiquitin, and demonstrate
to yourself that the hydrogen atoms now exist.
5 These values are defined relative to the origin of the coordinate system,
set by the initial pdb file, 1UBQ.pdb. The center of the water box may be
determined by calculating the midpoint of each of the three sides in the
coordinate system. For example, if minimum and maximum values of x
are returned as 10.44 and 51.12, respectively, x-coordinate of the center
of the box would be 51.12+10.44
2 = 30.78. Alternatively, one can use tcl
scripting in VMD to find the center of the box by typing
measure center $everyone
in the VMD TkCon window. Determine the coordinates of the center of
your water box and record these numbers.
Figure 3: Ubiquitin in a water box and in a water sphere. Hydrogen atoms are
colored black for contrast.
Now that you have the pdb and psf files for solvated ubiquitin, along with the
parameter file for proteins in general, you only need a NAMD configuration file
1 BASICS OF NAMD 16
7 Before beginning the next section, you must copy the necessary pdb and
psf files into your common folder. We will store the files there so we have
a single directory from which to access them, and so that we do not need
to keep multiple copies of them. In a Terminal window, type cp ubq.pdb
ubq.psf ubq_w* ../common/ and hit Enter. Then, type ls ../common/
to see which files you have copied.
All output files for the minimization and equilibration of your ubiquitin in a
water sphere system will be placed in this directory. The configuration file is the
only input file placed here, since it is particular to this simulation. The pdb, psf,
and parameter files, which may be used by many other simulations, are placed
in your common directory and are called by each respective configuration file.
The configuration file may seem complex at first, but it will be examined line
by line to determine its function in your simulation.
Note that when “#" appears at the beginning of a line, the entire line is treated
as a comment and ignored by NAMD. In the middle of a line, “;#" is used to
comment out the remainder of the line.
3 The “Job Description" section contains only comments, and its purpose
is to inform those who view the configuration file about what it is meant
for. Your comment should read
# Minimization and Equilibration of
# Ubiquitin in a Water Sphere
• Input
1 BASICS OF NAMD 18
Figure 4: Number labels for atoms which are a given amount of bonds away
from one another
Figure 5: Cutoff and switching distances indicated on the left. Pair list distance
indicated on the right.
• Integrator Parameters
– timestep: indicates the value of the time step size used in the
simulation. MD simulations solve Newton’s laws in a discrete
approximation to determine the trajectories of atoms. The time
step tells NAMD how to discretize the particle dynamics. It is
specified in femtoseconds (here, 2 fs).
– rigidBonds: specifies which bonds involving hydrogen are con-
sidered to be rigid (non-vibrating). The value all specifies all
1 BASICS OF NAMD 20
Here, two additional terms on the right hand side accompany the
ordinary force the particle experiences. The second term represents
a frictional damping that is applied to the particle with frictional
coefficient γi mi . The third term represents random forces which
act on the particle (as a result of solvent interaction). These two
terms are used to maintain particle kinetic energy to keep system
temperature, for instance, at a constant value. Because an unnec-
essarily high damping constant can significantly slow the system’s
dynamics, one should always find the minimum langevinDamping
coefficient sufficient to maintain the temperature. A value of 1.0 is
often a good starting point.
7 The “Execution Script" section contains three commands, the first two of
which apply to minimization and the last one of which applies to equili-
bration.
• Minimization
– minimize: sets the number of iterations over which to vary atom
positions to search for a local minimum in the potential (in this
case 100).
– reinitvels: Minimization is performed on the system after all
atomic velocities have been set to zero. This command resets
1 BASICS OF NAMD 24
Setting the Path. In order to run namd2, you can provide the full
path to the binary executable (e.g., /home/me/installed/namd2)
or you can add the directory to your PATH environment variable (e.g.,
for bash you would export PATH=/home/me/installed:$PATH).
An even better approach might be to create a namd2 alias that
specifies the number of cores you plan to use for your simula-
tions. For example, setting up a namd2 alias (again using bash)
to run NAMD on four cores of your workstation, you would spec-
ify alias namd2="/home/me/installed/namd2 +p4". The most
common Linux distributions as well as Mac OS X default to using
bash (Bourne again shell) for command line access.
Your simulation should take about 20 minutes to complete, and NAMD will
produce the output files described in Section 1.7.
1 BASICS OF NAMD 25
The configuration file contains some commands which are different than the
water sphere configuration file. Here, these differences are pointed out and
explained.
3 The only differences in this file lie in the “Simulation Parameters" section,
where three new categories of parameters have been added. The “Output"
section has also been modified. The new commands are listed:
• Periodic Boundary Conditions
– Three periodic cell basis vectors are to be specified to give the
periodic cell its shape and size. They are cellBasisVector1,
cellBasisVector2, and cellBasisVector3. In this file, each
vector is perpendicular to the other two, as indicated by a single
x, y, or z value being specified by each. For instance, cellBasisVector1
is x = 42Å, y = 0Å, z = 0Å. With each vector perpendicular, a
rectangular 3-D box is formed.
– cellOrigin: specifies the coordinates of the center of the peri-
odic cell in Å. This is why you need to calculate the center of
your water box after you solvate!
– wrapWater: This command may be used with periodic boundary
conditions. If a water molecule crosses the periodic boundary,
leaving the cell, setting this command to on will translate its
coordinates to the mirror point on the opposite side of the cell.
Nothing can escape. The command may be set to on or off.
1 BASICS OF NAMD 26
Note that the commands which specify spherical boundary conditions have
been completely removed, since this simulation is using periodic boundary con-
ditions.
1 BASICS OF NAMD 28
4 A few additional commands are required for implicit solvent use. The new
commands are listed:
Your implicit solvent simulations should take roughly the same time as the
water sphere simulation. The simulation will produce output files similar to the
ubiquitin in water sphere simulation, which are discussed in Section 1.7.
1 BASICS OF NAMD 31
• ubq_ws_eq.log
• ubq_ws_eq.coor
• ubq_ws_eq.vel
• ubq_ws_eq.xsc
• ubq_ws_eq.dcd
• ubq_ws_eq.restart.coor
• ubq_ws_eq.restart.vel
• ubq_ws_eq.restart.xsc
• ubq_ws_eq.restart.coor.old
• ubq_ws_eq.restart.vel.old
• ubq_ws_eq.restart.xsc.old
Seven of the output files contain binary data so that coordinate and velocity
information may be kept to high precision. The files which are not in binary
code are:
* ubq_ws_eq.log, the log file. It is here that the energy of the various force
field interactions is stored. The log file stores a lot of information and it
will be examined.
2 The first section of the log file, indicated by the Info tag, contains the
parameters used to run the simulation, and other useful information about
the system, such as the number of atoms, the type and number of bonds,
the total mass, and the total charge.
1 BASICS OF NAMD 32
3 After the first section, information about the minimization of the system
is displayed beginning with the line labeled TCL. This line states how long
the minimization lasts.
4 After that, the pressure of the system is given. For the present simulation,
no pressure output is given because NAMD does not define the pressure
for a non-periodic system. For your simulation using periodic boundary
conditions, you will see values for the pressure.
5 The next part gives a listing of energies of interaction, first defining which
are listed with ETITLE, then listing the actual values in kcal/mol every
time step next to ENERGY. (The time step (TS) value is a count of the
number of timesteps NAMD has performed and is not in units of time,
and the temperature (TEMP) value is in K.)
6 The values listed for INITIAL STEP and GRADIENT TOLERANCE are mathe-
matical parameters corresponding to the numerical search for a minimum
in the potential. GRADIENT TOLERANCE will decrease over the course of the
minimization and may be used to roughly judge the extent of minimiza-
tion. See Figure 6.
7 After minimization, equilibration data are presented in the log file. See
Figure 7. The first lines shown in the figure confirm that NAMD is writing
the proper information at the proper time step, which you have specified
in the configuration file. The following space is where pressures would
normally be written. Note that since they are not pressures here, this
1 BASICS OF NAMD 33
space is used to store the total time step of the simulation. Energies at
that time step are then fully reported. In this case, they are output every
100 time steps, as specified in the configuration file.
8 The end of the file confirms that the final frame of the simulation is being
recorded, and provides computational data which may be used to bench-
mark your run should you wish to change parameters, run on another
computer, etc.
The log file for your simulation of ubiquitin in a water box is quite similar to
the one described above with the exception of pressure output, as described.
See Appendix F for more information on log files.
the protein over the course of the equilibration. The simulation was performed
in a so-called NVT ensemble in which the number of particles, N, the volume,
V, and the temperature, T, are kept constant.
VMD includes many analysis tools. One of these, the NAMD Plot plugin, may
be used to plot output from NAMD log files. This VMD plugin uses the program
namdplot, which gets the relevant data from the log files for values of energies,
temperature, etc. over time. VMD then uses an internal plotting program to
plot the data for you.
3 In the NAMD Plot window, select File → Select NAMD Log File, select the
file ubq_ws_eq.log and click Open.
4 All the thermodynamic variables from the NAMD log file are available
for plotting as shown in the VMD NAMD Plot window. TS stands for
time step, BOND for bond energy, and so forth. Click the box marked
TEMP and then select File → Plot Selected Data. This will get all the
temperature data from the log file and plot it over time.
5 Try using NAMD Plot for TOTAL (total energy). You should see the vari-
able converging to an average value for an equilibrated system.
The thermodynamic variables that you checked above tell you about the ther-
modynamic state of the whole system. But you would also like to know if your
protein is conformationally stable. For this, you will calculate the RMSD of the
protein backbone. This will give you an idea of the stability of the protein. If
the RMSD is still increasing at the end of the run, it means your protein is still
searching for a lower energy state, and thus is not yet equilibrated!
6 When you are finished examining the plots, close the Multiplot window.
1 BASICS OF NAMD 35
Note that the RMSD for your protein will change over time. Also,
note the script you are using takes the first time step of the simu-
lation as a reference, rather than using an average value.
• Get the number of frames in the trajectory and assign this value to
the variable nf
set nf [molinfo top get numframes]
• Select the first frame of the molecule to be the one other frames will
compare to. The selection contains the atoms in the backbone of the
protein, excluding hydrogens:
set frame0 [atomselect top "protein and backbone and noh" frame 0]
• Make the same selection as before for an undetermined frame.
set sel [atomselect top "protein and backbone and noh"]
• Text after # denotes comment.
# rmsd calculation loop
• Loop over all frames in the trajectory:
for { set i 1 } { $i <= $nf } { incr i } {
• Change the selection $sel to the frame to be compared.
$sel frame $i
• Calculate the matrix that will fit both selections. Apply this matrix
to the second selection to align the molecules:
$sel move [measure fit $sel $frame0]
• Calculate the RMSD value between these two selections, and write
it to file:
puts $outfile "[measure rmsd $sel $frame0]"
You can use the script for the system to test for equilibration.
Outside of VMD, you can use a plotting program to see this data. Examples
of these are gnuplot, xmgrace, Microsoft Excel, Mathematica, and scilab.
12 Use xmgrace to plot the file rmsd.dat. In the Terminal window, type
xmgrace rmsd.dat.
The curve does not reveal very much information because of short runtime and
infrequent writing of the dcd file. Figure 8 shows a more typical RMSD plot
for an equilibrated system along with the plot you have generated. Can you see
the first RMSD curve flattening? This means the system is equilibrated.
1 BASICS OF NAMD 37
Figure 8: RMSD versus simulation time for a system equilibrating with a longer
run time (left) and your system (right)
1 You can easily modify the rmsd.tcl to plot the RMSD for the protein
without the last five residues. Exit xmgrace by clicking File → Exit in the
program window. Create an identical file to rmsd.tcl with a new name
by typing cp rmsd.tcl rmsd_5.tcl in the Terminal window.
2 Open the new file rmsd_5.tcl using nedit by typing nedit rmsd_5.tcl
in the Terminal window.
4 Save the file and exit nedit by clicking File → Save and then clicking File
→ Exit.
5 Type source rmsd_5.tcl in the TkCon window of VMD. This will per-
form all the commands in the script. The script will write a file rmsd_5.dat
that will contain the value of the RMSD of the protein backbone against
time without the last five residues.
6 Use xmgrace to plot the file rmsd_5.dat in the same manner as before
with file rmsd.dat.
xmgrace rmsd_5.dat
8 Delete the current displayed molecule in VMD using the VMD Main win-
dow by clicking on ubq_ws.psf in the window, and selecting Molecule →
Delete Molecule.
2 ANALYSIS 39
2 Analysis
This unit presents a series of examples of how to analyze data produced from
NAMD simulations. For these examples you will not run the simulations them-
selves; instead you will analyze already produced data. Nevertheless, the in-
structions to set up and run the simulations are included, so you can actually
produce the data yourself if time permits.
The steps that must be followed for the analysis are marked with an aster-
isk (*). Make sure to go through these steps. We encourage you to at least
read the other steps, so you can refer to them later when setting up future
simulations. The exercises will have detailed explanations of methods used. We
encourage, however, that you be bold and try your own way to do the analysis.
2.1 Equilibrium
This section contains exercises that will let you analyze properties of a sys-
tem in equilibrium. The exercises mostly use pre-equilibrated trajectories from
different ensembles to calculate properties of the ubiquitin system.
You will use a script within VMD that will allow you to compute the average
RMSD of each residue in your protein, and assign this value to the User field
for each residue.
The VMD User Field. VMD stores a set of data under the field
“User" for each atom in a molecule for each timestep. One can use
this field to store any numerical values one wishes. VMD’s “User"
coloring mode, which you will soon use, will color atoms according
to their User values, making the desired property stand out from
atom to atom and over the course of a simulation. This is very
useful when you want to show a property of the system that you
have computed yourself.
Properties may be stored in any field that VMD associates with
atoms, such as the Beta and Occupancy fields, which correspond to
the B and O fields of a PDB file, but these two fields do not have
the flexibility to change their values over time (and may actually
contain pertinent PDB information!) like the User field can.
In the previous unit, you had VMD open with the equilibration trajectory of
the ubiquitin periodic system loaded. You will repeat this process:
2 ANALYSIS 40
* 2 Load the structure file. First, open the Molecule File Browser from
the File → New Molecule. . . menu item. Browse for and Load the file
ubq_wb.psf in the directory common. (Click ../ to go up one directory.)
* 3 The menu at the top of the Molecule File Browser window should now show
2: ubq_wb.psf. This ensures that the next file that you load will be added
to that molecule (molecule ID 2). Now, browse for the file ubq_wb_eq.dcd
located in the directory 1-3-box/ and click on Load again. You can close
the Molecule File Browser window.
* 5 The script you will use is called residue_rmsd.tcl. In the TkCon win-
dow, type:
source residue_rmsd.tcl
This command itself does not actually perform any calculations. It reads the
script residue_rmsd.tcl which contains a procedure called rmsd_residue_over_time.
Calling this procedure will calculate the average RMSD for each residue you se-
lect over all the frames in a trajectory. The procedure is called as:
where <mol> is the molecule in VMD that you select (if not specified, defaults
to the top molecule), and <sel_resid> is a list of the residue numbers in that
selection. The procedure employs the equations for RMSD shown in Unit 1.
* 6 For this example, you will select all the residues in the protein. The list
of residue numbers can be obtained by typing in the TkCon window:
set sel_resid [[atomselect top "protein and alpha"] get resid]
The above command will get the residue numbers of all the α-carbons in
the protein. Since there is just one and only one α-carbon per residue, it
is a good option. The command will create a list of residue numbers in
the variable $sel_resid.
* 7 Call the procedure to calculate the RMSD values of all atoms in the newly
created selection:
rmsd_residue_over_time top $sel_resid
You should see the molecule wiggle as each frame gets aligned to the initial
structure (This may happen very fast in some machines). At the end of
the calculation, you will get a list of the average RMSD per residue. This
data is also printed to the file residue_rmsd.dat.
The procedure also sets the value of the User field of all the atoms of the
residues in the selection to the computed RMSD value. You will now color the
2 ANALYSIS 41
protein according to this value. You will be able to recognize which residues are
free to move more and which ones move less during the equilibration.
In order to use these new values to learn about the mobility of the residues, you
will create a representation of the protein colored by User value.
* 8 Open the Representations window using the Graphics → Representations. . .
menu item.
* 9 In the Atom Selection window, type protein. Choose Tube as Drawing
Method, and in the Coloring Method drop-down menu, choose submenu
Trajectory, then User, and again User. Now, click on the Trajectory tab,
and in the Color Scale Data Range, type 0.40 and 1.00. Click the Set
button.
You should now see the protein colored according to average RMSD values.
The residues displayed in blue are more mobile while the ones in red move less.
This is somewhat counterintuitive, so you will change the color scale.
* 10 Choose the Graphics → Colors. . . menu item. Choose the Color Scale tab.
In the Method pull-down menu, choose BGR. Your figure should now look
similar to Fig. 9.
Figure 9: Ubiquitin colored by the average RMSD per residue. Red denotes
more mobile residues, and blue denotes residues which moved less during equi-
libration.
* 11 Plot the RMSD value per residue by typing in a Terminal window (make
sure you are in the directory 2-1-rmsd/):
xmgrace residue_rmsd.dat
2 ANALYSIS 42
Take a look at the RMSD distribution. You can see regions where a set of
residues shows less mobility. Compare with the structural feature of your pro-
tein. You will find a correlation between the location of these regions and
secondary structure features like α helices or β sheets.
* 12 When you are finished investigating the plot, close xmgrace, saving your
plot if you wish.
* 13 Delete the current displayed molecule in VMD using the VMD Main win-
dow by clicking on ubq_wb.psf in the window, and selecting Molecule →
Delete Molecule.
5 First, you will create a selection with all the atoms in the system. Do this
by typing in the TkCon window:
set all [atomselect top all]
7 For each atom in the system, calculate the kinetic energy k = 12 mv 2 , and
write it to a file
foreach m [$all get mass] v [$all get {x y z}] {
puts $fil [expr 0.5 * $m * [vecdot $v $v] ]
}
* 11 If you chose not to go through the steps above, there is a VMD script
that reproduces them and will create the file energy.dat. In a Terminal
Window, type:
vmd -dispdev text -e get_energy.tcl
This will run VMD in text mode, source the script get_energy.tcl, and
produce the energy.dat file. When it is finished, type exit to exit VMD.
You now have a file of raw data that you can use to fit the obtained energy
distribution to the Maxwell-Boltzmann distribution. You can obtain the tem-
perature of the distribution from that fit. In the rest of this section, we will
show how to do this with the 2-D graphics package xmgrace. If you are more
familiar with another tool, you may use it instead.
* 12 Quit VMD.
2 ANALYSIS 44
* 14 Once you see the xmgrace window, choose the Data → Import → ASCII
menu item. In the Files box, select the file energy.dat. Click on the OK
button. You should see a black trace. This is the raw data. You can now
close the Read sets window.
* 17 Fill in Start: 0, Stop at: 10, and # of bins: 100. Click Apply.
* 18 You have created a plot, but you cannot see it yet. Use the right button of
your mouse to click on the first set (in the Source → Set window). Click
on Hide. Now, go to the main Grace window and click on the button
labeled AS, that will resize the plot to fit the existing values. This is your
distribution of energies.
Now, you will fit a Maxwell-Boltzmann distribution to this plot and find out the
temperature that the distribution corresponds to. (Hopefully, the temperature
you wanted to have in your simulation!)
* 22 Click on the Apply button. This will open a window with the new value
for a0, as well as some statistical measures, including the Correlation
Coefficient, which is a measure of the fit (better fit as it approaches
1). You can click on the Apply button of the Non-linear fit window several
times to obtain a better fit.
The deviation from your value and the expected one is due to the poor sampling
as well as to the finite size of the protein; the latter implies that temperature
can be “measured” only with an accuracy of about ±10K even in case of perfect
sampling.
* 24 When you are finished investigating the histogram and fit, close xmgrace,
saving your work if you wish.
2 ANALYSIS 46
2.1.3 Energies
You will look at the kinetic energy and all internal energies: bonded (bonds,
angles and dihedrals) and non-bonded (electrostatic, van der Waals) over the
course of the water box simulation which you ran in the previous unit. This
section will introduce you to a tcl script called namdstats.tcl which is very
useful for calculating average energy data for a simulation or extracting energy
data over time.
BOND: 232.561128
ANGLE: 690.805988
DIHED: 397.649676
IMPRP: 41.250136
ELECT: -23674.863868
VDW: 1541.108344
BOUNDARY: 0.0
MISC: 0.0
KINETIC: 4579.147764
TOTAL: -16192.340832
TEMP: 313.429264
TOTAL2: -16173.821268
TOTAL3: -16174.663916
TEMPAVG: 313.140436
PRESSURE: -47.513352
GPRESSURE: -19.105588
VOLUME: 71087.006196
PRESSAVG: 3.340104
GPRESSAVG: 3.4207
• The simulation takes the restart files from the sphere equilibration simula-
tion performed in Unit 1. The files are located in directory 1-2-sphere/
and are named ubq_ws, i.e., ubq_ws.restart.vel, etc.
2 ANALYSIS 49
* 3 If you do not run the simulation yourself, you will need to obtain the data
for the temperature from the provided log file. Copy this log file from the
directory example-output/.
cp example-output/ubq-nve.log .
If you run the simulation yourself, your log file will be generated by
NAMD, and you do not need to copy it.
* 5 In order to obtain the data for the temperature from the log file we will
again use the script namdstats.tcl, which we have already sourced. Do
this by typing:
data_time TEMP ubq-nve.log
Each timestep and the corresponding temperature of the system is now in
the file TEMP.dat. The script will include all timesteps and it may take
some time to finish. Note there is no minimization of the system since
this was already performed in the initial simulation.
* 6 Open xmgrace.
* 7 Choose the Data → Import → ASCII menu item. Select the file TEMP.dat
You should see a black trace. This is a plot of the temperature over time.
* 8 To look at the distribution of points, you will make a histogram with this
data. Choose the Data → Transformations → Histograms. . . menu item.
In the Source → Set window, click on the first line, in order to make a
histogram of the data you just loaded.
2 ANALYSIS 50
* 9 Click on the Normalize option, and fill in Start: 300, Stop at: 330, and #
of bins 100. Click Apply.
* 10 You created a plot, but you cannot see it yet. Use the right button of
your mouse to click on the first set (in the Source → Set window). Click
on Hide. Now, go to the Main window and click on the button labeled AS,
that will resize the plot to fit the existing values. This is your distribution
of temperatures.
Does this distribution look any familiar? Your distribution should look like a
Gaussian distribution.
Note that for N → ∞ the distribution is very sharp, but for a finite
system it is always broad. For T = 300K and N = 1000 one has
σ∼8K.
* 11 You will now fit your distribution to a normal distribution. For this, you
will use the Non-linear curve fitting feature of xmgrace.
This will fit the curve and get values for the parameters a0, a1 and a2, where
a0 is a normalization constant, a1 the average temperature, and a2 is σ 2 .
The window that appeared contains the new value of the parameters, as well
as some statistical measures, including the Correlation Coefficient, which
is a measure of the fit.
Take home message: You may note from this example that single proteins,
on one hand, behave like infinite thermodynamic ensembles, reproducing the
respective mean temperature. On the other hand, they show signs of their
finiteness in the form of temperature fluctuations. In general, it is interesting
to note that the velocities of the atoms and, therefore, the kinetic energy of the
protein serves as its thermometer!
* 17 When you are finished investigating the histogram and fit, close xmgrace,
saving your work if you wish.
hE 2 i − hEi2
cV =
kB T 2
For this exercise, you need to carry out a long simulation in the NVT (canonical)
ensemble that samples sufficiently the averages hE 2 i and hEi that arise in the
definition of cV . To produce the data for the total energy of the molecule over
time, you need to work through the steps presented below. This exercise is long
and computationally intensive. You may wish to work only through the steps
marked with *, that correspond to the analysis of the data. Nevertheless, we
encourage you to read through the whole section since it will provide you with
tools for future analysis.
* 1 In a Terminal windows, change to the directory 2-5-spec-heat/.
In order to produce an NVT run, you will restart the equilibration you per-
formed in Unit 1 for the water sphere. All necessary files are present in your
directory.
2 Run the Molecular Dynamics simulation
* 3 If you do not run the simulation yourself, you will need to obtain the
trajectory that has been provided. Copy the simulation output from the
directory example-output/ by typing in a Terminal window:
cp example-output/ubq-nvt* .
If you run the simulation yourself, your output will be generated by
NAMD, and you do not need to copy it.
You now have an equilibration run of ubiquitin in the NVT ensemble, and you
want to look at the fluctuation in the energy of ubiquitin. In order to calculate
the specific heat for the protein only (as opposed to the whole system), you
need the total energies for the atoms in the protein only, however the NAMD
output for the run you just performed contains the energies for all atoms in the
system.
You would like NAMD to write the energies for only a part of the system, rather
than for the entire system, as is reported in the log file. One way to do this is
to run a separate simulation with only the part of the system you are interested
in, but this may be unrealistic from a biological standpoint. Fortunately, VMD
has a plugin which will call NAMD and allow you to calculate energies for any
part of your system that you specify.
* 5 If you did not run the simulation, and copied output from the
example-output directory, please skip this step. If you ran the
simulation yourself, perform this step and skip the next one.
Load the psf file and trajectory for your system.
mol new ../common/ubq_ws.psf
mol addfile ubq-nvt.dcd
* 6 Load the psf file and trajectory for the example-output system.
mol new ../common/example-output/ubq_ws.psf
mol addfile ubq-nvt.dcd
* 7 In the VMD Main window, open the NAMD Energy plugin by clicking
Extensions → Analysis → NAMD Energy.
• Molecule: ubq_ws.psf
• Selection 1: protein
• Energy Type: ALL
• Output File: myenergy.dat
• Parameter Files: ../common/par_all27_prot_lipid.inp
All other parameters are chosen by default and are consistent with the
specifications of your simulation. For more information on NAMD En-
ergy’s options, click Help → Help...
Now you have a file called myenergy.dat which contains the energy of only
the ubiquitin protein atoms in your system. In order to calculate the specific
heat of the molecule, we must derive both the average and squared-average total
energy of the molecule from this data. We will use a tcl script to do so.
* 10 In the VMD TkCon window, source the script to calculate the average
total energy of ubiquitin for your simulation:
source average.tcl
The script will search your output file for the total energy data for the system,
calculate both the average and squared-average total energy over all timesteps,
and output the values for you. You should become familiar with the script to
fully utilize the power of Tcl scripting in analyzing NAMD output. This script
will teach you how to read input files, extract data from them, and perform
calculations on that data.
2 ANALYSIS 55
* 11 Calculate the specific heat for ubiquitin using the equation provided in the
Energy fluctuations and specific heat box at the beginning of this
kcal
section. Consider kB = 0.00198657 molK and T = 310K. What is your
result? Try to convert your results to units of specific heat used everyday,
i.e., J/(kg˚C) using the conversion factor 1 J = 1.43846 × 1020 kcal/mol.
Note that this units correspond to the specific heat per unit mass. You
calculated the fluctuation in the energy of the whole protein, so you must
take into account the mass of your protein by dividing your obtained value
by m = 1.4219×10−23 kg. Compare with some specific heats that are given
to you in Table 2.
* 12 Delete the current displayed molecule in VMD using the VMD Main win-
dow by clicking on ubq_ws.psf in the window, and selecting Molecule →
Delete Molecule.
2.2 Non-equilibrium
In this section, you will analyze two non-equilibrium properties of proteins,
the diffusion of heat and a phenomenon known as temperature echoes. This
section requires some knowledge of the principles of statistical physics, but the
results of the simulations can be understood intuitively even without a deep
understanding of their principles.
For this exercise, you will use the last step of the equilibration of ubiquitin
in a water sphere, file ubq_ws_eq.restart.coor. You will use the temperature
coupling feature of NAMD to set the temperature of the molecules in the outer
layer of the sphere to 200 K, while the rest of the bubble is set to a temperature
of 300 K. In this way, you will determine the thermal diffusivity by monitoring
change of the system’s temperature and comparing it to the theoretical expres-
sion.
Heat diffusion. Time dependence of the local temperature T (~r, t)
is governed by the heat diffusion equation
∂T (~r, t)
= D∇2 T (~r, t),
∂t
subject to the initial and boundary conditions, which for a sphere of
radius R are
In order to use the temperature coupling feature of NAMD, you need to create
a file which marks the atoms subject to the temperature coupling. The following
lines
tCouple on
tCoupleTemp 200
tCoupleFile ubq_shell.pdb
tCoupleCol B
in the provided configuration file ubq_cooling.conf will enable this feature,
and set the atoms coupled to the thermal bath as the ones that have a value of
1.00 in the B column of the ubq_shell.pdb, which you will create below.
* 2 In the VMD TkCon window, navigate to the 2-6-heat-diff/ directory.
cd ../2-6-heat-diff/
3 Load the system into VMD by typing the following in the VMD TkCon
window:
mol new ../common/ubq_ws.psf
mol addfile ../1-2-sphere/ubq_ws_eq.restart.coor
2 ANALYSIS 57
6 Find x, y and z coordinates of the system’s center and place their values
in the variables xmass, ymass, and zmass:
foreach {xmass ymass zmass} $center { break }
9 Create the pdb file that marks the atoms in the outer layer by “1.00” in
the beta column:
$selALL writepdb ubq_shell.pdb
* 11 If you do not run the simulation yourself, you will need to obtain the data
for the temperature from the provided log file. Copy this log file from the
directory example-output/.
cp example-output/ubq_cooling.log .
If you run the simulation yourself, your log file will be generated by
NAMD, and you do not need to copy it.
* 16 Double-click on the y-axis of the plot and enter a value of 320 in the Stop
field. Click Accept.
* 17 You will now fit the simulated temperature dependence to the theoretical
expression. For this, you will use the Non-linear curve fitting feature
of xmgrace.
* 19 In the Main tab, type or copy and paste over the Formula window (make
sure it is on one line):
y = 200 + 66.87*(exp(-0.0146*a0*x) +0.25*exp(-0.25*0.0146*a0*x)
+1/9*exp(-1/9*0.0146*a0*x) +1/16*exp(-1/16*0.0146*a0*x)
+1/25*exp(-1/25*0.0146*a0*x) +1/36*exp(-1/36*0.0146*a0*x)
+1/49*exp(-1/49*0.0146*a0*x) +1/64*exp(-1/64*0.0146*a0*x)
+1/81*exp(-1/81*0.0146*a0*x) +1/100*exp(-1/100*0.0146*a0*x))
* 21 Multiply the value of the a0 parameter by 0.1 to get the thermal diffusivity
in cm2 s−1 . You should get a value of around 0.45×10−2 cm2 s−1 . How
does your result compare to the thermal diffusivity of water D = 1.4 ×
10−3 cm2 s−1 ?
* 23 When you are finished investigating the plot, close xmgrace, saving your
plot if you wish.
2 ANALYSIS 59
Figure 13: Cooling of ubiquitin in a water sphere. The red line shows a non-
linear fit of the data to the theoretical expression.
T / T0
1
1/2
1/4
1/8
t
0 τ 2τ
First you will generate temperature echoes in MD simulations, and then you
will analyze the echoes in the framework of the normal mode approximation.
2 ANALYSIS 61
Let’s take a look at some features in the equil.conf configuration file. You
can read the file using nedit.
• The simulation takes restart files, i.e., the coordinate file and the velocity
file, from an equilibration simulation at T = 300K.
# Continuing a job from the restart files
set inputname ../common/ubi_equil
binCoordinates $inputname.restart.coor
extendedSystem $inputname.xsc
• Notice that the temperature line is commented out. The initial temper-
ature is pre-defined by the initial velocities.
#temperature $temperature
binvelocities $inputname.restart.vel
* 4 If you do not run the simulation yourself, you will need to obtain the data
for the temperature from the provided log file. Copy this log file from the
directory example-output/.
cp example-output/equil.log .
If you run the simulation yourself, your log file will be generated by
NAMD, and you do not need to copy it.
* 5 Open VMD by typing vmd in the Terminal window.
* 6 Once your job is done, you need to get the temperature data from the out-
put file. In the VMD TkCon window (Extensions → Tk Console), navigate
to the 2-7-echoes/01_equil_NVE directory if you are not already there.
* 9 A tcl script has been provided for you to calculate the temperature au-
tocorrelation function. Source the script by typing in the VMD TkCon
window:
source auto-corr.tcl
This will put the temperature autocorrelation function in the file auto-corr.dat.
You will now fit the simulated temperature autocorrelation function to a de-
caying exponential approximation (see the Science Box). For this, you will use
the Non-linear curve fitting feature of xmgrace.
* 12 In the Main tab, type the following into the Formula window:
y = exp(-x/a0)
14 If you prefer, double-click on the title area (above the graph), the x-axis,
and the y-axis to enter suitable labels for your graph.
* 15 When you are finished investigating the plot, close xmgrace, saving your
plot if you wish.
* 17 You will perform the temperature quenching experiment for the value
τ = 200f s. You are going to quench the temperature (set it to zero),
and monitor the recovery of the system as it runs for τ time steps. If you
would like to probe other values of τ , you should edit your configuration
file echo.conf using nedit, changing the value of tau:
set tau 200
* 19 If you do not run the simulation yourself, you will need to obtain the data
for the temperature from the provided log file. Copy this log file from the
directory example-output/.
cp example-output/echo.log .
If you run the simulation yourself, your log file will be generated by
NAMD, and you do not need to copy it.
* 20 Once your job is done, you need to again get the temperature data from
the output file. In the VMD TkCon window, navigate to the 2-7-echoes/02_quencha
directory.
Now, you will quench the system for the second time.
Note that the configuration file echo.conf indicates that the simulation will
run for 3τ steps: run [expr 3*$tau]
* 24 If you do not run the simulation yourself, you will need to obtain the data
for the temperature from the provided log file. Copy this log file from the
directory example-output/.
cp example-output/echo.log .
If you run the simulation yourself, your log file will be generated by
NAMD, and you do not need to copy it.
2 ANALYSIS 66
* 25 Again, get the temperature data from the output file. In the VMD TkCon
window, navigate to the 2-7-echoes/03_quenchb directory and get the
temperature data at every timestep using our namdstats.tcl script:
data_time TEMP echo.log
This will write the data into the file TEMP.dat.
You now have the temperature data for the whole temperature quench experi-
ment. You will use xmgrace to analyze the data.
Note anything unusual? You quenched the temperature twice, and yet you see
three drops in temperature! The third one is a temperature echo. See Fig. 16.
2 ANALYSIS 67
Next, you will compare T (t) in the vicinity of the echo (t = 2τ ) obtained from
the MD simulation with the theoretical prediction (2) involving the temperature
autocorrelation function obtained also from the MD simulations. The degree
of agreement between these two results is a measure of the accuracy of the
harmonic approximation.
* 30 You will use a tcl script to calculate the harmonic approximation of the
temperature echo, given by Eq. 1. Source the script by typing in the VMD
TkCon window:
source harmonic.tcl
This will write the data for the harmonic approximation to the file harmonic.dat.
You need to find the depth of the echo. From the graph, you can see that the
echo occurs around 900 fs.
* 33 Scroll down to the temperature data near 900 fs, and find the minimum lo-
cal value of temperature around that time. Record the value and calculate
the depth of the echo by subtracting the value from 75:
2 ANALYSIS 68
Figure 16: A comparison of the simulation and the expression from harmonic
approximation at the vicinity of the echo.
You have calculated the echo depth for a particular value of the delay time
τ = 200f s. You may wish to repeat the experiment using other values of τ
(100-800 fs). (You must alter the harmonic.tcl script.) If this is done and the
data is plotted and fitted to a single exponential exp(−τ /τd ), one obtains the
so-called dephasing time τd , which is an inherent property of the system.
* 34 When you are finished investigating the plot, close xmgrace, saving your
plot if you wish.
(t < 0), there will be no discontinuities (jumps) in T (t) at t1 and t2 , yet you will
observe a temperature echo at a later time, i.e., a sharp dip in the temperature
at time t = τ + τe . Your goal is to determine τe and the depth ∆T of the
echo. To this end, you will need to follow a similar procedure to the one in the
previous exercise.
* 38 If you do not run the simulation yourself, you will need to obtain the data
for the temperature from the provided log file. Copy this log file from the
directory example-output/.
cp example-output/echo.log .
If you run the simulation yourself, your log file will be generated by
NAMD, and you do not need to copy it.
41 For this simulation, you should use the file 300.vel you generated be-
fore as the velocity restart file. This is included in the configuration file
echo.conf as:
velocities ../04_consta/300.vel
This will reassign the velocities to the exact same distribution they had
at the beginning of the previous simulation. This simulation will run for
3τ time steps.
* 43 If you do not run the simulation yourself, you will need to obtain the data
for the temperature from the provided log file. Copy this log file from the
directory example-output/.
cp example-output/echo.log .
If you run the simulation yourself, your log file will be generated by
NAMD, and you do not need to copy it.
* 45 In a Terminal window, change the name of this output file and copy the
other temperature file to this directory:
mv TEMP.dat temp2.dat
cp ../04_consta/TEMP.dat ./temp1.dat
* 47 Note that there are now two temperature values at 700 fs. You should
open the file temp.dat with your text editor and delete one.
* 48 View the temperature data and observe the temperature echo using
xmgrace:
xmgrace temp.dat
2 ANALYSIS 71
* 49 Try to locate the time of the echo and find its depth by looking at the
temperature data as before:
less temp.dat
This time, the depth of the echo is measured by:
Echo depth = 300 - Minimum Temperature
* 50 Compare your result with the pre-made results stored in the directory
example_output for τ = 200 fs. How would you explain your findings?
• The basic idea behind any SMD simulation is to apply an external force
to one or more atoms, which we refer to as SMD atoms. In addition, you
can keep another group of atoms fixed and study the behaviour of your
protein under various conditions.
• In the following simulations, you will fix one atom of ubiquitin and pull
on another one and, thereby, stretch and unfold ubiquitin. Before running
the actual simulations, you will prepare your system and create the files
needed.
2 Choose the File → New Molecule... menu item of VMD. In the Molecule
File Browser use the Browse... button to find the file ubq_ws.psf in the
common directory. Load it by pressing the Load button. If you do not find
the file, look for it in the common/example-output/ directory.
3 STEERED MOLECULAR DYNAMICS 73
3 In the VMD Main window your molecule should appear (ID 0).
4 In the Molecule File Browser window, use the Browse... and the Load
buttons load the file 1-2-sphere/ubq_ws_eq.restart.coor into your psf
file. Be certain that the Load files for: field says 0:ubq_ws.psf. If you
have not done that exercise, a copy of the corresponding output files is
provided in the subdirectory 1-2-sphere/example-output/. When you
are done, close the Molecule File Browser window.
Now you have the equilibrated ubiquitin in a water sphere loaded in VMD. The
next step is to eliminate the water.
You have created a pdb file that contains the equilibrated protein without
water.
F~ = −∇U (3)
1
U = k[vt − (~r − ~r0 ) · ~n]2 (4)
2
where:
• U→ Potential energy.
• k→ Spring constant.
• v→ Pulling velocity.
• t→ Time.
• ~n → Direction of pulling.
3 STEERED MOLECULAR DYNAMICS 74
t0
t1
vt1
t2
vt2
t3
r3
vt3
t4
r4
vt4
1 Choose the File → New Molecule... menu item and using the Browse. . .
and Load buttons load the file common/ubq.psf that you created in the
first unit for ubiquitin in vacuum. (If you did not succeed in generating
this file in unit 1, look for common/example-output/ubq.psf)
2 In the Molecule File Browser window, use the Browse... and the Load
buttons load the file common/ubq_ww_eq.pdb into your psf file. Be certain
that the Load files for: field says 1:ubq.psf. When you are done, close the
Molecule File Browser window. The equilibrated ubiquitin without water
is now available in VMD.
4 Type $allatoms set beta 0. In this way you set the B column of all
atoms equal to 0.
5 Type set fixedatom [atomselect top "resid 1 and name CA"]. This
creates a selection that contains the fixed atom, namely the Cα atom of
the first residue.
6 Type $fixedatom set beta 1. This sets the value of the B column for
the fixed atom to 1 and, therefore, NAMD will keep this atom now fixed.
Likewise, NAMD uses another column of a pdb file to set which atom is to be
pulled (SMD atom). For this purpose it uses the occupancy column of the pdb
file.
8 Type set smdatom [atomselect top "resid 76 and name CA"]. The
smdatom selection you created contains the Cα atom of the last residue.
11 Take a look at the pdb file you have just created. Open a new Terminal
window, and change the directory to namd-tutorial-files, by typing cd
Workshop/namd-tutorial-files.
Figure 18: Snapshot of the file ubq_ww_eq.ref showing the fixed atom row.
3 STEERED MOLECULAR DYNAMICS 76
13 The file you just created (common/ubq_ww_eq.ref) also contains the ap-
propriate information required by NAMD to identify the SMD atom.
Again, check this by finding the row or line that corresponds to the Cα
atom as shown in Fig. 19 (a) for the glycine (b) residue number 76 (c) or
C terminus. This atom, that should have occupancy 1 (e), will be pulled
in the simulation.
Figure 19: Snapshot of the file ubq_ww_eq.ref showing the SMD atom row.
14 When you are done with the comparison of your file with Figs. 18 and
19, close nedit. Note that coordinates (columns 7, 8, and 9) in your file
will not necessarily match the ones shown in the figures because initial
velocities in the equilibration were chosen randomly.
Now that you have defined the fixed and SMD atom, you need to specify the
direction in which the pulling will be performed. This is determined by the
direction of the vector that links the fixed and the SMD atoms.
nx = ny = nz =
In the provided example (look at Figs. 18 and 19), the result is:
10 In the Extra Parameters section you need to write also the direction of
pulling by adding the following line:
SMDDir nx ny nz
3 STEERED MOLECULAR DYNAMICS 79
11 In the same section, set the frequency in time steps with which the current
SMD data values will be printed out by typing:
SMDOutputFreq 10
13 Now your configuration file is ready. SAVE IT and close your text editor.
1 Check that you actually have these files in the respective directories and
change to directory 3-1-pullcv to run the simulation.
While your simulation is running, some files will be created (as you already
learned in Unit 1). The only difference in this case is that in the output file
(ubq_ww_pcv.log) you will find specific information about the SMD atom and
the applied force.
• The additional output line starts with the word SMD in the first column
as shown in Fig. 20 (a).
• The second column (b) is the number of timesteps.
• The third, fourth, and fifth columns (c) are the coordinates of the SMD
atom.
• The last three columns (d) are the components of the current force applied
to the SMD atom in pN.
Since the simulation will take some time, the analysis of the complete output
will be explained in section 3.4. Thus, while you wait for the result you can set
up your Constant Force simulation.
2 In your opened session of VMD, choose the File → New Molecule... menu
item and using the Browse... and the Load buttons load the file common/ubq.psf
located in the common directory, and close the Molecule File Browser win-
dow.
3 Using the mouse select the molecule in the VMD Main window and then
choose the Load Data Into Molecule... menu item. Again, using the
Browse... and the Load buttons load the file ubq_ww_eq.pdb located in
the common directory. Close the Molecule File Browser.
4 As you did in the previous section, define your fixed atom by typing the
following commands in the VMD TkCon window:
set allatoms [atomselect top all]
$allatoms set beta 0
set fixedatom [atomselect top "resid 1 and name CA"]
$fixedatom set beta 1
$allatoms set occupancy 0
5 The occupancy of the SMD atom will contain the force applied to it. Type
set smdatom [atomselect top "resid 76 and name CA"]
$smdatom set occupancy 11.54
You have now set the force to 11.54 kcal/mol/Å by entering the value into
the occupancy field. It is equivalent to 800 pN.
6 The direction of the force will be specified in the coordinates of the SMD
atom. Therefore, you have to write the normal vector in the following
way:
$smdatom set x nx
$smdatom set y ny
$smdatom set z nz
where nx , ny , and nz have to be replaced by the appropriate values you
already calculated above (in our example 0.352, 0.402, and 0.845). Since
the VMD OpenGL Display interprets the numbers just entered as coordi-
nates of the SMD atom, it displays now an inaccurate protein structure.
This is OK and we apologize for the poor appearance.
3 STEERED MOLECULAR DYNAMICS 82
11 Your second configuration file is done. SAVE IT and close the text editor.
• ubq.psf
• ubq_ww_eq.pdb
• ubq_ww_eq2.ref
• par_all27_prot_lipid.inp
in the common directory. In case that you have not generated these files you
can use prepared files available at directories 3-2-pullcf/example-output and
common/example-output.
Note that the output file has no extra information in this case, since the applied
force is now constant.
1 In VMD choose the New Molecule... menu item. Using the Browse... and
the Load buttons, load the file ubq.psf in the common directory.
2 In the Molecule File Browser window, use the Browse... and the Load
buttons load the trajectory file 3-1-pullcv/ubq_ww_pcv.dcd. Close the
Molecule File Browser.
In the screen you should be able to see the trajectory of the molecular dynamics
simulation. By choosing an appropriate representation (e.g. New Cartoon) look
how the β strands behave along the trajectory and how one end of the protein
remains fixed while the other one is pulled as you had set it up (Fig. 21). Note
that secondary structure will be calculated for the New Cartoon representation
based on the frame of the trajectory you are viewing. If you move to another
trajectory frame and would like to view the protein’s secondary structure in that
frame, type mol ssrecalc top in the TkCon window and VMD will update it.
Figure 21: Snapshots of ubiquitin pulling with constant velocity at three di-
fferent time steps.
After inspecting your trajectory you should extract the force applied to the
SMD atom from the NAMD output file:
You will now use a script designed to extract the necessary information from the
NAMD log file and calculate the force of pulling. The NAMD log file provides
SMD information on lines beginning with the tag “SMD": the current timestep,
current position of the center of mass of the restrained atoms, and the current
force applied to the center of mass (in piconewtons).
3 STEERED MOLECULAR DYNAMICS 85
5 Source the provided tcl script for getting force information from the NAMD
log file. Type the following command in the VMD TkCon window:
source ft.tcl
In order to obtain the force in the direction of pulling you need to calculate
f~ · ~n, where ~n is the normalized direction of pulling (in our example it was
0.443, 0.398, 0.803). The script will ask you for these values. Simply enter them
as n_x, n_y, and n_z. The script will create a file ft.dat (in the analysis
directory) which contains just the simulation timestep and the magnitude of the
force on the dummy atom at that time.
6 The contents of the script are shown below. You should understand what
each line does in order to make tcl scripting a part of your repertoire.
### Open the log file for reading and the output .dat file for writing
set file [open ubq_ww_pcv.log r]
set output [open analysis/ft.dat w]
### Close the log file and the output .dat file
close $file
close $output
Figure 22: Force vs Time. Your plot should resemble the graph on the left. The
graph on the right was obtained in a simulation where ubiquitin was placed in
a water sphere (∼ 26000 atoms) and pulled at 0.5 Å/ps using a time step of 1
femtosecond. The results of this last simulation are in better agreement with
actual AFM experiments. The force at the end (t > 400ps) increases when the
protein becomes completely unfolded. The first peak in the force is associated
with the breaking of hydrogen bonds between two β strands.
2 Choose the New Molecule... menu item. Using the Browse... and the Load
buttons load the file ubq.psf located in the common directory.
3 In the Molecule File Browser window, use the Browse... and the Load but-
tons load the trajectory file 3-2-pullcf/ubq_ww_pcf.dcd. As mentioned
before, in case that you have not accomplished the simulation to generate
the file, we provide such file at 3-2-pullcf/example-output/ubq_ww_pcf.dcd.
In the OpenGL Display window you will see the trajectory of the constant force
pulling simulation.
3 STEERED MOLECULAR DYNAMICS 87
Figure 23: Distance vs Time Steps. Your plot should resemble the graph on
the left. The graph on the right was obtained in a simulation where ubiquitin
was placed in a water box and pulled from the C-Terminus while keeping the
residue K48 fixed. In this case we can observe an intermediate state.
4 Once the complete trajectory is loaded, use the slider in the VMD Main
window to go back to the first frame.
5 Choose the Graphics → Representations... menu item. In the Graphical
Representations window choose the New Cartoon drawing method.
6 Press the Create Rep button in order to create a new representation. In
the Selected Atoms text entry delete the word all and type protein and
resid 1 76 and name CA.
7 For this representation choose the VDW drawing method. You should be
able to see the two Cα atoms at the end of your protein as spheres.
8 Hide the first representation by double clicking on it in the Graphical
Representations window.
9 Click in the OpenGL Display window and press the key 2 (Shortcut to
bond labels). Your cursor should look like a cross. Pick the two spheres
displayed. A line linking both atoms should appear with the distance
between them displayed.
10 Choose the Graphics → Labels... menu item. In the Labels window, choose
the label type Bonds. Select the bond displayed, click on the Graph tab
and then click on the Graph button. This will create a plot of the distance
between these two atoms over time (Fig. 23). You also have the option
to write the data and to a file, which can then be read by an external
graphing program.
4 ACKNOWLEDGMENTS 88
This is the end of the NAMD tutorial. We hope you can now make use of
VMD and NAMD in your work.
4 Acknowledgments
The developement of NAMD and the tutorials are funded by the National Insti-
tutes of Health (NIH 9P41GM104601 — Center for Macromolecular Modeling
and Bioinformatics, NIH 5 R01 GM908243-02 — “Commodity Hardware Accel-
eration of Popular Modeling Software for Structural Biology”). Proper citation
is a primary way in which we demonstrate the value of our software to the sci-
entific community and is essential to continued NIH funding for NAMD. The
authors request that all published work which utilizes NAMD include the pri-
mary NAMD citation:
A PDB Files
The term PDB can refer to the Protein Data Bank (http://www.rcsb.org/pdb/),
to a data file provided there, or to any file following the PDB format. Files in
the PDB include information such as the name of the compound, the species
and tissue from which is was obtained, authorship, revision history, journal
citation, references, amino acid sequence, stoichiometry, secondary structure
locations, crystal lattice and symmetry group, and finally the ATOM and HET-
ATM records containing the coordinates of the protein and any waters, ions,
or other heterogeneous atoms in the crystal. Some PDB files include multiple
sets of coordinates for some or all atoms. Due to the limits of x-ray crystallog-
raphy and NMR structure analysis, the coordinates of hydrogen atoms are not
included in the PDB.
NAMD and VMD ignore everything in a PDB file except for the ATOM and
HETATM records, and when writing PDB files the ATOM record type is used
for all atoms in the system, including solvent and ions. Here are the ATOM
records for the first two residues of ubiquitin from the 1UBQ entry in the PDB:
ATOM 1 N MET 1 27.340 24.430 2.614 1.00 9.67 1UBQ 71
ATOM 2 CA MET 1 26.266 25.413 2.842 1.00 10.38 1UBQ 72
ATOM 3 C MET 1 26.913 26.639 3.531 1.00 9.62 1UBQ 73
ATOM 4 O MET 1 27.886 26.463 4.263 1.00 9.62 1UBQ 74
ATOM 5 CB MET 1 25.112 24.880 3.649 1.00 13.77 1UBQ 75
ATOM 6 CG MET 1 25.353 24.860 5.134 1.00 16.29 1UBQ 76
ATOM 7 SD MET 1 23.930 23.959 5.904 1.00 17.17 1UBQ 77
ATOM 8 CE MET 1 24.447 23.984 7.620 1.00 16.11 1UBQ 78
ATOM 9 N GLN 2 26.335 27.770 3.258 1.00 9.27 1UBQ 79
ATOM 10 CA GLN 2 26.850 29.021 3.898 1.00 9.07 1UBQ 80
ATOM 11 C GLN 2 26.100 29.253 5.202 1.00 8.72 1UBQ 81
ATOM 12 O GLN 2 24.865 29.024 5.330 1.00 8.22 1UBQ 82
ATOM 13 CB GLN 2 26.733 30.148 2.905 1.00 14.46 1UBQ 83
ATOM 14 CG GLN 2 26.882 31.546 3.409 1.00 17.01 1UBQ 84
ATOM 15 CD GLN 2 26.786 32.562 2.270 1.00 20.10 1UBQ 85
ATOM 16 OE1 GLN 2 27.783 33.160 1.870 1.00 21.89 1UBQ 86
ATOM 17 NE2 GLN 2 25.562 32.733 1.806 1.00 19.49 1UBQ 87
The fields seen here in order from left to right are the record type, atom
ID, atom name, residue name, residue ID, x, y, and z coordinates, occupancy,
temperature factor (called beta), segment name, and line number.
If this file is loaded into VMD and then written out as a new file, most of the
extra information will be removed, the HETATM records will become ATOM
records, and the previously empty chain ID field (between residue name and
residue ID) will be set to X (unless present in the original file), and the line
number will be omitted, as seen here:
ATOM 1 N MET X 1 27.340 24.430 2.614 1.00 9.67 1UBQ
ATOM 2 CA MET X 1 26.266 25.413 2.842 1.00 10.38 1UBQ
ATOM 3 C MET X 1 26.913 26.639 3.531 1.00 9.62 1UBQ
B PSF FILES 90
B PSF Files
A PSF file, also called a protein structure file, contains all of the molecule-
specific information needed to apply a particular force field to a molecular sys-
tem. The CHARMM force field is divided into a topology file, which is needed
to generate the PSF file, and a parameter file, which supplies specific numerical
values for the generic CHARMM potential function. The topology file defines
the atom types used in the force field; the atom names, types, bonds, and par-
tial charges of each residue type; and any patches necessary to link or otherwise
mutate these basic residues. The parameter file provides a mapping between
bonded and nonbonded interactions involving the various combinations of atom
types found in the topology file and specific spring constants and similar param-
eters for all of the bond, angle, dihedral, improper, and van der Waals terms in
the CHARMM potential function.
The PSF file contains six main sections of interest: atoms, bonds, angles,
dihedrals, impropers (dihedral force terms used to maintain planarity), and
cross-terms. The following is taken from a PSF file for ubiquitin. First is the
title and atom records:
PSF CMAP
6 !NTITLE
REMARKS original generated structure x-plor psf file
REMARKS 2 patches were applied to the molecule.
REMARKS topology top_all27_prot_lipid.inp
REMARKS segment U { first NTER; last CTER; auto angles dihedrals }
REMARKS defaultpatch NTER U:1
REMARKS defaultpatch CTER U:76
1231 !NATOM
1 U 1 MET N NH3 -0.300000 14.0070 0
2 U 1 MET HT1 HC 0.330000 1.0080 0
3 U 1 MET HT2 HC 0.330000 1.0080 0
4 U 1 MET HT3 HC 0.330000 1.0080 0
5 U 1 MET CA CT1 0.210000 12.0110 0
6 U 1 MET HA HB 0.100000 1.0080 0
7 U 1 MET CB CT2 -0.180000 12.0110 0
The fields in the atom section are atom ID, segment name, residue ID, residue
name, atom name, atom type, charge, mass, and an unused 0. PSF files may
be in either CHARMM or X-PLOR format, with the CHARMM format using
an integer rather than a name for the atom type. NAMD requires the X-PLOR
format, which is also more flexible since it is not tied to the specific order of
atom types in a single parameter file. NAMD and VMD require that the order
of atoms in any PDB, DCD, or other atomic data file exactly matches the order
found in the PSF file.
Notice that hydrogen atoms are included, that multiple atoms in a residue
may share the same type (e.g., HT1, HT2, and HT3 are of type HC), and that
B PSF FILES 91
atoms of the same element may have different types (e.g., CA and CB, HA, and
HT1). Much of the information in the PDB is also included in the PSF file.
Often, the only information from the PDB file used by NAMD is the atomic
coordinates. In some cases the contents of the occupancy and beta fields of the
PDB file are used as parameters to optional simulation methods.
The covalent bond section lists four pairs of atoms per line:
1237 !NBOND: bonds
1 5 2 1 3 1 4 1
5 6 7 5 7 8 7 9
10 7 10 11 10 12 13 10
The dihedral and improper sections list two quadruples of atoms per line:
3293 !NPHI: dihedrals
1 5 7 10 1 5 7 8
1 5 7 9 1 5 18 20
1 5 18 19 2 1 5 7
The order of the atoms within each bond is not significant. The order of
atoms within angles, dihedrals, and impropers is significant, but the order can
be reversed without affecting the resulting potential. In no case is the relative
order of different bonds etc. significant. Since every bond and improper is
explicitly listed in the topology file, the atom order within these terms tend to
match the original order given. Angles and dihedrals are typically generated
automatically and therefore appear in a sorted order.
There is a difference between X-PLOR formatted CHARMM PSF files,
which VMD generates with the psfgen module and NAMD uses in conjunction
with CHARMM parameter files, and PSF files generated by X-PLOR, which
NAMD uses in conjunction with X-PLOR parameter files. Dihedral terms some-
times require multiple sinusoids to represent a torsional potential and therefore
B PSF FILES 92
multiple parameter sets appear in the parameter file. In PSF files generated
by X-PLOR multiple dihedrals would be indicated by duplicate dihedrals in
the PSF file. When using CHARMM PSF and parameter files NAMD extracts
any multiple dihedral terms directly from the parameter file and each dihedral
appears only once in the PSF file.
C TOPOLOGY FILES 93
C Topology Files
A CHARMM forcefield topology file contains all of the information needed to
convert a list of residue names into a complete PSF structure file. It also con-
tains internal coordinates that allow the automatic assignment of coordinates
to hydrogens and other atoms missing from a crystal PDB file.
The current versions of the CHARMM forcefield are CHARMM22 for pro-
teins and CHARMM27 for lipids and nucleic acids including CMAP correction to
proteins. The individual topology files are named, respectively, top_all22_prot_cmap.inp,
top_all27_lipid.rtf, and top_all27_na.rtf. To enable computation on hy-
brid systems, combinations are also provided, named top_all27_na_lipid.rtf,
top_all27_prot_lipid.rtf, and top_all27_prot_na.rtf which can all be
found in the CHARMM31 release. While the tools used with NAMD allow mul-
tiple topology and parameter files to be used simultaneously, it is preferable to
use these pre-combined files. The CHARMM31 release is available for download
from the MacKerell web site:
http://mackerell.umaryland.edu/charmm_ff.shtml
We will examine top_all27_prot_lipid.rtf; the other files are similar.
At the beginning of the file is the header, indicated by lines beginning with
*s, followed in this case by “31 1" to indicate the version of CHARMM that
generated the file:
*> CHARMM22 All-Hydrogen Topology File for Proteins and Lipids <<
*>>>>>> Includes phi, psi cross term map (CMAP) correction <<<<<<
*>>>>>>>>>>>>>>>>>>>>>> July 2004 <<<<<<<<<<<<<<<<<<<<<<<<<<
* All comments to ADM jr. via the CHARMM web site: www.charmm.org
* parameter set discussion forum
*
31 1
! references
!
!PROTEINS
!
!MacKerell, A.D., Jr,. Feig, M., Brooks, C.L., III, Extending the
!treatment of backbone energetics in protein force fields: limitations
!of gas-phase quantum mechanics in reproducing protein conformational
!distributions in molecular dynamics simulations, Journal of
!Computational Chemistry, 25: 1400-1415, 2004.
!
!MacKerell, Jr., A. D.; Bashford, D.; Bellott, M.; Dunbrack Jr., R.L.;
C TOPOLOGY FILES 94
!Evanseck, J.D.; Field, M.J.; Fischer, S.; Gao, J.; Guo, H.; Ha, S.;
!Joseph-McCarthy, D.; Kuchnir, L.; Kuczera, K.; Lau, F.T.K.; Mattos,
!C.; Michnick, S.; Ngo, T.; Nguyen, D.T.; Prodhom, B.; Reiher, III,
!W.E.; Roux, B.; Schlenkrich, M.; Smith, J.C.; Stote, R.; Straub, J.;
!Watanabe, M.; Wiorkiewicz-Kuczera, J.; Yin, D.; Karplus, M. All-atom
!empirical potential for molecular modeling and dynamics Studies of
!proteins. Journal of Physical Chemistry B, 1998, 102, 3586-3616.
!
The topology file must define the type, mass, and charge of every atom in
every residue, so that a PSF file can be constructed. While the partial charges
assigned to atoms of the same type vary between residues, their masses do not.
Therefore, the mass of every atom type is declared once at the beginning of
the file in a MASS statement. This statement also pairs an integer with each
type name, which is used in CHARMM formatted PSF files, but not in the
X-PLOR formatted PSF files used by NAMD. The type indices are unique but
not necessarily consecutive. Notice in the following except that there are many
types of hydrogen and carbon atoms defined, but the atomic masses are the
same:
DECL -CA
C TOPOLOGY FILES 95
DECL -C
DECL -O
DECL +N
DECL +HN
DECL +CA
The first and last residues of a chain obviously have different connectivity
from those in the center, since they have one fewer neighbor. This is handled
by applying patch residues, normally referred to as patches, to the terminal
residues. As will be seen, any residue definition can specify the patch to be
applied when it is the first or last residue in a segment. However, a default
set is declared for the entire file, as in the following where the default patch is
NTER for the first residue of a segment and CTER for the last:
We are now ready for the actual residue definitions, beginning with alanine,
as shown below. A residue is indicated by the RESI statement with the residue
name (ALA) and total charge (0.00). Next are listed all of the atoms in the
residue in ATOM statements with the atom name (N, HN, CA), type (NH1, H,
CT1), and partial charge (-0.47, 0.31, 0.07). The GROUP statements, dividing
the atoms into integer-charge groups, are not used by NAMD and should not be
confused with the hydrogen groups, each a non-hydrogen atom and all hydrogens
bonded to it, that NAMD uses to accelerate distance-testing for nonbonded
calculations.
RESI ALA 0.00
GROUP
ATOM N NH1 -0.47 ! |
ATOM HN H 0.31 ! HN-N
ATOM CA CT1 0.07 ! | HB1
ATOM HA HB 0.09 ! | /
GROUP ! HA-CA--CB-HB2
ATOM CB CT3 -0.27 ! | \
ATOM HB1 HA 0.09 ! | HB3
ATOM HB2 HA 0.09 ! O=C
ATOM HB3 HA 0.09 ! |
GROUP !
C TOPOLOGY FILES 96
ATOM C C 0.51
ATOM O O -0.51
The ALA residue continues by defining connectivity, with each BOND state-
ment followed by a list of pairs of atoms to be connected with bonds. The
DOUBLE statement is a synonym for BOND and does not affect the resulting
PSF file. Observe that the atom C is bonded to +N, the N of the following
residue. A bond between N and -C will be provided by the preceding residue.
The order of bonds, or of the atoms within a bond, is not significant.
BOND CB CA N HN N CA
BOND C CA C +N CA HA CB HB1 CB HB2 CB HB3
DOUBLE O C
As noted above, the angle and dihedral terms will be autogenerated and
are therefore not listed for this residue. The less common improper dihedrals
(normally just called impropers), however, must be listed explicitly. In this case
there are two impropers, which maintain the planarity of the peptide bonds.
As with dihedrals, the order of atoms within an improper may be reversed. As
shown below, impropers are specified by the IMPR statement followed by sets of
four atoms, with the central atom to which the other three are bonded typically
listed first.
IMPR N -C CA HN C CA +N O
The CMAP correction terms should also be listed explicitly since they are
only applied to the backbone dihedrals, indicated following the CMAP state-
ment.
CMAP -C N CA C N CA C +N
Explicit hydrogen bond terms are no longer present in the CHARMM force
field and are therefore not calculated by NAMD. The DONOR and ACCEPTOR
statements, shown below, specify pairs of atoms eligible to form hydrogen bonds.
The psfgen module in VMD ignores these statements and does not incorporate
hydrogen bonding information into the PSF file.
DONOR HN N
ACCEPTOR O C
It was mentioned above that special treatment is required for the first or last
residue in a chain, and that this is implemented as a patch. The following is the
default first-residue patch for proteins, NTER. The syntax is almost identical
to a normal residue, but the ATOM statements may refer to either add a new
atom (HT1, HT2, HT3) or modify the type and charge of an existing atom of
the given name (N, CA, HA). The DELETE statement operates as one would
expect, removing the atom (HN) and any bonds that include it.
The comment “use in generate statement” indicates that the NTER patch is
used during segment generation, and is applied before angles and dihedrals are
generated. An example of the other type of patch, those applied after segment
generation, is the LINK patch given below. The patch statement requires, in
this case, two residues as arguments, the first being the last residue of a segment
generated without the CTER patch and the second being the first residue of a
segment generated without the NTER patch (the comments have the N and C
termini reversed). The numbers 1 and 2 preceding atom names indicate which
argument residue the named atom belongs to. Since angles and dihedrals will
not be regenerated, they are enumerated.
These types of patches are used to alter protonation states (ASPP, GLUP,
HS2), create disulphide bonds (DISU), attach HEME groups (PHEM) and
their ligands (PLO2, PLIG), and even remove unwanted autogenerated angles
(FHEM).
The following is the complete residue definition for GLY, the smallest of the
amino acids. Compare GLY to the ALA residue dissected above.
RESI GLY 0.00
GROUP
ATOM N NH1 -0.47 ! |
ATOM HN H 0.31 ! N-H
ATOM CA CT2 -0.02 ! |
ATOM HA1 HB 0.09 ! |
ATOM HA2 HB 0.09 ! HA1-CA-HA2
GROUP ! |
ATOM C C 0.51 ! |
ATOM O O -0.51 ! C=O
! |
BOND N HN N CA C CA
BOND C +N CA HA1 CA HA2
DOUBLE O C
IMPR N -C CA HN C CA +N O
CMAP -C N CA C N CA C +N
DONOR HN N
ACCEPTOR O C
IC -C CA *N HN 1.3475 122.8200 180.0000 115.6200 0.9992
IC -C N CA C 1.3475 122.8200 180.0000 108.9400 1.4971
IC N CA C +N 1.4553 108.9400 180.0000 117.6000 1.3479
IC +N CA *C O 1.3479 117.6000 180.0000 120.8500 1.2289
IC CA C +N +CA 1.4971 117.6000 180.0000 124.0800 1.4560
IC N C *CA HA1 1.4553 108.9400 117.8600 108.0300 1.0814
C TOPOLOGY FILES 99
RESI TIP3 0.000 ! tip3p water model, generate using noangle nodihedral
GROUP
ATOM OH2 OT -0.834
ATOM H1 HT 0.417
ATOM H2 HT 0.417
BOND OH2 H1 OH2 H2 H1 H2 ! the last bond is needed for shake
ANGLE H1 OH2 H2 ! required
ACCEPTOR OH2
PATCHING FIRS NONE LAST NONE
The residue definitions for the ions below are exceedingly simple.
We have discussed only those parts of the topology files associated with
proteins and solvent. There is much additional information regarding proteins,
not to mention lipids and nucleic acids, included in the comments in the topology
files themselves.
D PARAMETER FILES 100
D Parameter Files
A CHARMM forcefield parameter file contains all of the numerical constants
needed to evaluate forces and energies, given a PSF structure file and atomic
coordinates. The parameter file is closely tied to the topology file that was used
to generate the PSF file, and the two are typically distributed together and
given matching names.
The current versions of the CHARMM forcefield are CHARMM22 for pro-
teins and CHARMM27 for lipids and nucleic acids including CMAP correction to
proteins. The individual parameter files are named, respectively, par_all22_prot_cmap.inp,
par_all27_lipid.prm, and par_all27_na.prm. To enable hybrid systems,
combinations are also provided, named par_all27_na_lipid.prm, par_all27_prot_lipid.prm,
and par_all27_prot_na.prm which can all be found in the CHARMM31 re-
lease. While the tools used with NAMD allow multiple topology and parameter
files to be used simultaneously, it is preferable to use these pre-combined files.
The CHARMM parameters are available for download from the MacKerell web
site:
http://mackerell.umaryland.edu/charmm_ff.shtml
! references
!
!PROTEINS
!
!MacKerell, A.D., Jr,. Feig, M., Brooks, C.L., III, Extending the
!treatment of backbone energetics in protein force fields: limitations
!of gas-phase quantum mechanics in reproducing protein conformational
!distributions in molecular dynamics simulations, Journal of
!Computational Chemistry, 25: 1400-1415, 2004.
!
!MacKerell, Jr., A. D.; Bashford, D.; Bellott, M.; Dunbrack Jr., R.L.;
!Evanseck, J.D.; Field, M.J.; Fischer, S.; Gao, J.; Guo, H.; Ha, S.;
!Joseph-McCarthy, D.; Kuchnir, L.; Kuczera, K.; Lau, F.T.K.; Mattos,
!C.; Michnick, S.; Ngo, T.; Nguyen, D.T.; Prodhom, B.; Reiher, III,
!W.E.; Roux, B.; Schlenkrich, M.; Smith, J.C.; Stote, R.; Straub, J.;
D PARAMETER FILES 101
Figure 24: Internal coordinates for bonded interactons: r governs bond stretch-
ing; θ represents the bond angle term; φ gives the dihedral angle; the small
out-of-plane angle α is governed by the so-called “improper" dihedral angle ψ.
The first set of entries in the parameter file are those for bonds, indicated
by the BONDS keyword. Each entry consists of a pair of atom types, a spring
constant, and an equilibrium length. The bond potential function is Kb (b−b0 )2 ,
where b is the bond length in Angstroms. Bonds are a stiff degree of freedom
in biomolecules, so the energy function is only accurate for values near the
equilibrium length. Entries are present for every type of bond present in the
topology file. Fig. 24 illustrates how bond length, bond angle, dihedral angle
and improper angle are defined. The beginning of the bonds section is shown
below:
BONDS
!
!V(bond) = Kb(b - b0)**2
!
!Kb: kcal/mole/A**2
!b0: A
!
!atom type Kb b0
!
!Carbon Dioxide
CST OST 937.96 1.1600 ! JES
!Heme to Sulfate (PSUL) link
SS FE 250.0 2.3200 !force constant a guess
!equilbrium bond length optimized to reproduce
!CSD survey values of
!2.341pm0.01 (mean, standard error)
!adm jr., 7/01
C C 600.000 1.3350 ! ALLOW ARO HEM
D PARAMETER FILES 102
The next section gives parameters for every type of dihedral present in the
topology file; there are even more dihedrals than there are angles. Since di-
hedrals represent the energy of rotation around a covalent bond, which is the
source of most conformational flexibility in biomolecules, they must provide a
smooth energy for 360 degrees. This is done in most cases with a single sinu-
soid, Kχ (1 + cos(n(χ − δ)) where χ is the angle between the plane containing
the first three atoms in the dihedral and the plane containing the last three.
The “multiplicity” n is typically 1, 2, or 3, although for a small number of cases
two or three terms with different values of n are provided for the same atom
types. You may can observe in the excerpts below that the dihedral spring con-
stants are one to two orders of magnitude lower than for angles, with an order
of magnitude difference between flexible and inflexible dihedrals.
DIHEDRALS
!
!V(dihedral) = Kchi(1 + cos(n(chi) - delta))
!
!Kchi: kcal/mole
!n: multiplicity
!delta: degrees
!
!atom types Kchi n delta
!
!Heme to Sulfate (PSUL) link
X FE SS X 0.0000 4 0.00 ! guess
!adm jr., 7/01
X CS SS X 0.0000 3 0.20 ! guess
!from methanethiol, HS S CT3 HA
D PARAMETER FILES 104
The final bond-like terms in the parameter file are impropers, which are
used exclusively and explicitly in the molecular topology to maintain planarity.
As such, the harmonic form Kψ (ψ − ψ0 )2 with a large spring constant and ψ0
typically zero is used to restrain deformations among an atom and three atoms
bonded to it. As with dihedrals, ψ is angle between the plane containing the
first three atoms and the plane containing the last three. Notice below that
wildcard atom types occur in the second and third positions, rather than the
first and fourth as in dihedrals.
IMPROPER
!
!V(improper) = Kpsi(psi - psi0)**2
!
!Kpsi: kcal/mole/rad**2
!psi0: degrees
!note that the second column of numbers (0) is ignored
D PARAMETER FILES 105
!
!atom types Kpsi psi0
!
CPB CPA NPH CPA 20.8000 0 0.0000 ! ALLOW HEM
! Heme (6-liganded): porphyrin macrocycle (KK 05/13/91)
CPB X X CE1 90.0000 0 0.0000 ! ALLOW HEM
! Heme (6-liganded): substituents (KK 05/13/91)
CT2 X X CPB 90.0000 0 0.0000 ! ALLOW HEM
! Heme (6-liganded): substituents (KK 05/13/91)
CT3 X X CPB 90.0000 0 0.0000 ! ALLOW HEM
! Heme (6-liganded): substituents (KK 05/13/91)
!HA C C HA 20.0000 0 0.0000 ! ALLOW PEP POL ARO
The next section gives the interpolation values for CMAP, which is a cor-
rection map to the backbone dihedral energy. Each φ and ψ dihedral angle,
ranging from -180 to 180, is divided into 24 grid points; the energy correction
at each point is given. A continuous function can be constructed using these
values along with an interpolation formula, which can be found in the references
below.
CMAP
! 2D grid correction data. The following surfaces are the correction
! to the CHARMM22 phi, psi alanine, proline and glycine dipeptide surfaces.
! Use of CMAP requires generation with the topology file containing the
! CMAP specifications along with version 31 or later of CHARMM. Note that
! use of "skip CMAP" yields the charmm22 energy surfaces.
!
! references
!MacKerell, A.D., Jr., Feig, M., Brooks, C.L., III, Accurate Treatment of
!Protein Backbone Conformational Energetics in Empirical Force Fields, Submitted
!for publication.
!MacKerell, A.D., Jr., Feig, M., Brooks, C.L., III, Improved Treatment of the
!Protein Backbone in Empirical Force Fields, Journal of the American Chemical
!Society, In Press.
! alanine map
C NH1 CT1 C NH1 CT1 C NH1 24
!-180
0.126790 0.768700 0.971260 1.250970 2.121010
2.695430 2.064440 1.764790 0.755870 -0.713470
0.976130 -2.475520 -5.455650 -5.096450 -5.305850
-3.975630 -3.088580 -2.784200 -2.677120 -2.646060
-2.335350 -2.010440 -1.608040 -0.482250
!-165
-0.802290 1.377090 1.577020 1.872290 2.398990
2.461630 2.333840 1.904070 1.061460 0.518400
D PARAMETER FILES 106
Recall that the partial charge of each atom is specified in the topology and
PSF files and is independent of the atom type. Therefore the only type-based
parameters are for the van der Waals interactions, which are represented by
the classic Lennard-Jones potential (expressed in the somewhat unconventional
form) [(rmin /r)12 − 2(rmin /r)6 ]. Observe that at r = rmin the force is zero
and the energy is −. Rather than providing a different value of epsilon could
be provided for every possible combination of atom types, only one value is
provided per type and inter-type interactions are calculated using the sum of
the radii rmin /2 and the geometric mean of the well-depths . By convention,
the values are negative in the parameter file, as seen here:
!
!V(Lennard-Jones) = Eps,i,j[(Rmin,i,j/ri,j)**12 - 2(Rmin,i,j/ri,j)**6]
!
!epsilon: kcal/mole, Eps,i,j = sqrt(eps,i * eps,j)
!Rmin/2: A, Rmin,i,j = Rmin/2,i + Rmin/2,j
!
!atom ignored epsilon Rmin/2 ignored eps,1-4 Rmin/2,1-4
!
C 0.000000 -0.110000 2.000000 ! ALLOW PEP POL ARO
! NMA pure solvent, adm jr., 3/3/93
CA 0.000000 -0.070000 1.992400 ! ALLOW ARO
! benzene (JES)
CC 0.000000 -0.070000 2.000000 ! ALLOW PEP POL ARO
! adm jr. 3/3/92, acetic acid heat of solvation
CD 0.000000 -0.070000 2.000000 ! ALLOW POL
! adm jr. 3/19/92, acetate a.i. and dH of solvation
CE1 0.000000 -0.068000 2.090000 !
! for propene, yin/adm jr., 12/95
CE2 0.000000 -0.064000 2.080000 !
! for ethene, yin/adm jr., 12/95
CM 0.000000 -0.110000 2.100000 ! ALLOW HEM
! Heme (6-liganded): CO ligand carbon (KK 05/13/91)
When the scaled1-4 exclusion policy is used (as it should with the CHARMM
force field) nonbonded interactions of atoms separated by three bonds (i.e.,
D PARAMETER FILES 107
atoms 1 and 4 in the chain 1-2-3-4) are modified. Even if the scaling factor for
electrostatics is 1.0 (as it should be for modern CHARMM force fields), special
modified van der Waals parameters are used for 1-4 pairs of atoms for which
they are specified, as in the examples below.
The parameter file ends with a reference to parameters for explicit hydrogen
bond energy terms. These are obsolete, no longer present in the CHARMM
force field, and therefore not implemented by NAMD.
HBOND CUTHB 0.5 ! If you want to do hbond analysis (only), then use
! READ PARAM APPEND CARD
! to append hbond parameters from the file: par_hbond.inp
END
For information on how the parameters have been derived, you must consult
the corresponding publications referenced in the parameter files themselves or
listed on the MacKerell web site http://mackerell.umaryland.edu/charmm_ff.shtml.
E NAMD CONFIGURATION FILES 108
structure mypsf.psf
coordinates mypdb.pdb
Setting the Tcl variable $temperature makes it easy to change the target
temperature for many options.
If we are starting from scratch, we’ll use the coordinates from the PDB
file and take velocities randomly from a Boltzmann distribution, using the
$temperature variable.
# starting from scratch
temperature $temperature ;# initialize velocities randomly
Otherwise we’ll read in the binary output files of the previous run. We
use the Tcl variable $inputname to avoid errors in typing the input file names,
since we will end up copying and modifying this file several times during the
course of a long simulation. The extendedSystem file holds the periodic cell
dimensions that are needed to continue after a constant pressure simulation.
In order to start numbering timesteps with the final step of the previous run,
we use firsttimestep to specify the timestep on which the input coordinates
and velocities were written. The number of steps calculated in this run will be
numsteps - firsttimestep.
# continuing a run
set inputname myinput ;# only need to edit this in one place!
binCoordinates $inputname.coor ;# coordinates from last run (binary)
binVelocities $inputname.vel ;# velocities from last run (binary)
extendedSystem $inputname.xsc ;# cell dimensions from last run
firsttimestep 50000 ;# last step of previous run
numsteps 100000 ;# run stops when this step is reached
The outputName prefix will be used to create all of the trajectory (.dcd, .xst),
output (.coor, vel, .xsc), and restart (.restart.coor, .restart.vel, .restart.xsc) files
generated by this run. Be careful that this is different from $myinput, or the
job will overwrite its input files!
outputName myoutput ;# base name for output from this run
We will write restart files, coordinate trajectory .dcd files, and extended
system (periodic cell) trajectory .xst files at regular intervals.
restartfreq 500 ;# 500 steps = every 1ps
dcdfreq 500
xstFreq 500
The default is to print energies every steps, but that makes for a very long
file, so we’ll cut it down to every 100 steps. We’ll also enable the printing of
performance information every 1000 steps.
outputEnergies 100 ;# 100 steps = every 0.2 ps
outputTiming 1000 ;# shows time per step and time to completion
Next are the parameter file itself and the options that control the nonbonded
potential functions. These are mostly specified by the CHARMM force field,
but the cutoff and other distances may be shortened when full electrostatics are
used; Just be sure that you adjust all of the distances together. The pairlistdist
can be made longer if you see warnings in the NAMD output, but making it
bigger than necessary will reduce performance.
E NAMD CONFIGURATION FILES 110
# Force-Field Parameters
paraTypeCharmm on
parameters par_all27_prot_lipid.inp
# Integrator Parameters
timestep 2.0 ;# 2fs/step
rigidBonds all ;# needed for 2fs steps
nonbondedFreq 1 ;# nonbonded forces every step
fullElectFrequency 2 ;# PME only every other step
Langevin dynamics balances friction with random noise to drive each atom
in the system towards a target temperature. The following parameters are good
for equilibration, but a langevinDamping as low as 1. would be sufficient for
simulation. Higher damping may be necessary if, for example, work done on the
system by steering forces is driving up the temperature.
If the simulation will use periodic boundary conditions, they are specified
as shown below. Like the temperature option, these should only be given
when starting a simulation from scratch, since the basis vectors will fluctuate
during constant pressure simulation and updated values need to be read via
extendedSystem from a .xsc file.
The cell origin is the one coordinate that does not change during constant
pressure simulation. This point plays a role in calculating the pressure contri-
bution due to fixed atoms, harmonic restraints, and other “external” forces. To
minimize pressure fluctuations, this point should be close to the center of the
macromolecule of interest.
The origin also defines the center of the periodic cell to which coordinates will
be wrapped on output if the following options below are used. With wrapping,
some molecules will jump between sides of the cell in the trajectory file to yield
the periodic image nearest to the origin. Without wrapping, molecules will
have smooth trajectories, but water in the trajectory may appear to explode as
individual molecules diffuse. Wrapping only affects output, not the correctness
of the simulation.
Particle mesh Ewald (PME) full electrostatics are more accurate and less
expensive than larger cutoffs, and are recommended for most work. PME is
only applicable to periodic simulations, and the user must specify a grid corre-
sponding to the size of the periodic cell. PME grid dimensions should have small
integer factors only and be greater than or equal to length of the basis vector.
To manually define the grid size instead of letting NAMD choose the dimensions
for you according to these guidelines, replace the GridSpacing command with
explicit GridSize commands instead.
langevinPiston on
langevinPistonTarget 1.01325 ;# pressure in bar -> 1 atm
langevinPistonPeriod 100. ;# oscillation period around 100 fs
langevinPistonDecay 50. ;# oscillation decay time of 50 fs
langevinPistonTemp $temperature ;# coupled to heat bath
fixedAtoms on
fixedAtomsFile myfixedatoms.pdb ;# flags are in this file
fixedAtomsCol B ;# set beta non-zero to fix an atom
IMDon on
IMDport 3000 ;# port number (enter it in VMD)
IMDfreq 1 ;# send every 1 frame
IMDwait no ;# wait for VMD to connect before running?
Now we minimize the system to eliminate bad initial contacts, reinitialize the
velocities to the desired target temperature (since minimization sets velocities
to zero), and run for 100 ps. We could accomplish the same thing with two
different NAMD runs using the numsteps and minimization options. Scripting
commands such as those below override numsteps.
Naturally, these are not all of the configuration options accepted by NAMD,
but only a rapid introduction to those you are most likely to encounter. Docu-
mentation for these and many other options can be found in the Users Guide.
F NAMD STANDARD OUTPUT 114
This is followed by a long list of the various configuration options and sum-
maries of information extracted from the parameter and structure files. This is
mostly self-explanatory and just restates the config file options, or the defaults
for options not specified.
NAMD goes through several phases to setup data structures for the actual
simulation, reporting memory usage (for the first process only!). Patches are
the cells that NAMD uses to spread atoms across a parallel simulation, although
the size of the patch grid is independent of the number of processors being used.
Energies, along with temperatures and pressures, are printed as a single line
with a unique prefix for easy processing with utilities such as grep and awk. An
ETITLE line is printed once for every ten ENERGY lines. The spacing of the
fields, however, is designed to be easy to scan on an 80-column display, as seen
below:
Info: Benchmark time: 47 CPUs 0.0475851 s/step 0.275377 days/ns 13540 kB memory
Periodic performance output, if enabled, shows the CPU and wallclock time
used by the first processor (not the aggregate of all processors in the simulation).
The hours remaining are estimated based on performance since the last TIMING
output.
F NAMD STANDARD OUTPUT 116
It is important to search the NAMD output for Warning and ERROR lines,
which report unusual and possibly erroneous conditions. In the example below,
the pairlist distance is too short or the cycle length is too long, possibly leading
to reduced performance.
### Determine the center of mass of the molecule and store the coordinates
set cen [measure center [atomselect top all] weight mass]
set x1 [lindex $cen 0]
set y1 [lindex $cen 1]
set z1 [lindex $cen 2]
set max 0
### Determine the distance of the farthest atom from the center of mass
foreach atom [[atomselect top all] get index] {
set pos [lindex [[atomselect top "index $atom"] get {x y z}] 0]
set x2 [lindex $pos 0]
set y2 [lindex $pos 1]
set z2 [lindex $pos 2]
set dist [expr pow(($x2-$x1)*($x2-$x1) + ($y2-$y1)*($y2-$y1) +
($z2-$z1)*($z2-$z1),0.5)]
if {$dist > $max} {set max $dist}
}
### Solvate the molecule in a water box with enough padding (15 A).
### One could alternatively align the molecule such that the vector
### from the center of mass to the farthest atom is aligned with an axis,
### and then use no padding
package require solvate
solvate ${molname}.psf ${molname}.pdb -t 15 -o del_water
resetpsf
package require psfgen
mol new del_water.psf
mol addfile del_water.pdb
readpsf del_water.psf
coordpdb del_water.pdb
### Determine which water molecules need to be deleted and use a for loop
### to delete them
set wat [atomselect top "same residue as {water and ((x-$x1)*(x-$x1) +
(y-$y1)*(y-$y1) + (z-$z1)*(z-$z1))<($max*$max)}"]
set del [atomselect top "water and not same residue as {water and
((x-$x1)*(x-$x1) + (y-$y1)*(y-$y1) + (z-$z1)*(z-$z1))<($max*$max)}"]
G WATER SPHERE TCL SCRIPT 118