berk hess - cscopls-aafiles ffoplsaanb.itp: [ atomtypes ]; full atom descriptions are available in...
TRANSCRIPT
Force fields, thermo- and barostats
Berk Hess
GROMACS workshop 2007
What is a force field?
A force field usually consists of three parts:• a set of functional forms• parameters for the functional forms that, usually, depend on the
atom types• a set of building blocks, e.g. for amino acid residues
GROMACS workshop 2007
Gromacs interaction function support
Often one can split a force field into two main contributions:
Bonded interactions work only within molecules:
Vb(ri, . . . , rN ) =∑
m∈molecules
(
∑
i,j∈bonds/pairs(m)
Vij(ri, rj) +
∑
i,j,k∈angles(m)
Vijk(ri, rj , rk) +
∑
i,j,k,l∈dihedrals(m)
Vijkl(ri, rj , rk, rl)
)
Non-bonded interactions work between and within molecules:
Vnb(ri, . . . , rN ) =∑
i<j
Vij(‖ ri − rj ‖) =∑
i<j
Vij(rij)
GROMACS workshop 2007
Non-bonded interactions
Non-bonded interactions in GROMACS are pair-additive andcentro-symmetric:
Electrostatic interactions
• Coulomb Vij =qiqj
4πε0ε
1
rij
• tabulated Vij =qiqj
4πε0εfC(rij)
Van der Waals interactions
• Lennard Jones Vij = C(12)ij
1
r12ij
− C(6)ij
1
r6ij
• tabulated Vij = C(12)ij fR(rij) − C
(6)ij fD(rij)
• Buckingham Vij = Aij exp(−Bijrij) −Cij
r6ij
GROMACS workshop 2007
Bonded interactions
Bonds (two-body):
• harmonic bond stretching: Vb (rij) = 12k
bij(rij − bij)
2
• 4th power bond bond stretching: Vb (rij) = 14k
bij
(
r2ij − b2ij)2
• ...
Angles (three-body):
• harmonic angle potential: Va(θijk) = 12k
θijk(θijk − θ0
ijk)2
• cosine based potential: Va(θijk) = 12k
θijk
(
cos(θijk) − cos(θ0ijk)
)2
• ...
GROMACS workshop 2007
Constraints
In GROMACS bonds are usually replaced by constraints,i.e. the distances between bonded atoms are fixed to theirequilibrium values
Constraints are actually a more faithful representation of reality,since the dynamics of bonds is of quantum nature
Removing the bond vibrations with constraints allows one to increase
the timestep from 0.5 or 1 fs to 2 or 4 fs
GROMACS workshop 2007
Bonded interactions (continued)
Improper dihedrals (four-body), for planarity or stereochemistry:• harmonic
Improper dihedrals (four-body):• single cosine: Vd(φijkl) = kφ(1 + cos(nφ− φs))
• Ryckaert-Bellemans: Vrb(φijkl) =∑5
n=0 Cn(cos(ψ))n
• ...
1-4 interactions (two-body):• (scaled) Lennard-Jones interactions• (scaled) Coulomb interactions
1-4 interactions go together with dihedrals, more on that later
GROMACS workshop 2007
Dihedrals
Proper dihedral
j
k
l
i
0 90 180 270 360φ
0
2
4
6
8
Vd
(kJ/
mol
)
Also 1-4 interactions between atoms i and j contribute to thetorsional potential around φ!
Improper dihedral
k
li
ji
kj
l
k
i
j
l
GROMACS workshop 2007
The choice of force field
The choice of force field is one of the most important factors in anMD study
A good force field requires years of work by many peopleAll parameters for all molecules should be consistent!
The first question is which of the force field have parameters for themolecules present in your system
When some parameters are missing:• search the literature• if no success, you need to do force field parametrization :-(
GROMACS workshop 2007
Biomolecular force fields in GROMACS
GROMOS OPLS-AA AMBER(6 versions) (7 versions)
united atom all-atom all-atomaliphatic CHn
proteins proteins proteinshydrocarbons hydrocarbons DNA/RNA
many liquids
An AMBER port for Gromacs is available at:http://folding.stanford.edu/ffamber/
GROMACS workshop 2007
Force field parametrization
Charges and Lennard-Jones parameters:
Very tricky!Try to do it the same way as the force field has been parametrized
Bonded terms:
Relatively easy, from quantum calculations But beware of the 1-4
terms for dihedrals!
GROMACS workshop 2007
Torsional potential setup
H
C C
C
C
2 3
4
1
HH
31
3222
H21
dihedrals:• 9: C1-C2-C3-C4, H21-C2-C3-C4, H22-C2-C3-C4, ...• 1 (GROMOS96): only C1-C2-C3-C4
1-4 LJ/Coulomb pair interactions:• 9: C1-C2-C3-C4, H21-C2-C3-C4, H22-C2-C3-C4, ...
The original idea behind this is:the dihedral potentials give the 2-3 dependencies only
the 1-4 pair potentials give the 1-4 dependencies only
GROMACS workshop 2007
Torsional potential parametrization
What to do when parameters for a certain dihedral are not presentin the force field?
1) Scan the dihedral in steps of e.g. 15 degrees and optimize thestructures using quantum calculations (e.g. Gaussian)
2) Determine the force-field energies for the optimized quantumstructures using mdrun -rerun,including all interations, except for the dihedral to parametrize
3) Determine the difference between the quantum and force-fieldpotential energiesand fit one of the dihedral functional forms to this
GROMACS workshop 2007
GROMACS topology file setup
Your topology is contained in the .top file
The .top file “includes” the force field .itp files, which are storedin the directory $GMXDIR/shared/top
For proteins your molecular topology, i.e. the set of bondedinteractions for your molecule, can be generated from the force fieldbuiling blocks with the program pdb2gmx
GROMACS workshop 2007
Topology file
; Include forcefield parameters
#include "ffG53a6.itp"
[ moleculetype ]
; Name nrexcl
Methanol 3
... molecule definition stuff, next slide ...
; Include water topology
#include "spc.itp"
[ system ]
; Name
Methanol in water
[ molecules ]
; Compound #mols
Methanol 1
SOL 640
GROMACS workshop 2007
Molecule definition
[ moleculetype ]
; Name nrexcl
Methanol 3
[ atoms ]
; nr type resnr residue atom cgnr charge mass
1 CH3 1 SER CB 1 0.266 15.035
2 OA 1 SER OG 1 -0.674 15.9994
3 H 1 SER HG 1 0.408 1.008
[ bonds ]
; ai aj funct c0 c1
1 2 2 gb_18 gb_18
2 3 2 gb_1 gb_1
[ angles ]
; ai aj ak funct c0 c1
1 2 3 2 ga_12 ga_12
GROMACS workshop 2007
Force field files
ffG53a6.itp:#define _FF_GROMOS96
#define _FF_GROMOS53A6
[ defaults ]
; nbfunc comb-rule gen-pairs fudgeLJ fudgeQQ
1 1 no 1.0 1.0
#include "ffG53a6nb.itp"
#include "ffG53a6bon.itp"
ffoplsaa.itp:#define _FF_OPLS
#define _FF_OPLSAA
[ defaults ]
; nbfunc comb-rule gen-pairs fudgeLJ fudgeQQ
1 3 yes 0.5 0.5
#include "ffoplsaanb.itp"
#include "ffoplsaabon.itp" GROMACS workshop 2007
OPLS-AA files
ffoplsaanb.itp:[ atomtypes ]
; full atom descriptions are available in ffoplsaa.atp
; name bond_type mass charge ptype sigma epsilon
opls_001 C 6 12.01100 0.500 A 3.75000e-01 4.39320e-01 ; SIG
opls_002 O 8 15.99940 -0.500 A 2.96000e-01 8.78640e-01 ; SIG
opls_003 N 7 14.00670 -0.570 A 3.25000e-01 7.11280e-01 ; SIG
...
ffoplsaabon.itp:[ bondtypes ]
; i j func b0 kb
OW HW 1 0.09572 502080.0 ; For TIP4F Water - wlj 1/98
OW LP 1 0.01750 753120.0 ; -idem-
C* HC 1 0.10800 284512.0 ;
...
[ angletypes ]
; i j k func th0 cth
HW OW HW 1 109.500 627.600 ; For TIP4F Water - wj 1/98
HW OW LP 1 54.750 418.400 ; For TIP4F Water - wj 1/98
OU U OU 1 180.000 1255.200 ; J Phys Chem 97, 5685 (1993)
GROMACS workshop 2007
GROMOS96 files
ffG53a6nb.itp:[ atomtypes ]
;name at.num mass charge ptype c6 c12
O 8 0.000 0.000 A 0.0022619536 1e-06
OM 8 0.000 0.000 A 0.0022619536 7.4149321e-07
OA 8 0.000 0.000 A 0.0022619536 1.505529e-06
...
[ nonbond_params ]
; i j func c6 c12
OM O 1 0.0022619536 8.611e-07
OA O 1 0.0022619536 1.38651e-06
OA OM 1 0.0022619536 2.258907e-06
...
[ pairtypes ]
; i j func c6 c12
O O 1 0.0022619536 7.4149321e-07
OM O 1 0.0022619536 7.4149321e-07
...GROMACS workshop 2007
GROMOS96 files
ffG53a6bon.itp:; ICB(H)[N] CB[N] B0[N]
;
#define gb_1 0.1000 1.5700e+07
; H - OA 750
;
#define gb_2 0.1000 1.8700e+07
; H - N (all) 895
...
; ICT(H)[N] CT[N] (T0[N])
;
#define ga_1 90.00 380.00
; NR(heme) - FE - C 90
;
#define ga_2 90.00 420.00
; NR(heme) - FE - NR(heme) 100
...
GROMACS workshop 2007
Making topologies
Proteins:• use pdb2gmx
Small molecules:• write a topology by hand, but be very careful about the details
of the force field used
(hetero-)polymers:• write building blocks (an .rtp file)• then use pdb2gmx
GROMACS workshop 2007
Thermostats and barostats
GROMACS workshop 2007
Ensembles
“Plain” molecular dynamics is Hamiltonian dynamics and thisconserves energy, leading to an constant NVE or microcanonicalensemble.
However, in most cases a constant NVT (canonical) or NPTensemble will be a more suitable representation of the real system.
To achieve this, the equation of motions need to be modified toinclude a thermostat and/or barostat.
There are two types of thermostats:• global thermostats• local thermostats
GROMACS workshop 2007
The Berendsen thermostat
A global thermostat, weak coupling to a bath:
dTdt
=T0 − T
τ
To achieve this first order decay of temperature deviations, allvelocities are scaled with the factor:
λ =
[
1 +∆t
τT
{
T0
T (t− ∆t2 )
− 1
}]1/2
τT is set with the parameter tau t in the mdp file
Different T0 and τT can be used for subgroups of the system.
GROMACS workshop 2007
The Nosé-Hoover thermostat
A global thermostat, using the extended-ensemble approach.
An additional degree of freedom ξ is added to the Hamiltonian:
d2ri
dt2=
F i
mi− ξ
dri
dt,
dξdt
=1
Q(T − T0)
The dynamics for the extended Hamiltonian is canonical,but leads to an NVT ensemble for the original system.
In the mdp file not the mass Q is set, but the period of theoscillations.
GROMACS workshop 2007
Global thermostats
Berendsen thermostatadvantage: little influence on kineticsdisadvantage: does not generate an ensemble (but error is small)
Nosé-Hoover thermostatadvantage: produces an NVT ensembledisadvantage: can induce oscillations in the dynamics
Temperature jumpfrom 300 to 330 Kfor 1000 H2O
0 1 2 3 4 5Time (ps)
300
330
360
T (
K)
Berendsen, τ=0.2 psexp(−t/τ), τ=0.5 psNose−Hoover, period=1 ps
GROMACS workshop 2007
Ergodicity
Global thermostats only work well when all degrees of freedom inthe system are coupled strong enough to one another.
Consider the following system:
octanewater
Here the octane and water slabs are very weakly coupled.Using one global thermostat can lead to a temperature differencebetween the octane and water slabs.
A solution is: using separate thermostats for octane and waterBut what about the 3 degrees of freedom coupling the octane andwater slabs?GROMACS removes the center of mass motion for octane andwater.
GROMACS workshop 2007
Local thermostats
One can also use Stochastic Dynamics (SD):
mid2
ri
dt2= −miξ
dri
dt+ F i(r)+
◦
ηi
advantages: NVT ensemble, always ergodic, no oscillationsdisadvantage: all velocity correlations decay with exp(ξ t)
In the overdamped limit SD reduces to Brownian Dynamics:
dri
dt=
1
γiF i(r)+
◦
ηi
BD is not useful for dynamics,but can be very useful for equilibrating bad starting structures.
GROMACS workshop 2007
Barostats
Berendsen barostat, or weak coupling:
dP
dt=
P0 −P
τp
The box/coordinate scaling matrix µ is given by
µij = δij −∆t
3 τpβij{P0ij − Pij(t)}
Parrinello-Rahman barostat:
db2
dt2= VW−1b′−1 (P − P 0)
d2ri
dt2=
F i
mi− M
dri
dt, M = b−1
[
bdb′
dt+
db
dtb′
]
b′−1
GROMACS workshop 2007
Calculating non-bonded interactions
GROMACS workshop 2007
Neighbor searching
In principle for a periodic system of N atoms we would need todetermine N(N + 1)/2 pair interactions, plus the interactions will allperiodic images.
When interactions are shorted ranged we can use cut-off’s.
For efficiency we used a fixed neighbor list for ns steps:• construct neighbor list for all charge groups pairs within rc
• ns times:• evaluate V and F for all pairs in the list• integrate the equations of motion
• construct neighbor list for all charge groups pairs within rc
• ...
GROMACS workshop 2007
Charge groups
We use charge groups because of two reasons:
• Neighbor searching efficiencyExample: For a pair of 3-site water molecules we need 9 atompair distances, but only 1 charge group distance
• Avoiding electrostatic artifacts due to cut-off’sExample: For water without charge groups partial chargesenter the cut-off, with charge groups dipoles enter the cut-off
GROMACS workshop 2007
Cut-off, charge groups and diffusion
� � �� � �� � �� � �� � �
� � �� � �� � �� � �� � �
� � �� � �� � �� � �� � �
� � �� � �� � �� � �� � � � � �� � �� � �� � �� � �
� � �� � �� � �� � �� � �
� � �� � �� � �� � �� � �
� � �� � �� � �� � �� � �
GROMACS workshop 2007
Cut-off, charge groups and diffusion
� � �� � �� � �� � �� � �
� � �� � �� � �� � �� � �
� � �� � �� � �� � �� � �
� � �� � �� � �� � �� � � � � �� � �� � �� � �� � �
� � �� � �� � �� � �� � �
� � �� � �� � �� � �� � �
� � �� � �� � �� � �� � �
GROMACS workshop 2007
Electrostatics with cut-off
0 0.5 1 1.5 2r
0
2
4
6
8
V
Cutting off interactions abruptly causes artefacts:• In water: over-orientation of dipoles: anti-parallel before the
cut-off, parallel beyond the cut-off• Like charged ions will accumulate just beyond the cut-off
Some artefacts get worse with increasing cut-off distance!!!
This is because Coulomb goes as 1/r, but the surface of the cut-off
sphere goes as r2
GROMACS workshop 2007
Reaction-field electrostatics
εrf = ∞ ⇒
V = fqiqjεr
[
1
rij+
1
2
r2ijr3c
−3
2
1
rc
]
� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �
� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � �
εrf
rc
εr
0 0.5 1 1.5 2r
0
2
4
6
8
V
Advantage: much less cut-off artefacts
Disadvantage: V = 0 beyond rc
GROMACS workshop 2007
Particle Mesh Ewald (PME) electrostatics
Split the electrostatics into a short- and long-range partDo the short-range part with particle-particle interactionsSolve the long-range part on a grid using FFT’s
0 0.5 1 1.5 2r
0
2
4
6
8
V
Advantages: no cut-off artefacts, infinite interaction rangeDisadvantages: computationally more expensive, periodicity (butthis is due to the boundary conditions)
Can be used with systems with net charge:a uniform background charge is applied
GROMACS workshop 2007
Lennard-Jones potential
0 0.2 0.4 0.6 0.8 1r (nm)
−2
−1
0
1
2
VLJ
(kJ
/mol
)
LJ decays fast: −r−6
but the dispersion contributes up to relatively long distances:
Vdisp =
∫
∞
rc
ρn〈C(6)〉 4π r2 r−6dr = −ρn〈C
(6)〉4π
3r−3c
GROMACS workshop 2007
Some useful box shapes
box type image box box vectors box vector angles
distance volume a b c ∠bc ∠ac ∠ab
d 0 0
cubic d d3 0 d 0 90
◦90
◦90
◦
0 0 d
rhombic d 0 1
2d
dodecahedron d1
2
√
2 d3 0 d
1
2d 60
◦60
◦90
◦
0.707 d3 0 0 1
2
√
2 d
truncated d1
3d −
1
3d
octahedron d4
9
√
3 d3 0 2
3
√
2 d1
3
√
2 d 71.53◦ 109.47◦ 71.53◦
0.770 d3 0 0 1
3
√
6 d
GROMACS workshop 2007
Neighbor search with a grid
j
i
i’
grid search in two dimensions, the arrows are the box vectors
GROMACS workshop 2007
Neighbor search/interaction setting
Neighbor search is C-code ⇒ slowForce loops are SSE/Altivec/... assembly ⇒ fast
For efficiency you want to use nstlist = 10
To avoid electrostatic articfacts use PME
force neighb. Elec. PME VdW VdW disp.field list cut-off grid type cut-off corr.
GROMOS 1.0 1.0 0.135 shift 0.9 yesunited atom cut-off 1.4 no
OPLS-AA 0.9 0.9 0.125 shift 0.8 yesall atom cut-off 1.4 no
GROMACS workshop 2007