Top Banner
Free energy calculations Berk Hess May 5, 2017
40

Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

May 19, 2018

Download

Documents

dobao
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Free energy calculations

Berk Hess

May 5, 2017

Page 2: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Why do free energy calculations?

The free energy G gives the population of states:

P1

P2= exp

(∆G

kBT

), ∆G = G2 − G1

Since we mostly simulate in the NPT ensemble we will use theGibbs free energy G (not the NVT Helmholtz free energy F )

A free energy difference can be split into two terms:

∆G = ∆H − T∆S , ∆H = ∆U + P∆V

∆G is less costly to calculate than ∆U

Page 3: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Example: solvation free energy

Measuring the probabilities by cal-culating distributions directly can bevery inefficient:

I path between two statesinfrequently sampled

I barrier highI narrow connection

I probability of the two states candiffer very much (large freeenergy difference)

Page 4: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Example: solvation free energy

focus on the transition process

Page 5: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

The coupling parameter approach

We add a coupling parameter λ to the Hamiltonian or potential:

V = V (r, λ)

V (r, 0) = VA(r) , V (r, 1) = VB(r)

The free energy difference between state A and B is then given by:

GB(p,T )− GA(p,T ) =

∫ 1

0

⟨∂H

∂λ

⟩NPT ;λ

Page 6: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Free energy perturbation

At a given value of λ:

F (λ) = −kBT log

[c

∫e−βV (r,λ)dr

]Usually impossible to calculate from simulations.But possible to calculate as a perturbation from an ensembleaverage:

F (λ+ ∆λ)− F (λ) = −kBT log

∫exp[−βV (r, λ+ ∆λ)]dr∫

exp[−βV (r, λ)]dr

= −kBT log⟨e−β[V (r,λ+∆λ)−V (r,λ)]

⟩λ

Page 7: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Free energy integration

Thermodynamic integration (TI)

At a given value of λ:

F (λ) = −kBT log

[c

∫e−βV (r,λ)dr

]Usually impossible to calculate from simulations.Also possible to compute dA/dλ from an ensemble average:

dF

dλ=

∫∂V∂λ exp[−βV (r, λ)]dr∫

exp[−βV (r, λ)]dr=

⟨∂V

∂λ

⟩λ

Averages are taken over an equilibrium path using V (λ)

Usually intermediate points are used.About 5-20 points required to integrate ∂V /∂λ properly

Page 8: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Slow growth

Integrate

⟨∂V

∂λ

⟩λ

while changing λ at every MD step

Issue: no ensemble average is taken: hysteresis is likely

Only use this for a simple, rough initial estimate,use free energy integration for quantitative results

Page 9: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Free energy of solvation

solute solvent solvated solute

∆G of solvation is often used to parametrize force fields

Partitioning properties:similarly one can determine the free energy of transfer from a polar(water) to an apolar solvent (octane, cyclohexane)

This is important for protein folding and peptide-membraneinteractions

Page 10: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Partitioning free-energies

waterprotein

water

water

membrane

Page 11: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Absolute binding free energies

E

I

E

I

Gbinding

E

I

E

I

ΔGbinding

E

I ΔGtransfer=0

ΔGI-E

E

I

ΔGI-solvent

∆Gbinding = ∆GI−E −∆GI−solvent

Page 12: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Relative binding free energies

I

E’E

I

E E’

G1∆ ∆G2

∆G4

∆G3

A

G1∆ ∆G2

∆G3

I I’

E

I

E

I’

∆G4

B

∆∆G = ∆G1 −∆G2 = ∆G3 −∆G4

Page 13: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

∆G between similar states

When the states of interest are very similar, e.g. small changes incharge or LJ parameters, only the potential energy differencematters and one can do single step perturbation

In Gromacs this can be done in two ways:

I Run a simulation for state A

I Do mdrun -rerun traj.trr with B-state parameters

I Determine the potential energy difference

or

I Run a simulation for state A with also a B-state topology andget the potential energy difference from the free energy code

Page 14: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

∆G between different states

With frequent transitions between states and small ∆G :

