Tutorial#

Molecular dynamics simulation of DHFR#

DHFR (dihydrofolate reductase) is a globular protein commonly used as a benchmark in MD simulations.

For the MD simulation with ACEMD, you need:

  • Prepare the simulation system and corresponding force field files

  • Write an input file

  • Run the simulation

All these tasks can be done easily with HTMD: follow the tutorial of the molecular dynamics protocols.

In this tutorial, we show how to run the MD simulation with ACEMD directly:

  • ACEMD installation already contains files for the DHFR simulation with CHARMM 36 force field. Copy them to an empty directory:

    $ cd /tmp
    $ cp -r  $(dirname $(which acemd))/../share/acemd/dhfr_charmm .
    $ cd dhfr_charmm
    
  • The input file is for an NVT (298.15 K) simulation with 4 fs time step:

    $ cat input
    parameters    dhfr.prm
    structure     dhfr.psf
    
    coordinates   dhfr.pdb
    celldimension 62.23 62.23 62.23
    
    thermostat    on
    
    run           250000
    

    The other parameters are set to the default values (see the input file options for details).

  • Start the simulation:

    $ acemd input
    

    By default, ACEMD runs on the first GPU (device 0). This can be changed with --device argument (see the command line arguments for details). Note that ACEMD Pro licence is required to run on different GPU.

  • During the simulation, log messages are written to the standard output and simulation trajectory is saved to output.xtc. Also, the simulation state is periodically saved to restart.chk (see the input options for details):

    $ ls -1
    dhfr.pdb
    dhfr.prm
    dhfr.psf
    input
    output.coor
    output.vel
    output.xsc
    output.xtc
    restart.chk
    

Metadynamics simulation of alaninde dipeptide#

Metadynamics (MTD) is enhanced samping algorithm. It computes free energy along a predefined set of collecitve varialbes (CVs).

ACEMD uses PLUMED library for MTD simulations and this tutorial is a short version of its MTD tutorial.

In this tutorial, we will show how to run an MTD simulation of alanine dipeptide with ACEMD:

  • ACEMD installation already contains files for the simulation. Copy them to an empty directory:

    $ cd /tmp
    $ cp -r  $(dirname $(which acemd))/../share/acemd/ala2_amber .
    $ cd ala2_amber
    
  • ACEMD input file is the same as for the conventional MD, execpt plumedFile:

    $ cat input
    parmfile      ala2.prmtop
    coordinates   ala2.pdb
    celldimension 19.23005 19.01728 19.03172
    
    thermostat    on
    plumedFile    input.plumed
    run           10ns
    

    The other parameters are set to the default values (see the input file options for details).

  • PLUMED input file contains parameters to run a well-tempered MTD simulation. The CVs are two backbone angles of alaninde dipeptide:

    $ cat input.plumed
    phi: TORSION ATOMS=5,7,9,15
    psi: TORSION ATOMS=7,9,15,17
    
    METAD ...
      ARG=phi,psi
      PACE=500
      HEIGHT=1.2
      SIGMA=0.35,0.35
      BIASFACTOR=6.0
      FILE=HILLS
      GRID_MIN=-pi,-pi
      GRID_MAX=pi,pi
      GRID_SPACING=0.1,0.1
    ...
    

    Refer to PLUMED’s MTD tutorial for a detailed explanation.

  • Run the simulation:

    $ acemd input
    

    During the simulation, in addition to ACEMD output files, PLUMED writes HILLS file with a bias potential.

  • For analysis, we use gnuplot and PLUMED tools. You can instal them with conda:

    $ conda install -c conda-forge gnuplot plumed
    
  • Compute the free energy surface (FES) with the PLUMED tools:

    $ plumed sum_hills --hills HILLS --bin 200,200 --mintozero
    

    FES is written to fes.dat file.

  • Visualize the FES with a gnuplot script:

    $ cat fes.gp
    set title "FES of alanine dipeptide"
    set xlabel "phi [rad]"
    set xrange [-3.14159:3.14159]
    set ylabel "psi [rad]"
    set yrange [-3.14159:3.14159]
    set cblabel "Energy [kJ/mol]"
    plot "fes.dat" with image
    

    Generate the plot:

    $ gnuplot -p fes.gp
    
    ../_images/fes.png

    Note: due a stochastic nature of the simulations, your plot might look slightly different.