NAMD

Nanoscale Molecular Dynamics (NAMD) is a parallel molecular dynamics program for UNIX platforms designed for high-performance simulations of large molecules. This program is a collection of different executables (e.g. charmd, charmrun, namd2, etc.) that uses a configuration file containing different simulation parameters as an input.

Molecular dynamics simulations calculate the time dependent behavior of a molecular system by solving equations of motions using force fields . Molecular dynamics are used by computational chemists to visualize movement of large molecules such as proteins and receptor-ligand complexes which can be used in various applications such as understanding molecules in terms of atomic properties, determination of spatial molecular structures, prediction of structural and free energy changes of systems and prediction of protein-ligand interactions that can lead to drug discovery.

Setting-up the Systems

The common input files for NAMD are the coordinates and topology files of the system you want to simulate. These can be generated by using the AmberTools software which is a collection of mechanical force fields (ff14SB, gaff, etc.) and molecular simulations programs (xLeaP, antechamber, etc.). AmberTools is the freeware version of Amber and it can be downloaded directly from the internet.

  1. The root input file of a molecular dynamics simulation is the protein’s crystal structure. Upon elucidation, the coordinates and the structure of the protein is commonly deposited in the Protein Data Bank as a pdb file. These files can be downloaded freely from any PDB website.

  2. Once downloaded, view the pdb file’s content using a text editor. The PDB file is composed of remarks about the crystal structure, how it was elucidated, missing residues, if there is any, and atoms’ coordinates. To “clean” the pdb file, issue the command
    $ pdb4amber -i <pdb file> -o <output pdb file> [options]
    
    This command removes information unimportant for a NAMD simulation. The most common options are -y (to remove hydrogen atoms)
    and -d (to remove water molecules) since the next step involves the use of xLeaP, a program which cannot load pdb files with hydrogen atoms. 
    
  3. To mimic its natural state, molecular dynamics simulations commonly require solvated sytems. To prepare one, open the xLeaP program by issuing the following command in your terminal.
    $ xleap 
    

        3.1 Load the appropriate force field (ff14SB for proteins)
    xleap : source leaprc.ff14SB
    

        3.2 Load the protein’s pdb
    xleap : <desired protein name> = loadpdb <pdb file>
    




        3.3. To solvate a protein, issue the command:
    xleap : solvatebox <protein name> <solvent> <size>
    

    NOTE: 
    Solvents like water were already loaded alongside the ff14SB force field. The most commonly used water model is TIP3P (the water
    solvent is TIP3PBOX). To load other solvents (e.g. hydrocarbons, alcohols, etc.), prepare a preparation file (prepi) and 
    coordinates file (frcmod) using the antechamber program.
    




        3. 4. Check the charge of the protein
    xleap : charge <protein name> 
    
    If the system is charged, add ions by issuing the command: 
    
    xleap : loadamberparams <force field of the desired counter ion> 
    xleap : addions <protein name> <counter-ion> 0
    

    NOTE: Common counter-ions are the monovalent ions Na+ and K+ whose parameters can be loaded using the force field frcmod.ionsjc_tip3p 
    (if the solvent is TIP3PBOX). The list of force fields can be found in $AMBERHOME/dat/leap/params.
    




        3. 5. To view the system
    xleap : edit <prot name>
    




        3. 6. Save the system’s topology and coordinates
    xleap : saveamberparm <protein name> <topology file>.top <coordinates file>.crd
    




        3. 7 Save the pdb file
    xleap : savepdb <protein name> <desired system name>.pdb
    
    NOTE: 
    Molecular dynamics are not only limited to solvated proteins. For further reading, download the Amber and AmberTools manual from the Amber website.
    
  4. To view the prepared system outside xLeaP, download the freeware VMD. Follow the README file in the vmd folder to install. After installation, issue the command below and look for your system's pdb.
    $ vmd
    

NAMD Program