I simulate the system

I count the populations

With infrequent transitions between states or large ∆G :

We can modify the Hamiltonian to gradually move the systemfrom state A to state B

The free energy difference is then given by the total workassociated with changing the Hamiltonian

Page 15: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

The coupling parameter approach

The λ dependence of V (rmλ) can be chosen freely, as long as theend points match the states

The simplest approach is linear interpolation:

V (r, λ) = (1− λ)VA(r) + λVB(r)

This works fine, except when potentials with singularities areaffected (LJ, Coulomb)

Page 16: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

The coupling parameter approach

solute solvent solvated solute

State A: solute fully coupled to the solventState B: solute fully decoupled from the solvent

An example approach:Run simulations at: λ = 0, 0.1, . . . , 0.9, 1.0

Page 17: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Soft-core interactionsInstead of linear interpolation we use:

Vsc(r) = (1− λ)V A(rA) + λV B(rB)

rA =(ασ6

Aλp + r6

) 16 , rB =

(ασ6

B(1− λ)p + r6) 1

6

0 1 2 3

r

−2

0

2

4

6V

sc

LJ, α=0

LJ, α=1.5

LJ, α=2

3/r, α=0

3/r, α=1.5

3/r, α=2

Page 18: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Solvation free energy in practice

Make a topology where:

I the B-state atom types of the solute have LJ parameters zero

I the B-state charges of the solute are zero

1) Simulate the system with solvent at several λ-values 0,...,1

2) Simulate the system in vacuum at several λ-values 0,...,1

The solvation free energy is given by:

∆Gsolv =

∫ 1

0

⟨∂V

∂λ

⟩2)

dλ−∫ 1

0

⟨∂V

∂λ

⟩1)

Page 19: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Solvation free energy in practice

In the .mdp file set:

1) couple-moltype to the molecule you want to couple/decouple.

2) couple-lambda0 to none

3) couple-lambda1 to vdw-q

The solvation free energy is given by:

∆Gsolv =

∫ 1

0

⟨∂V

∂λ

⟩2)

dλ−∫ 1

0

⟨∂V

∂λ

⟩1)

Page 20: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Turning off non-bonded interactions

In many cases it is more efficient to also turn off all non-bondedintramolecular interactions

(separate calculation of the intramolecular contribution required)

Page 21: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Solvation of ethanol in water

0 0.2 0.4 0.6 0.8 1

λ

0

200

400

600

<d

H/d

λ>

(kJ/m

ol)

in H2O, p=1, α=0.6

in H2O, p=2, α=1.5

vacuum, p=1, α=0.6

Page 22: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

mdp file parameters

free-energy = yes

couple-moltype = ethanol

; these ’soft-core’ parameters make sure we never get overlapping

; particles as lambda goes to 0

sc-power = 1

sc-sigma = 0.3

sc-alpha = 1.0

; we still want the molecule to interact with itself at lambda=0

couple-intramol = no

couple-lambda1 = vdwq

couple-lambda0 = none

; The list of lambda points:

fep-lambdas = 0.0 0.2 0.4 0.6 0.8 0.9 1.0

; init-lambda-state is the index of the lambda to simulate

init-lambda-state = 0

Page 23: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Potential of mean force

A potential of mean force (PMF) is the free energy along one ormore degrees of freedom

The name comes from a common way to derive a PMF:by integrating the mean force working on a certain degree offreedom

One can also obtain a potential of mean force by Boltzmanninverting a pair correlation function g(r):

PMF(r) = −kBT log(g(r)) + C

Page 24: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Entropic effects

r

The phase-space volume available to the system is: 4πr2

Thus the entropic distribution is:

T∆S = kBT log(4π r2) = 2kBT log(r) + C

This result can also be obtained by integrating the centrifugal force

Fc(r) =2kBT

r

Page 25: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

PMF with a coupling parameter

Since constraints are part of the Hamiltonian, they can also becoupled with lambda

d( λ)

The mean force is given by the mean constraint force: −⟨∂H

∂λ

⟩With this approach one can one make PMF for distances betweenatoms with a pacakge supporing bond constraints(not yet between centers of mass)

