Computing free energies with PLUMED 2.0

Davide Branduardi Formerly at MPI Biophysics, Frankfurt a.M.

Wednesday, October 16, 13 TyOutline of the talk

Relevance of free energy computation

Free-energy from histograms: issues

Tackling the sampling problem

Tackling the order-parameter problem

2

Wednesday, October 16, 13 TyRelevance of free energy calculations

Free energy is a measure of probability A(s )= k T ln P (s ) 0 B 0 Chemical find elusive structures Biophysics reactions and mechanisms! A‡

A Free Energy React Prod Molecular Phase s (RC) recognition transitions Drug binding

3

Wednesday, October 16, 13 TyRare event: troubles with ergodic hypothesis

kBT A‡/RT k(T )= e ‡ 0

A hc 1 k T 2 B Free Energy React Prod RC

Now I sampled all the two stop?

states. Is it sufficient? property

time Free energy requires statistics!

1 N1 property A = ln time N2 [3] Eyring, Chem. Rev. 1935 vol. 17 pp 65 4

Wednesday, October 16, 13 TyA test on ATP-Mg2+ in water ATP4--Mg2+ is of fundamental importance in bioenergetics and regulation Free energy of α β γ to β γ

α β γ β γ

OW2 OW3 OW4 OW1 OW3 OW4 Mg + + O1α OW2 O2α O2α O1α

[1] Liao, Sun, Chandler, Oster Eur. Biophys. J. 2004, vol. 33, p. 29 5

Wednesday, October 16, 13 TyErgodic hypothesis: am I visiting all the states?

Classical MD, CHARMM27 force field, 915 TIP3P water molecules, GROMACS 4.5.5 code 6

Wednesday, October 16, 13 TyPossible solutions

Replica exchange methods: multiple simulations at different temperatures or Hamiltonians

Biased dynamics: add a potential function along the degree(s) of freedom you want to accelerate

Biased dynamics + Replica exchange

7

Wednesday, October 16, 13 TyThermodynamic-Integration-like approaches

The ancestor is mean force calculation through harmonic potential F (s)= k T ln P (s) B ⇥F (s) 1 ⇥ V (x) kB T = kBT V (x) e (s0(x) s)dx ⇥s s0 k T ⇥s s0 e B (s0(x) s)dx Z Dirac delta functionR ≈ Gaussian function (I like this trick!)

V (x) k 2 F (s) 1 (s0(x) s) k T e kB T e 2kB T dx B V (x) k 2 s s0 ' k T 2k T (s0(x) s) s s0 e B e B dx Z It is an averageR of a biased simulation!

V (x)+k/2(s (x) s )2 F (s) 1 0 0 kB T 2 k(s0(x) s0)e dx = k s0(x) s0 bias,s0 V (x)+k/2(s (x) s0) s s0 ' 0 h i e kB T dx Z V (x)+k/2(s (x) s )2 F (s) 1 0 0 kB T R 2 k(s0(x) s0)e dx = k s0(x) s0 bias,s0 V (x)+k/2(s (x) s0) s s0 ' 0 h i (opposite of the “mean force”) e kB T dx Z 8 R Wednesday, October 16, 13 TyThermodynamic Integration 101

Make a constrained simulation (go over barrier!)

Acquire mean force probability Integrate descriptor

descriptor

descriptor or +WHAM etc... 9

Wednesday, October 16, 13 TyAn example with ATP-Mg2+

12

9

6

3

0

Free energy (kcal/mol) -3

-6

2 2.5 3 3.5 4 4.5 5 5.5 6 Distance (Å) Mg Mg

O2α O2α

10

Wednesday, October 16, 13 TyThermodynamic-Integration-like approaches

Beveridge, DiCapua, Annu Rev Biophys Biophys Thermodynamic integration Chem 1989, vol 18, pp. 431.

WHAM Roux, Comp Phys Comm 1995, vol. 91, pp. 275.

Free energy perturbation Beveridge, DiCapua, Annu Rev Biophys Biophys Chem 1989, vol 18, pp. 431. Jarzynski-equation based approaches (steered-MD) Jarzynski Phys Rev Lett 1997, vol. 78, pp. 2690. Crooks-equation based approaches (two directions steered-MD) Crooks J Stat Phys 1998, vol. 90, pp. 1481.

