accelerated Molecular Dynamics (aMD) Tutorial Levi Pierce 2012 NBCR Summer InsAtute
accelerated Molecular Dynamics(aMD) Tutorial
Levi Pierce 2012
NBCR Summer InsAtute
Time Scales Accessible with Molecular Dynamics
• Pierce, L.C.T.; Salomon-‐Ferrer, R.; de Oliveira C.A.; McCammon, J.A.; Walker, R.C.; RouAne Access to Millisecond Timescales with Accelerated Molecular Dynamics. in press
2
Molecular Dynamics
3
Δt ...
Δt
Ensemble of structures
• McCammon J. A., Gelin, B. R., Karplus M. Nature 267, 585 (1977)
MoAvaAon
• Why do we need to accelerate molecular dynamics?
• Can we just increase our Ame step used for integraAon?
• Can we just heat our system up?
struction of a compensating function, known as the umbrella,which is added to the true potential energy function in orderto bias the sampling to a particular set of conformations.However, construction of the umbrella requires prior knowl-edge of the conformations of interest.
Alternatively, we sought to develop a molecular dynam-ics approach based on earlier work by Voter9,10 that simulatesinfrequent events of molecular systems without any advanceknowledge of the location of either the potential energy wellsor barriers. Voter9,10 recently proposed a hyperdynamicsmethod to speed up molecular dynamics simulations by al-tering the amount of computational time systems spend inpotential energy minima in order to be able to move overpotential barriers and study long-time behavior of systems.The scheme modifies the potential energy surface, V(r), byadding a bias potential, !V(r), to the true potential such thatthe potential surfaces near the minima are raised and thosenear the barrier or saddle point are left unaffected. Statisticssampled on the biased potential are then corrected to removethe effect of the bias. In Voter’s implementation of the biaspotential, the Hessian matrix is diagonalized at each step, sothat the transition state regions can be identified, thus limit-ing its use to small systems because of its computationalcost. Alternatively, a prescription for a simple bias potentialwas proposed by Steiner et al.16 and later used by Rahmanand Tully17 in which the bias potential is chosen such that theresulting modified potentials around the minima are constantif the unmodified potential falls below a certain value. There-fore, this simple definition of the bias potential does not re-quire the diagonalization of the Hessian matrix at each step,and hence made it possible for it to be applied to largersystems. In this paper, we present a robust way of alteringthe potential energy landscape that is straightforward, pre-serves the underlying shape of the potential energy surface,and allows for the simulation to be extended to larger mo-lecular systems, like proteins. We show that our approachaccurately and efficiently explores conformational spacewith improved sampling and converges to the correct canoni-cal probability distribution.
THEORY
The general idea behind the accelerated molecular dy-namics scheme is depicted in Fig. 1. A continuous non-negative bias boost potential function !V(r) is defined suchthat when the true potential V(r) is below a certain chosenvalue E, the boost energy, the simulation is performed on themodified potential V*(r)!V(r)"!V(r), represented usingdashed lines, and when V(r) is greater than E, the simulationis performed on the true potential V*(r)!V(r). This leadsto an enhanced escape rate for V*(r). The modified potentialV*(r) is related to the true potential, bias potential, andboost energy by
V*"r#!! V"r#, V"r#$E ,V"r#"!V"r#, V"r##E .
"1#
During normal molecular dynamics simulations of biologicalmolecules on the unmodified potential surface, the systemsextensively sample conformations around a local minimum
without adequately sampling conformations elsewhere on thepotential energy surface. Therefore, the primary goal of thiswork is to develop a method for large biological systems thatis capable of accelerating the state to state evolution of asystem relative to normal molecular dynamics. The bias po-tential increases the escape rate of the system from potentialbasins, and the subsequent state to state evolution of thesystem on the modified potential occurs at an accelerated ratewith a nonlinear time scale of !t*, where
!t i*!!te%!V&r" t i#'. "2#
This allows us to advance the clock at each step dependingon the strength of !V(r), where !t is the actual time step ofthe simulation on the unmodified potential. Hence, the totalestimated simulation time becomes a statistical property andis given by Eqs. "3# and "4#,
t*!(i
N
!t i*!!t(i
N
e%!V&r" t i#', "3#
t*!t)e%!V&r" t i#'*, "4#
where N is the total number of molecular dynamics stepscarried out during the whole simulation, and )e%!V&r(t i)'* istermed the boost factor. The boost factor is a measure of theextent to which the simulation has been accelerated. At eachstep, the time step, !t*, is nonlinearly dependent on thevalue of the bias potential, !V(r). It follows from Eq. "2#that !t*!!t when the system is on the true potential, V(r),that is when !V(r)!0. If the choice of the boost energy E isvery high, then the boost factor will be very large, leading tonoisy statistics because the wells would not be sampled suf-ficiently. However, correct statistics will be obtained aftermany transitions and adequate sampling of the potential en-ergy wells.
Furthermore, it is important that this method yields cor-rect canonical averages of an observable A(r), so that ther-modynamics and other equilibrium properties can be accu-rately determined from accelerated MD simulations. Theequilibrium ensemble average value of any observable A(r)on the normal potential V(r) is given by
FIG. 1. Schematic representation of the normal potential, the biased poten-tial, and the threshold boost energy, E.
11920 J. Chem. Phys., Vol. 120, No. 24, 22 June 2004 Hamelberg, Mongan, and McCammon
Downloaded 24 Jan 2005 to 128.54.56.45. Redistribution subject to AIP license or copyright, see http://jcp.aip.org/jcp/copyright.jsp
Accelerated Molecular Dynamics • Add a bias to our potenAal energy surface to promote escape from energeAc
traps. • EquaAon as applied to total potenAal energy
• The corrected canonical ensemble average of a given property, <A>c can be obtained by reweighAng each point in the configuraAon space on the modified potenAal by the strength of the Boltzmann factor of the bias energy, exp(ΒΔV(r, ti))
!! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !! !!! ! ! ! !!
!!! !! ! ! ! ! !!!!!!!!! ! ! ! !
5
LimitaAons of aMD
• In 2008 code was not efficiently parallelized – Sander aMD implementaAon is slow
• How can we accelerate aMD? – Port method to faster codes (pmemd,NAMD) – Use Graphics Processing Units (GPUs)
0 0.5 1
1.5 2
2.5 3
1 12 24 36 48 60 72 84 96
ns/day
Number of Processors
BPTI Simula<on 17,758 Atoms
sander aMD
6
ComputaAon on the GPU • Why are they so fast? – Lots of relaAvely fast workers vs a few fast workers – Cluster (48 processors operaAng at 2.6GHz) 30ns/day – 1GTX 580 (512 processors operaAng at 770MHz) 40ns/day
• Why are they so popular now? – Compute Unified Design Architecture (CUDA)
• GPU molecular dynamics codes – ACEMD hkp://mulAscalelab.org/acemd – OPENMM hkps://simtk.org/home/openmm – AMBER (pmemd.cuda) hkp://ambermd.org/gpus/ – NAMD hkp://www.ks.uiuc.edu/Research/gpu/
7
ImplemenAng aMD on the GPU
• First ported sander aMD to pmemd • Next ported aMD to pmemd.cuda
– 1 GTX 580 43.2 ns/day cMD – 1 GTX 580 41.3 ns/day aMD
• How fast can we run aMD? – 2 GTX580 53.2 ns/day aMD
• How can we validate our implementaAon?
0 5 10 15 20 25 30 35
1 12
24
36
48
60
72
84
96
ns/day
Number of Processors
BPTI TIP4PEW NVT 18226 atoms
PMEaMD
sander aMD
GTX 580 PMEaMD
0
10
20
30
40
50
1 12
24
36
48
60
72
84
96
108
120
132
144
ns/day
Number of Processors
BPTI TIP3P NVT 18226 atoms
PMEaMD
sander aMD
NAMD aMD
GTX580 aMD
Wang, Y., et. al., ImplementaAon of Accelerated Molecular Dynamics in NAMD. Computa,onal Science & Discovery, 2011.
0
5
10
15
20
25
30
1 12 24 36 48 60 72 84 96
ns/day
Number of Processors
PKA 72277 atoms
PMEaMD
NAMD aMD
GTX 580 PMEaMD
0 5
10 15 20 25 30
1 12 24 36 48 60 72 84 96
ns/day
Number of Processors
BPTI 17,758 atoms NVT
PMEaMD
sander aMD 0
10 20 30 40 50
1 12 24 36 48 60 72 84 96
ns/day
Number of Processors
BPTI 17,758 atoms NVT
PMEaMD
sander aMD
GTX580 aMD
0
10
20
30
40
50
1 12
24
36
48
60
72
84
96
108
120
132
144
ns/day
Number of Processors
BPTI 17,758 atoms NVT
PMEaMD
sander aMD
NAMD aMD
GTX580 aMD
Lindert, S.; Kekenes-‐Huskey, P.; Huber, G.; Pierce, L.C.T.; McCammon, J.A.; Dynamics and Calcium AssociaAon to the N-‐Terminal Regulatory Domain of Human Cardiac Troponin C: A MulA-‐Scale ComputaAonal Study. J. Chem. Phys. B. 2012
8
Protocol Outline
• Run convenAonal molecular dynamics unAl dihedral and total potenAal energy are converged usually 10-‐50ns is all that is needed
• Compute the Ecut and alpha needed for boosAng dihedral potenAal
• Compute Ecut and alpha needed for boosAng total potenAal
• Fire off aMD simulaAon!
Amber12 BPTI Example Step 1 Running ConvenAonal Molecular Dynamics (cMD)
• I generally run 10ns of NVT dynamics and then look at the output log for the average total potenAal energy and dihedral energy
• You can also grep EPtot and DIHED out from your log file and compute the averages
A V E R A G E S O V E R 25000 S T E P S NSTEP = 25000000 TIME(PS) = 56000.000 TEMP(K) = 300.02 PRESS = 0.0 Etot = -‐39246.4544 EKtot = 7882.3144 EPtot = -‐47128.7688 BOND = 179.6315 ANGLE = 430.3040 DIHED = 595.3485 1-‐4 NB = 203.3891 1-‐4 EEL = 1779.4670 VDWAALS = 7637.5034 EELEC = -‐57954.4124 EHBOND = 0.0000 RESTRAINT = 0.0000 -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐
Amber12 BPTI Example Step 2 Compute EthreshP and alphaP
• First calculate alphaP from the total number of atoms
• To calculate EthreshP you need the average Eptot and the total number of atoms in your system EthreshP= -‐47128 kcal mol-‐1 + alphaP = -‐44212 kcal mol-‐1
alphaP= (0.16kcal mol-‐1 atom-‐1 * 18,226 atoms) = 2916 kcal mol-‐1
Grant, B. J.; Gorfe, A. A.; McCammon, J. A., Ras conformaAonal switching: simulaAng nucleoAde-‐dependent conformaAonal transiAons with accelerated molecular dynamics. PLoS Comput. Biol. 2009, 5, (3), e1000325. de Oliveira, C. A. F.; Grant, B. J.; Zhou, M.; McCammon, J. A., Large-‐Scale ConformaAonal Changes of Trypanosoma cruzi Proline Racemase Predicted by Accelerated Molecular Dynamics SimulaAon. PLoS Comput. Biol. 2011, 7, (10), e1002178.
Amber12 BPTI Example Step 3 Compute EthreshD and alphaD
• First calculate alphaP from the total number of solute residues
• To calculate EthreshD you need the average DIHED and the total number of solute residues in your system EthreshD= 595 kcal mol-‐1 + (4kcal mol-‐1 residue-‐1 * 58 solute residues) = 46.4 kcal mol-‐1
alphaD= (1/5)*(4kcal mol-‐1 residue-‐1 * 58 solute residues) = 827 kcal mol-‐1
Grant, B. J.; Gorfe, A. A.; McCammon, J. A., Ras conformaAonal switching: simulaAng nucleoAde-‐dependent conformaAonal transiAons with accelerated molecular dynamics. PLoS Comput. Biol. 2009, 5, (3), e1000325. de Oliveira, C. A. F.; Grant, B. J.; Zhou, M.; McCammon, J. A., Large-‐Scale ConformaAonal Changes of Trypanosoma cruzi Proline Racemase Predicted by Accelerated Molecular Dynamics SimulaAon. PLoS Comput. Biol. 2011, 7, (10), e1002178.
Amber12 BPTI Example Step 4 Run aMD SimulaAon!
• For the GPU version simply run – pmemd.cuda -‐O -‐i amd.in -‐o amd1.out -‐r amd1.rst -‐x amd1.nc -‐p bpA.prmtop -‐c eq.rst
• For the effeciently parallelized CPU version run – mpirun -‐np NPROCS pmemd.MPI -‐O -‐i amd.in -‐o amd1.out -‐r amd1.rst -‐x amd1.nc -‐p bpA.prmtop -‐c eq.rst
• For the inefficient CPU version run – mpirun -‐np NPROCS sander.MPI -‐O -‐i amd.in -‐o amd1.out -‐r amd1.rst -‐x amd1.nc -‐p bpA.prmtop -‐c eq.rst
amd.in (NVT-‐CONTINUE) &cntrl imin=0,irest=1,ntx=5, nstlim=50000000,dt=0.002, ntc=2,nv=2,ig=-‐1, cut=10.0, ntb=1, ntp=0, ntpr=1000, ntwx=1000, nk=3, gamma_ln=2.0, temp0=300.0,iouvm=1, iamd=3,iwrap=1, EthreshD=827, alphaD=46.4,EthresP=-‐44212, alphaP=2916, /
Examining Results
• How do we observe more sampling from aMD compared to MD?
• PhiPsi plots of dihedral angles • RMSD • Principal Component Analysis
ReweighAng
• Using the true exponenAal – Alanine DipepAde
• Using approximaAons to the exponenAal – BPTI
Useful links
• hkp://ambermd.org/gpus/
• aMD on NAMD • hkp://www.ks.uiuc.edu/Research/namd/2.8/ug/node63.html