NAMD Pair Interaction Tutorial
 
 
 
 
In this tutorial, you will learn how to calculate the forces between groups of atoms and their evolution over a ready trajectory file (.dcd).
 
 
 
 
Preparing Trajectory Analysis Configuration Script
 
 
This configuration file uses "run 0" command of NAMD which outputs the pair interaction energies and forces over the trajectory file without performing any dynamics. A sample script would go like this:
 
 
****************
 
 

# initial config
# this is your standard pdb file (generated using PSFgen) that you put under common folder
coordinates ../common/1vii0RMSD.pdb
temperature 0

# output params
outputname osman
binaryoutput no

# integrator params # 2 fs step size
timestep 2.0

# force field params
# these should be the same as the lines you have used during your first NAMD run
# that you generated the .dcd file
paraTypeCharmm on
structure ../common/1vii0RMSD.psf
parameters ../common/par_all27_prot_lipid.inp
exclude scaled1-4
1-4scaling 1.0
switching on
switchdist 10.0
cutoff 12.0
pairlistdist 13.5
stepspercycle 10

# provide information about the cell size
# these are yet again same as that of your previous .conf file
cellBasisVector1 42. 0. 0.
cellBasisVector2 0. 35. 0.
cellBasisVector3 0. 0. 35.
cellOrigin 4. 1.5 2.5
wrapAll on

# Atoms in group 1 have a 1 in the B column; group 2 has a 2. This script will calculate their interaction forces
pairInteraction on
pairInteractionFile ../common/pair.pdb
# this is the file where you provide the group numbers
pairInteractionCol B
# we use the B-Factor column to specify which atoms belong to group 1 & 2
pairInteractionGroup1 1
# flag to include atoms in group 1
pairInteractionGroup2 2
# flag to include atoms in group 2

# First frame saved was frame 0.
# You can check which frame numbers are written in your .dcd file
# by looking at the first column of your .xst file
set ts 0

# this line opens the .dcd file for reading and deriving energies
coorfile open dcd 1vii0RMSD.dcd

# Read all frames until nonzero is returned.
while { ![coorfile read] } {
# Set firstTimestep so our energy output has the correct TS.
firstTimestep $ts
# Compute energies and forces, but don't try to move the atoms.
run 0
# this is your incremental time step
incr ts 20000
}
coorfile close

 
 
****************
 
 
Now we are ready to get the time dependent force vectors using NAMD. Before that, let's analyze pair.pdb file.
 
 
 
 
 
 
 
 
In pair.pdb file, we modified the B-Factor column so that, the protein atoms are in group 1, and water molecules and ions are in group 2. Down the line, we will find the interaction energy between water+ion and the protein. Also, we will find the force exerted on the protein by water.
 
 
 
 
Running the Script
 
 
 
 
Connect to your hyper computer terminal. Unzip this folder and load it to your account space in hyper computer. This folder includes files that were generated during a full NAMD run. Go to the folder run1/. In the command line type:
 
 
/usr/local/bin/namd2 osman.conf > osman.log
 
 
 
 
Starting this script will generate a new file named osman.log. In this file, you can find the force vector components and the energies of interaction. Let's look at this log file:
 
 
 
 
 
 
 
 
In this file, we see the pair interaction information, the energies and forces calculated for each .dcd frame. The format of the force line is PAIR INTERACTION: STEP: step VDW_FORCE: fx fy fz ELECT_FORCE: fx fy fz. The displayed force is the force on atoms in group 1 and is units of kcal/mol/Å. For example, at step 0, the VDW forces applied by water and ions on the protein in the x-direction is -3.3021.
 
 
 
 
Possible Extensions
 
 
If you want to calculate the changing forces between two residues 41 and 43 for example, go to the B-Factor columns of residue 41 and 43 and write their group names (1.00, 2.00) there. Set all the other B-Factor values equal to 0.00. If you want to find all the force vectors acting on residue 41 seperately, you should write an extra script that calls /usr/local/bin/namd2 osman.conf > osman.log each time modifying pair.pdb accordingly. Running this extra script through the command line is not good at all for the hyper computer. Please use a hyper computer job submission file for that script as it takes quite a long time calculating forces.