11

Wednesday, October 16, 13 TyAvoid recoding with

MD Enhanced Each single engine had positions sampling only few enhanced time=t sampling techniques calculate (according developers’ interests) forces additional (history time=t in NAMD, GROMACS, dependent) AMBER, LAMMPS, evolution forces QUANTUM-ESPRESSO time=t+∆t

https://github.com/plumed/plumed2

Bonomi, Branduardi, Bussi, Camilloni, Provasi, Raiteri, Donadio, Marinelli, Pietrucci, Broglia, Parrinello, M. Comp. Phys. Commun. 2009, 180, 1961–1972. Tribello, Bonomi, Branduardi, Camilloni, Bussi Comp. Phys. Commun. (2013) in press. 12

Wednesday, October 16, 13 TyNow in ESPResSo: http://davidebr.github.io/espresso/

13

Wednesday, October 16, 13 TyHow to set this up in PLUMED?

Mg

O2α

k m(X,t)= (d(X) x (t))2 2 0 NN x x d SOD PHO 1 | i j | 0 r0 c(X)= MM ⇣ x x d ⌘ i j 1 | i j | 0 X X r0 ⇣ ⌘ c(X) > 0.2:U(X)=k (c(X) 0.2)4 c(X) < 0.2:U(X)=0.

14

Wednesday, October 16, 13 TyAn example with ATP-Mg2+

12 Forward Backward 9

6

3

0 Hysteresis! Free energy (kcal/mol) Free energy (kcal/mol) -3

-6

2 2.5 3 3.5 4 4.5 5 5.5 6 Distance (Å) Mg Mg

O2α O2α

15

Wednesday, October 16, 13 TyAdaptive methods: Torrie & Valleau[3]

Free energy: Free energy for a biased system:

use biasing potential to overcome barriers and retrieve free energies

[3] Torrie, Valleau J. Comp. Phys, 1977 vol. 23, pp 187 16

Wednesday, October 16, 13 TyLessons from Torrie & Valleau

Biasing potentials: Metastabilities are removed biasing pot 1 k T 2 B resulting potential

1 k T 2 B Free Energy React Prod Free Energy React Prod RC RC allow to measure free energies: useful allow to overcome barriers: cheap need only an additional energy term to standard force field: easy

[3] Torrie, Valleau J. Comp. Phys, 1977 vol. 23, pp 187 17

Wednesday, October 16, 13 TyAdaptive sampling methods

Adaptive Biasing Force Darve & Pohorille, J. Chem. Phys. 2001, vol. 115, pp. 9169.

Adaptive Umbrella Sampling Mezei, M. J Comput Phys 1987, vol. 68, pp. 237.

Self Healing Umbrella Sampling Marsili et. al J. Chem. Phys. B vol. 110, pp. 14011.

Metadynamics Laio & Parrinello, PNAS 2002, vol. 20, pp. 12562.

Conformational Flooding Grubmüller, Phys Rev E 1995, vol. 52, pp. 2893. ...

18

Wednesday, October 16, 13 Ty Enhanced sampling: metadynamics

• Apply a repulsive gaussian potential up to compensate the underlying free energy:

Nhills (s(x) si) 2 Vg(t, s(x)) = We 2 i=1 X H(t, x)=H(x)+Vg(t, s(x)) • Produces a non markovian dynamics. The negativee of the potential deposited is proven to converge to the correct free energy surface [6] • Transition between metastable states are enhanced by artificial removal of metastable states

[4] Laio & Parrinello, PNAS 2002, vol. 20, p. 12562. [5] Bussi & Laio, Parrinello Phys. Rev. Lett. 2006, vol 96, p. 90601 [6] Branduardi, Bussi, Parrinello, J. Chem. Theory Comput. 2012, vol 8, p. 2247 19 Wednesday, October 16, 13 TyHow to set this up in PLUMED?

Nhills (s(x) si) 2 Vg(t, s(x)) = We 2 i=1 X H(t, x)=H(x)+Vg(t, s(x))

e d(X) 0.65 4 c(X) > 0.65 : U(X) = 100 0.3 ✓ ◆ c(X) < 0.65 : U(X)=0.

20