Page 26: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

PMF between molecules

Look at a distance between centers of mass of molecules

With a constraint: PMF between whole molecules

A harmonic “spring” potential can be used instead of a constraint:umbrella sampling (not discussed yet)

Page 27: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Special case: molecules entering membranes

B

Ac.o.m.

a .1

a .2

cd

cd

Page 28: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

The pull code in GROMACS

In GROMACS any kind of center of masses constraints or pullingusing potentials can be easily set using a few options in the mdpparameter file

Page 29: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Reversibility

?

Page 30: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Reversibility

Apply restraints to keep the decoupled molecule in place.

Artificial restraints on the protein.

Page 31: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Reversibility

Apply restraints to keep the decoupled molecule in place.

Bond Angle Torsion

Page 32: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Reversibility check

The forward and backward path should give the same answer

So one can check:

∆G making molecule dissappear=

-∆G make molecule appear

or

∆G pulling molecule out of a protein=

-∆G pushing molecule into a protein

Page 33: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Free energy from non-equilibrium processes

If you change the Hamiltonian too fast, the ensemble will “lagbehind” the change in the Hamiltonian: work partly irreversibleTotal work W done on the system exceeds the reversible part ∆F :

W ≥ ∆F

In 1997 Jarzynski published the relation between the work and freeenergy difference for an irreversible process from λ=0 to 1:

F1 − F0 = −kBT log⟨e−βW

⟩λ=0

averaged over ensemble of initial points for λ = 0

Remarkable as W is very much process dependent

Page 34: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

All methods up till now

Jarzynski’s relation:

F1 − F0 = −kBT log⟨e−βW

⟩λ=0

Free energy perturbation is Jarzynski in one step

Free energy integration is the slow limit of Jarzynski’s equation

Slow growth is incorrect, as it should use Jarzynski’s relation

Jarzynski’s relation often not of practical use, as exponentialaveraging is inconvenient; only works well for σ(W ) < 2 kBT

Page 35: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Free energy integration error

For highly curved ∂V /∂λ, as is often thecase, the discretized integral will give asystematic error

Solution:use Bennett acceptance ratio method

Instead of ∂V /∂λ, calculate:〈V (λi+1)− V (λi )〉λi and〈V (λi+1)− V (λi )〉λi+1

and from that determine F (λi+1)−F (λi )using a maximum likelyhood estimate

This is the method of choice

0 0.2 0.4 0.6 0.8 1

λ

−4

−2

0

2

4

δV

/δλ

Page 36: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Bennett acceptance ratio

In 1967 Bennett showed that for any constant C :

e∆F−C =〈f (β(UB − UA − C ))〉A〈f (β(UA − UB − C ))〉B

for f (x)/f (−x) ≡ e−x

Optimal choices: f (x) ≡ 11 + ex

and C ≈ ∆F

This has to be solved iteratively.

A maximum likelyhood, lowest variance estimator(M. Shirts et al. PRL (2003) 91, 140601)

Page 37: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Other non-equilibrium methods

Crooks method using many transitions between λ=0 and λ=1from two (or more) equilibrium simulations at λ=0 and λ=1

Page 38: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Conclusions

Free-energy methods to use:

I Use direct counting of states when feasible

I Use perturbation when statistically feasible (not often thecase)

I Bennett acceptance ratio method is the usual method ofchoice

I Crooks can be useful in certain cases.

Possibility of unphysical pathways and states give you a lot offreedom to determine free energies in efficient ways

But, unphysical states might give distributions far off from thefinal, physical ones, which can make sampling difficult

If applicable, always think about / check for reversibility

Page 39: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Reading

Daan & Frenkel Part III.7

Page 40: Free energy calculations - Royal Institute of Technologycourses.theophys.kth.se/SI3450/freeenergy.pdfWhy do free energy calculations? The free energy G gives the population of states:

Exercise

Run simulations of methane in water. Decouple methane stepwise.

Calculate solvation free energies of methane in water using BAR.

Compare output from BAR with Thermodynamic Integratation.