Introduction

In this exercise, we will learn the basics of running NAMD molecular dynamics simulations. If you haven’t done so already, you will install the program, familiarize yourself with the required files, and run a test case.

FileSet3.tar.gz

Download and install

If you haven’t done so already,
download and install the newest version of NAMD (currently 2.13. We need this latest version to use QwikMD). Follow the install directions enclosed in the download (README.txt), or look here (NAMD wiki).

There is a NAMD tutorial for OS X/linux/Unix
HERE. Files are HERE. You need to run NAMD from a terminal window, or you can run it directly from VMD. This is probably the best way to run it in order to minimize tkcon-like issues. Files for the alanine test case are HERE. If you choose to run through this NAMD tutorial, you only need to go through the “Basics of NAMD” sections. You may STOP at “Analysis”

Required files for a simulation

  • Aside from your NAMD program folder/files, you need:
  • A configuration file (any suffix, but ".nam" or ".conf" are commonly used)
  • A matched PSF/PDB pair from VMD
  • A topology file (contained within both the VMD and NAMD packages)

Configuration

A description of the NAMD configuration file is
HERE. Basically, the configuration file tells the namd program how to run the simulation, what parameters to use, and the location of the other required files (input and output). There is a VMD extension (Extensions..Simulation..NAMD Graphical Interface) which can help you generate a working NAMD configuration file. Here is a sample from the Alanine test case. Comments have been added to describe what each line does (when it isn’t obvious). Note that NAMD ignores everything after a hash “#” sign.
# This is a test namd configuration file

timestep 0.5 # 0.5 fs; this is usually 0.2 or even 0.1 fs
numsteps 10000 # total number of above steps
structure alanin.psf # absolute path (this means alanin.psf is in the working directory)
parameters alanin.params # this is normally the standard topology (top_all27...).
coordinates alanin.pdb # absolute path
exclude scaled1-4 # what forces to exclude
1-4scaling 0.4 # a parameter for above
outputname output # what is the output base name
margin 1.0 # parameter
stepspercycle 3 # a cycle is how many steps before some thermo checking is done
temperature 0 # this is K (kelvin)

switching on # switching potential
switchdist 7.0 # first cutoff (angstrom)
cutoff 8.0 # second cutoff (A)
pairlistdist 9.0 # neighborlist (A)

dcdfile alanin.dcd # what the output DCD is called
dcdfreq 20 # how often to print out DCD (20 steps)

#restartname alanin.restart # restart file name
#restartfreq 10 # how often to save a restart file

#langevin on # Langevin is a temperature bath method
#langevinTemp 300.0
#langevincol O

#constraints on # we can apply constraints to all or some or none of the atoms

#fma on # ...also forces

#seed 791064881 # random number seed
IMDon on # IMD is interactive MD... running MD through VMD
IMDport 1050 # network port is not normally changed
IMDfreq 20 # how often to send output to VMD
IMDwait yes # wait for VMD before starting simulation?
#-----------------------------------------------------------------------------

A more complete discussion of these entries is HERE.

Running a test case

It is a good idea to look at the
NAMD User Guide; This is a link to the best starting point. We are going to run this test case through VMD.

Download the files
alanin.params, alanin.psf, alanin.pdb and alanin.nam (or the whole set of files, alanin.tar.gz) to a directory on your computer. Load ‘alanin.psf’ and ‘alanin.pdb’ from the directory. You can make any graphical representation you want, as this is a small molecule. (For larger systems we will see later, minimal graphics will be required.) Open up “Extensions...Simulation..IMD Connect” from the main VMD menu. Type in “localhost” for the hostname, and “1050” for the port. DON’T click “connect” yet.

In a terminal/tkcon, make sure you are in the
alanin directory, and then type the full pathname to the ‘namd2’ executable, followed by the name of the control file. It will be ‘/Applications/NAMD_2.6_MacOSX-i686/namd2 alanin.nam’ for OS X; ‘/usr/local/bin/namd2 alanin.nam’ for linux and ‘C:\pathtoNAMD\namd2 alanin.nam’ for Windows.

Once you do this, some information will scroll by, then stop with the message:
Info: INTERACTIVE MD AWAITING CONNECTION
Now you can click ‘connect’ in the ‘IMD connect’ window. You should now see the alanin molecule wiggling, and you will also see information scrolling in the IMD Connect window. This should essentially look like a trajectory loaded from a DCD file. However, since this is happening as the simulation runs, it provides valuable insight and information on a running simulation. If something looks to be amiss, or the system has attained a desired final state, it can be stopped and the configuration file can be adjusted as needed.

Now it is is time to run your own simulation! We’ll begin with just a small protein, nothing else --- in other words, it is as if the protein is suspended in outer space (but warmer). The first step is to select an appropriate system. Here is a list of candidates from RCSB.

  • Proteins we have seen before such as 1pgb (immunoglobulin-binding domain of streptoccocal protein G - 460 atoms) or 103d (human centromere DNA - 772 atoms)
  • helix-turn-helix motifs (use this as a keyword search at RCSB) such as 2k10 (antibacterial peptide rantuerin-2csa - 479 atoms) or 1q8h (porcine osteocalcin - 378 atoms)
  • larger proteins such as 1adv or 1adu (adenovirus 5 - 4000 atoms) or 1ab3 (ribosomal protein S15 from thermus thermophilus - 1507 atoms)