NAMD simulations are commonly divided into four parts, minimization, heating, equilibration and production. Minimization is done to attain the system’s lowest energy state while heating is done to increase the temperature of the system from 0 K (crystal structure) to the desired temperature and on the desired interval. After heating, the system is equilibrated. The production steps, which commonly spans for 20 ns or 2 x 107 steps, then follow. Therefore, the flow of a NAMD simulation is minimization (104 steps), heating ( 104 steps for each interval), equilibration (106 steps) and production. The production part is commonly cut to parts since a 2 ns NAMD simulation that uses 16 processors takes about 9 hours to finish.

To perform NAMD simulations, NAMD configuration files are needed. These files contain simulation parameters like the system’s center, simulation steps, and output files’ names.

The NAMD program is freely downloadable in the internet. Unless you downloaded the source file, untarring the file is enough to install the binaries inside. Common executables inside are namd2 (binary that will read the configuration file) and charmrun (binary that enables parallel computing).

NAMD Simulation in CoARE HPC

  1. Transfer the folder containing your system, and your system’s NAMD configuration files to the HPC cluster through the scp command.

  2. To install the NAMD software, you can either load the pre-compiled NAMD in the HPC cluster or transfer a NAMD folder containing the NAMD binaries (i.e. namd2 and charmrun).
        2. 1. To load a module, issue the command
    $ module load <namd package name>/<package version>  
    
    To automatically load the NAMD software on log-in, add the above command in the ~/.bashrc file. 
    

        2. 2. To transfer a NAMD folder from your local computer, use the scp command.

  3. Edit the contents of the configuration files by viewing it using a text editor.

        3. 1. Minimization
    • 3. 1. 1. Edit the parmfile and ambercoor sections by changing them to the directory of the topology and coordinate files.
      Change outputName to the name of the output files.
    • 3. 1. 2. The temperature at set temperature should be more or less at room temperature
    • 3. 1. 3. Set the firsttimestep to zero
    • 3. 1. 4. Determine the system’s coordinates and its center using VMD. After issuing the vmd command,
      select File -> New Molecule. Select Browse and look for your system’s topology file.
      Change the item in the dropdown menu to AMBER7 Parm. Click Load.





      Do the same to the coordinate file but the change the Determine file type to AMBER7 Restart.





      The end product presented in the VMD viewer should look like your system’s pdb file.





      In the main VMD Menu, click Extensions then TkConsole. Then issue the following commands
           
      $ set <variable> [atomselect top all]
      
      $ measure center $<variable>
      
      $ measure minmax $<variable>
      
      NOTE: 
      The first set of values in the minmax command are the minimum coordinates of the system. 
      Likewise, the second set of values are the maximum coordinates. The first value in the 
      parenthesis is for the x-coordinate, the second is for the ycoordinate and the third for the z-coordinate. 
      
      




    • 3. 1. 5. Change cellBasisVector1 to <x-coordinate of Max-Min+1> 0 0
    • 3. 1. 6. Change cellBasisVector1 to 0 <y-coordinate of Max-Min+1> 0
    • 3. 1. 7. Change cellBasisVector1 to 0 0 <z-coordinate of Max-Min+1>
    • 3. 1. 8. Change CellOrigin to the center of the system
    • 3. 1. 9. Change the minimize section to the desired number of steps


      3. 2. Heating
    • 3. 2. 1. Change the outputName. Ensure that you can differentiate the outputs of each simulation (i.e. for heating, include <output name>_heat in the output name).
    • 3. 2. 2. Change bincoordinates to /path/to/minimization/output/<minimization output name>.restart.coor
    • 3. 2. 3. Change binvelocities to /path/to/minimization/output/<minimization output name>.restart.vel
    • 3. 2. 4. Change extendedsystem to /path/to/minimization/output/<minimization output name>.restart.xsc
    • 3. 2. 5. Ensure that the initial temperature is set to 0 (crystal structure). Change the final temperature to the desired temperature.
    • 3. 2. 6. Change the run value to the desired number of steps per interval.


      3. 2. Equilibration
    • 3. 2. 1. Change the outputName. Ensure that you can differentiate the outputs of each simulation (i.e. for equilibration, include <output name>_eq in the output name).
    • 3. 2. 2. Change bincoordinates to /path/to/heating/output/<minimization output name>.restart.coor
    • 3. 2. 3. Change binvelocities to /path/to/heating/output/<minimization output name>.restart.vel
    • 3. 2. 4. Change extendedsystem to /path/to/heating/output/<minimization output name>.restart.xsc
    • 3. 2. 5. Change the run value to the desired number of steps. Commonly, 106 is enough for the system to equilibrate.


      3. 2. Production
    • 3. 2. 1. Change the outputName. Ensure that you can differentiate the outputs of each simulation (i.e. for production 1, include <output name>_prod1 in the output name).
    • 3. 2. 2. Change bincoordinates to /path/to/equilibration/output/<minimization output name>.restart.coor
    • 3. 2. 3. Change binvelocities to /path/to/equilibration/output/<minimization output name>.restart.vel
    • 3. 2. 4. Change extendedsystem to /path/to/equilibration/output/<minimization output name>.restart.xsc
    • 3. 2. 5. Change the run value to the desired number of steps (106 is equal to 2 ns simulation).


      3. 3. For the succeeding production simulations, just edit the outputName, bincoordinates, binvelocities, and extendedsystem sections.
      You can also just make one production configuration file and change the run value to 2 x 107 steps (20 ns simulation) but this is not recommended since it is prome to problems (i.e. technical problems like the server shutting down).

  4. Since the jobs in HPC are managed by SLURM, prepare a SLURM file before running a simulation. Presented below is a sample SLURM script for NAMD simulations:
    #!/bin/bash 
    #SBATCH --partition=<partition type> ## Common partition types are batch and debug 
    #SBATCH --nodes=<no. of physical nodes> 
    #SBATCH --ntasks-per-node=<no. of processors> 
    #SBATCH --mem=<allocated memory> 
    #SBATCH --job-name=<job-name> 
    #SBATCH --output=<output name> 
    #SBATCH --mail-user=<user e-mail> 
    #SBATCH --mail-type=ALL## Included to send an e-mail to the user indicating whether or not the job is completed 
    #SBATCH --requeue ## To requeue a current runnning job
    
    configfile = /path/to/config/file/<configfile>.conf 
    charmrun = /path/to/charmrun/charmrun 
    namd2 = /path/to/namd2/namd2
    
    $charmrun +p<no. of physical nodes> $namd2 +isomalloc_sync $configfile > <outputfile>
    

  5. Submit the job using the sbatch command but since NAMD simulation is a step-by-step process, add the depend option.
    $ sbatch <slurmfile1>.slurm     
    $ sbatch –depend=afterok:<slurmfile1 job id> <slurmfile2>.slurm          
    
    NOTE: 
    Before running a simulation, make sure that the active files are in the scratch directories.
    

  6. To monitor your job, issue the command
    $ squeue [options]          
    
    To ensure that the namd2 is running, you can tail the output file by issuing the command     
    $ tail -fv <outputfile>
    

1.jpg (110 KB) Glenda Mae Baldonado, 01/19/2017 05:35 PM

2.jpg (115 KB) Glenda Mae Baldonado, 01/25/2017 04:01 PM

3.jpg (101 KB) Glenda Mae Baldonado, 01/25/2017 05:07 PM

4.jpg (216 KB) Glenda Mae Baldonado, 01/31/2017 01:26 PM

5.jpg (72.5 KB) Glenda Mae Baldonado, 01/31/2017 01:30 PM

6.jpg (31.5 KB) Glenda Mae Baldonado, 01/31/2017 01:30 PM

7.jpg (32.4 KB) Glenda Mae Baldonado, 01/31/2017 01:30 PM

8.jpg (268 KB) Glenda Mae Baldonado, 01/31/2017 01:30 PM

9.jpg (61.8 KB) Glenda Mae Baldonado, 01/31/2017 01:30 PM