NAMD and VMD - TechnionYP5779/SimuMole GitHub Wiki
Table of Contents
- Overview: VMD and NAMD
- Flowchart: Producing MD simulation using NAMD
- File formats
- Example: Simulation of protein BSAP
Overview: VMD and NAMD
VMD (Visual Molecular Dynamics)
- VMD is designed for modeling, visualization, and analysis of biological systems such as proteins. VMD can be used to view a structure of general molecules (given a PDB file), and also to animate and analyze the trajectory of a MD simulation (given '.dcd' file for example).
- License: UIUC Open Source License.
- Website.
NAMD (Nanoscale Molecular Dynamics)
- NAMD is a parallel molecular dynamics code designed for high-performance simulation of large biomolecular systems. NAMD uses VMD for simulation setup and trajectory analysis, but is also file-compatible with AMBER and CHARMM.
- License: Non-Exclusive, Non-Commercial Use License.
- Website.
Notes:
- NAMD is able to use the following types of force fields: CHARMM, X-PLOR, AMBER, and GROMACS. The difference between them is expressed in the topology file and the parameter file as detailed below.
- In addition to VMD interactive interface, VMD offers a scripting interface called "Tk console" which allows Tcl commands and scripts.
- NAMD tutorial.
Flowchart: Producing MD simulation using NAMD
File formats
In order to run MD simulation, NAMD uses mainly the following kind of files:
Protein Data Bank File (pdb):
- Stores atomic coordinates of the molecule (excluding hydrogen atoms).
- NAMD and VMD ignore everything in a PDB file except for the ATOM and HETATM records. A typical ATOM record contains the following fields: The record type (ATOM), atom ID, atom name, residue name, residue ID, x, y, and z coordinates, occupancy, temperature factor, segment name, and line number.
- PDB files may be generated by hand, but they are also available via the Internet (RCSB PDB, Worldwide PDB).
Topology File:
- Stores definition of the atom types, bonds and angles between atoms as well as the number of molecules in the simulation system.
- For example, CHARMM forcefield topology files available via this link (there are different types of these files depending on the classes of molecules you have in your model, such as proteins or lipids).
Protein Structure File (psf):
- Stores all of the molecule-specific information needed to apply a particular force field to a molecular system.
- PFS files are created by NAMD by combining the relevant PDB and topology files.
Parameter File (par):
- Stores specific numerical values for the generic CHARMM potential function.
- Similarly to the topology files, the CHARMM forcefield parameter files can also be found via this link.
NAMD Configuration File (namd):
- Tells NAMD how to run the simulation. Some of the fields in this file are: the relevant pdb, pfs and parameter files, temperature, number of steps, time step, boundary conditions, and more.
- NAMD configuration files may be generated by hand or by NAND.
NAMD output files (.dcd, .vel, .coor, .xsc):
- The main file is the dcd trajectory file which contains the following information for every timestep of the simulation: the positions of the atoms, their velocities and forces.
- The DCD files are single precision binary FORTRAN files, so are transportable between computer architectures.
- There are Python packages for analyzing these dcd files, such as: MDAnalysis and Prody. These packages allow to read MD trajectories and access the atomic coordinates at each timestep of the simulation.
Example: Simulation of protein BSAP
- BSAP is the enzyme molecule determined by the client (it consists of approximately 3100 atoms).
Step 1: Delete unwanted atoms
- Open VMD.
- Load BSAP.pdb by clicking
File
→New Molecule
menu item in the VMD Main window. In theMolecule File Browser
dialog use theBrowse
button to find the file BSAP.pdb. Load it by pressing theLoad
button. In the Display window you can see the molecule. - Choose the
Extensions
→Tk Console
menu item and in the VMD TkConsole window navigate to your directory. Then, type the following commands:set BSAP1 [atomselect top "protein and not hydrogen"] $BSAP1 writepdb BSAP1.pdb
- In the previous step you created the file BSAP1.pdb, which contain the protein alone without hydrogens, and only with ATOM records.
- Quit VMD by choosing
File
→Quit
.
Step 2: Create the psf file
- Follow sections 1-2 in step 1.
- Choose the
Extensions
→Modeling
→Automatic PSF Builder
menu item. - Change the output basename to BSAP2, click on
Load input files
for loading the topology files, thenGuess and split chains
andCreate Chains
. - In the previous step you created the files BSAP2.psf and BSAP2.pdb. You can load them using VMD (first the psf file and then the pdb file) and see that hydrogens added to the molecule.
- Quit VMD by choosing
File
→Quit
.
Step 3: Solvate the system
- Follow sections 1-2 in step 1, including loading the psf file.
- Choose the
Extensions
→Modeling
→Add Solvation Box
menu item. Click onSolvate
. - In the previous step you created the files BSAP3.psf and BSAP3.pdb. You can load them using VMD and see that the molecule is inside a box of water.
- Quit VMD by choosing
File
→Quit
.
Step 4: Energy minimization and running NAMD
-
Follow section 1 in step 3.
-
Find the size of the simulation box and the coordinates of the center by type the following commands in VMD TkConsole window:
set all [atomselect top all] measure minmax $all
The output shows the coordinates of the bottom left and top right corner of the simulation box, and should look similar to that:
{2.9800000190734863 109.66799926757813 17.07900047302246} {75.91300201416016 167.93299865722656 68.68099975585938}
with these coordinates we can get the dimension of the simulation box:
x_dim y_dim z_dim 75.91 - 2.98 = 72.93 167.93 - 109.66 = 58.27 68.68 - 17.07 = 51.61 The center of the simulation box is obtained with:
measure center $all
And the output is:
39.11883544921875 139.05641174316406 42.92732238769531
-
Choose the
Extensions
→Simulation
→NAMD Graphical Interface
menu item. -
Change the output basename to BSAP4, add the relevant parameter files, select
Minimization
with 1000 steps andMD
with 1000 steps (for example). ClickEdit
→Ensemble
and Select the two options there. ClickEdit
and fill the dimensions of the box as we calculated:cell1 cell2 cell3 origin 72.93 0.00 0.00 0.00 58.27 0.00 0.00 0.00 51.61 39.11 139.05 42.92 Click
Write NAMD config file
to receive NAMD configuration file, and then clickRun NAMD
to receive all NAMD output files (the duration of this step depends on the number of time steps we determined. For 1000 steps - building the simulation took about 3 minutes). -
Quit VMD by choosing
File
→Quit
.
Step 5: Run the simulation
- Open VMD.
- Load BSAP4.pfs and BSAP4.dcd by clicking
File
→New Molecule
. In the Display window you can see the simulation (40 frames):
Notes:
- These are the necessary steps to create a simulation, but there are other optional steps, such as adding ions in step 3, equilibration of the water molecules around the protein molecule in step 4, and more.