Wednesday, October 16, 13 TyA test on ATP-Mg2+ in water: meta with distance

Choose the CV(s): maximum 3! Free energy estimate

React. Prod.

AReact.-AProd.

21

Wednesday, October 16, 13 TyAdaptive sampling vs TI-like methods

Adaptive sampling: The problem is multidimensional but probably the accessible phase space is limited: they explore only what you need The free energy landscape has competitive, parallel reactive paths (solvent degrees of freedom, rotations) that can be overcome at some point TI-like:

In 1-d (max 2-d, via WHAM or, better with rbf fitting schemes) very effective Sometimes trivially parallel (many umbrellas at same time)

22

Wednesday, October 16, 13 TyMisconceptions in free energy calculations

Technique Choice of order (TI, WHAM, parameter SMD, MetaD, ABF?)

23

Wednesday, October 16, 13 TyMisconceptions in free energy calculations

Technique Choice of (TI, WHAM, order SMD, MetaD, parameter ABF?)

24

Wednesday, October 16, 13 Ty The importance of the order parameter

Different order parameters give different landscapes

HighE Transition state is mixed pre post

LowE hidden var Poor convergence of free energy random Unreliable transition rates

kBT A‡/RT enhanced k(T )= e CV’ hc0 free energy A‡ CV’ Hard to compare with Expt!

[7] Eyring, Chem. Rev. 1935 vol. 17 p 65 25

Wednesday, October 16, 13 Ty How to choose the order parameter

Different order parameters give different landscapes

HighE

Combination of hidden var LowE CVs hidden var

enhanced enhanced CV’ CV’’ free energy free energy A‡ A‡ CV’ CV’’ PRO: the best perspective has good convergence and rates! CONS: it is a trial and error procedure! 26

Wednesday, October 16, 13 TyPath free energy calculations Monodimensional nonlinear mapping of the transition in terms of many coordinates

0.2 ProgressDistance along from thethe pathpath 0.1 0.0 selectedselected path path snapshots snapshots in ain givena given 0.1 representation representation CV’’ 0.2 hidden var actual MD snapshot actual MD snapshot 1.0 P P x x 0.5 ie | i| 1 i x xi zs((xx)=)= lnP e | | x xi 0 i e | | 0.0 P i CV’ metrics (cartesian? MSD?)X CV’ P Adaptive (it uses information from a previous transition) Preserves low dimensional description for efficiency Allows extensions (distance from path) Beyond metadynamics: Steered and others

[8] Branduardi, Gervasio, Parrinello,J. Chem. Phys. 2007, vol.126, p. 054103.27

Wednesday, October 16, 13 TyPath collective variables: ATP-Mg2+

Free energy estimate AReact.-AProd.

React. Prod.

the shape is conserved, the free energy difference has smaller fluctuations!

28

Wednesday, October 16, 13 TyPLUMED provides many CVs: are they enough?

29

Wednesday, October 16, 13 TyPlumed provides many CVs : combine with functions

30

Wednesday, October 16, 13 TyPlumed provides many CVs : matheval

c(t)=cos(0.5t 1.028) s(t)=sin(0.5t 1.028)

x

y

U(X,t) = 100 [(s(t) sin(X))2 +(c(t) cos(X))2] ⇤ http://www.gnu.org/software/libmatheval/ 31

Wednesday, October 16, 13 TyPlumed provides many CVs : matheval

32

Wednesday, October 16, 13 TyPlumed is also a set of tools

33

Wednesday, October 16, 13 TySummary

Enhanced sampling method makes you cross barriers Free energies can be calculated from biased dynamics Free energies depends on the technique and from the order parameter Order parameters are as important as the accelerated sampling method PLUMED offers a flexible tool to access a variety of methods and collective variables Beyond what I shown here: mixed replica exchange/biased dynamics (PT-WTE, PT-MetaD, Bias Exchange) Even more: String methods

34

Wednesday, October 16, 13 TyAcknowledgements

Giovanni Bussi (SISSA, Trieste) Max Bonomi (UCSF, San Francisco) Gareth Tribello (Queen’s University, Belfast) Carlo Camilloni (Cambridge University) Michele Parrinello (ETH, Zurich)

35

Wednesday, October 16, 13