You will notice that there is not a lot of *new* material this week — I expect that you will spend much of the early part of the week simply being able to construct your PSF/PDB pair. If you are able to do that quickly, so much the better! Once that is done, we will focus on the nuts and bolts of the simulation (using NAMD), and the hows and whys. You will probably need to do a lot of checking and comparing your new simulation files with your simple working case from Week 2 (alanin?). There are tools in VMD which can help — most notably the
NAMD GUI.

There is one important thing to check: NAMD needs to refer to a parameter file that matches the topology file the PSF was constructed from. If these files are mismatched, you will get an error running NAMD. To be safe, download the file
top_all27_prot_na.rtf and par_all27_prot.na.prm, and save them someplace convenient (your Chem 181 class directory?). Then when you enter the ‘topology’ command, specify the path to this file. For example, if the current working directory is Chem 181\Protein (DOS) or Chem 181/Protein (OS X/Unix), then the first two psfgen commands might be
package require psfgen
topology ../top_all27_prot_na.rtf

Next, we run through the steps needed to prepare a vacuum simulation, using tkcon for 1dfe (
find it HERE), another small protein. Commands are in red; output is in blue. Histine is either protonated or deprotonated; simulations must specify this: protonated: HSE; deprotonated HSD. Also, the atom type ‘CD1’ is not used in NAMD, so this must be aliased to ‘CD’.
mol load pdb 1dfe_prot.pdb
12
pdbalias atom ILE CD1 CD
aliasing residue ILE atom CD1 to CD
pdbalias residue HIS HSE
aliasing residue HIS to HSE
segment MAIN {pdb 1dfe_prot.pdb}
building segment MAIN
reading residues from pdb file 1dfe_prot.pdb
extracted 37 residues from pdb file
Info: generating structure...
Info: skipping improper N-C-CA-HN at beginning of segment.
Info: skipping cross-term C-N-CA-C-N-CA-C-N at beginning of segment.
Info: skipping conformation C-N-CA-C at beginning of segment.
Info: skipping conformation C-CA-N-HN at beginning of segment.
Info: skipping bond C-N at end of segment.
Info: skipping improper C-CA-N-O at end of segment.
Info: skipping cross-term C-N-CA-C-N-CA-C-N at end of segment.
Info: skipping conformation CA-C-N-CA at end of segment.
Info: skipping conformation N-CA-C-O at end of segment.
Info: skipping conformation N-CA-C-N at end of segment.
Info: segment complete.
coordpdb 1dfe_prot.pdb MAIN
reading coordinates from pdb file 1dfe_prot.pdb for segment MAIN
Warning: failed to set coordinate for atom H2 MET:1 MAIN
Warning: failed to set coordinate for atom HB3 MET:1 MAIN
Warning: failed to set coordinate for atom HG3 MET:1 MAIN
.
. (lines removed)
.
Warning: failed to set coordinate for atom OXT GLY:37 MAIN
Warning: failed to set coordinate for atom H GLY:37 MAIN
Warning: failed to set coordinate for atom HA3 GLY:37 MAIN
guesscoord
Info: guessing coordinates for 121 atoms (2 non-hydrogen)
Warning: poorly guessed coordinates for 67 atoms (2 non-hydrogen):
Warning: poorly guessed coordinate for atom HT1 MET:1 MAIN
Warning: poorly guessed coordinate for atom HT2 MET:1 MAIN
.
. (lines removed)
.
Warning: poorly guessed coordinate for atom HG1 GLN:36 MAIN
Warning: poorly guessed coordinate for atom OT1 GLY:37 MAIN
Warning: poorly guessed coordinate for atom OT2 GLY:37 MAIN
writepdb 1dfe_sim.pdb
Info: writing pdb file 1dfe_sim.pdb
Info: Atoms with guessed coordinates will have occupancy of 0.0.
Info: pdb file complete.
writepsf 1dfe_sim.psf
Info: writing psf file 1dfe_sim.psf
total of 645 atoms
total of 648 bonds
total of 1175 angles
total of 1705 dihedrals
total of 105 impropers
total of 35 cross-terms
Info: psf file complete.
mol delete all
mol load psf 1dfe_sim.psf pdb 1dfe_sim.pdb


At this point, you can start up the NAMD GUI to create the control file. When you are done, the specified parameter file path is probably incorrect, and must be fixed. Find the line similar to
parameters /usr/local//toppar/par_all27_prot_na.prm
and change the line to specifiy the
par_all27_prot_na.prm file you downloaded at the top of the page. Again, using the example from the top of the page, if you the current working directory is ‘Chem 181\Protein’ (or ‘Chem 181/Protein’), you would change this line to
parameters /Users/mccallum/Chem181/Protein/par_all27_prot_na.prm
Also remember to fix the parameter line, and add IMD commands if you wish to watch your simulation run via VMD.

Be sure to ask Prof. McCallum for help with these commands if you need it!

Back: VMD: Movies


Next: Shells