Difference between revisions of "Best Practices"

From AlchemistryWiki
Jump to navigation Jump to search
(→‎Best Practices: - Some minor edits/corrections; changing some links to DOIs, etc.)
m (→‎Rule 1: Soft core potentials: Fixing some formatting)
Line 23: Line 23:
 
Rule 1 -- that soft core potentials should always be used when turning on or off Lennard-Jones interactions -- really should be a rule observed by all free energy calculations, we believe. Lennard-Jones interactions between particles have a really steep (<math>1/r^{12}</math>) rise in potential energy. This prevents particles from overlapping. However, to delete particles (atoms or molecules) these interactions need to be turned off somehow, and this is not as straightforward as it might seem.
 
Rule 1 -- that soft core potentials should always be used when turning on or off Lennard-Jones interactions -- really should be a rule observed by all free energy calculations, we believe. Lennard-Jones interactions between particles have a really steep (<math>1/r^{12}</math>) rise in potential energy. This prevents particles from overlapping. However, to delete particles (atoms or molecules) these interactions need to be turned off somehow, and this is not as straightforward as it might seem.
  
One relatively-commonly used choice ([http://dx.doi.org/10.1098/rsta.2005.1625 Fowler et al., 2005], [http://dx.doi.org/10.1007/s10822-005-9021-3 Chipot, Rozanska and Dixit, 2005], [http://amber.scripps.edu/doc9/index.html AMBER], and others) for turning these off is simple linear-scaling of that term in the potential energy or Hamiltonian: That is,  <math>V(\lambda) = (1 - \lambda) V_0 + \lambda V_1</math>, where <math>V_0</math> is the potential energy with full Lennard-Jones interactions, and <math>V_1</math> is the potential energy where the Lennard-Jones interactions have been turned off for the atoms which are being deleted. This means that, for the atoms being deleted, Lennard-Jones interactions scale at small <math>r</math> as <math>(1-\lambda)/r^{12}</math>. This has two unfortunate and interconnected consequences. First, there is a discontinuous change in the form of the interaction potential when going from $$lambda=1-epsilon$$ (where <math>\epsilon</math> is a very small number) to <math>lambda=1</math>, as the <math>1/r^{12}</math> term still is fairly important even at <math>\lambda</math> very near 1, but is entirely turned off at <math>lambda=1</math>. Secondly, it leads to large forces, numerical instabilities, and other problems in simulations near <math>lambda=1</math>. Formally, it has been shown that this leads to a integrable singularity in <math>dV/(d\lambda)</math>, which means that computing correct free energies with this scheme using thermodynamic integration is impossible using numerical techniques ([http://dx.doi.org/10.1063/1.432264 Mruzik et al., 1976],[http://fulcrum.physbio.mssm.edu/~mezei/ms/cv54mmc.pdf Mezei and Beveridge, 1986], [http://fulcrum.physbio.mssm.edu/~mezei/ms/cv85.pdf Resat and Mezei, 1993] and especially [http://dx.doi.org/10.1016/0009-2614(94)00397-1 Beutler et al., 1994], [http://dx.doi.org/10.1080/08927020211973 Pitera and van Gunsteren, 2002] and [http://www.dillgroup.ucsf.edu/~dmobley/papers/steinbrecher.pdf Steinbrecher et al., 2007] and references therein) and similar problems plague free energy perturbation schemes.
+
One relatively-commonly used choice ([http://dx.doi.org/10.1098/rsta.2005.1625 Fowler et al., 2005], [http://dx.doi.org/10.1007/s10822-005-9021-3 Chipot, Rozanska and Dixit, 2005], [http://amber.scripps.edu/doc9/index.html AMBER], and others) for turning these off is simple linear-scaling of that term in the potential energy or Hamiltonian: That is,  <math>V(\lambda) = (1 - \lambda) V_0 + \lambda V_1</math>, where <math>V_0</math> is the potential energy with full Lennard-Jones interactions, and <math>V_1</math> is the potential energy where the Lennard-Jones interactions have been turned off for the atoms which are being deleted. This means that, for the atoms being deleted, Lennard-Jones interactions scale at small <math>r</math> as <math>(1-\lambda)/r^{12}</math>. This has two unfortunate and interconnected consequences. First, there is a discontinuous change in the form of the interaction potential when going from <math>lambda=1-epsilon</math> (where <math>\epsilon</math> is a very small number) to <math>lambda=1</math>, as the <math>1/r^{12}</math> term still is fairly important even at <math>\lambda</math> very near 1, but is entirely turned off at <math>lambda=1</math>. Secondly, it leads to large forces, numerical instabilities, and other problems in simulations near <math>lambda=1</math>. Formally, it has been shown that this leads to a integrable singularity in <math>dV/(d\lambda)</math>, which means that computing correct free energies with this scheme using thermodynamic integration is impossible using numerical techniques ([http://dx.doi.org/10.1063/1.432264 Mruzik et al., 1976],[http://fulcrum.physbio.mssm.edu/~mezei/ms/cv54mmc.pdf Mezei and Beveridge, 1986], [http://fulcrum.physbio.mssm.edu/~mezei/ms/cv85.pdf Resat and Mezei, 1993] and especially [http://dx.doi.org/10.1016/0009-2614(94)00397-1 Beutler et al., 1994], [http://dx.doi.org/10.1080/08927020211973 Pitera and van Gunsteren, 2002] and [http://www.dillgroup.ucsf.edu/~dmobley/papers/steinbrecher.pdf Steinbrecher et al., 2007] and references therein) and similar problems plague free energy perturbation schemes.
  
In an attempt to get around this, some have suggested scaling the potential energies with <math>(1-\lambda)^k</math>, where <math>k</math> is an integer greater than 1. It can be shown that, for <math>k \ge 4</math>, this leads to an integrable singularity in <math>dV/d\lambda</math>, so thermodynamic integration can in principle be done ([http://fulcrum.physbio.mssm.edu/~mezei/ms/cv54mmc.pdf Mezei and Beveridge, 1986], [http://www.sciencedirect.com/science?_ob=ArticleURL&_udi=B6TFN-44WCYB3-T8&_user=4430&_coverDate=06/03/1994&_rdoc=1&_fmt=&_orig=search&_sort=d&view=c&_acct=C000059594&_version=1&_urlVersion=0&_userid=4430&md5=43ac38d23e3e595dc97c273e012406e6 Beutler et al., 1994]). But integrable singularities still pose very substantial problems for molecular simulation, and this approach can still lead to large forces, numerical instabilities and energy conservation problems ([http://dx.doi.org/10.1016/0009-2614(94)00397-1 Beutler et al., 1994] and [http://www.dillgroup.ucsf.edu/~dmobley/papers/steinbrecher.pdf Steinbrecher et al., 2007]) and make free energy differences extremely difficult to converge ([D. Mobley, unpub. data]).
+
In an attempt to get around this, some have suggested scaling the potential energies with <math>(1-\lambda)^k</math>, where <math>k</math> is an integer greater than 1. It can be shown that, for <math>k >= 4</math>, this leads to an integrable singularity in <math>dV/d\lambda</math>, so thermodynamic integration can in principle be done ([http://fulcrum.physbio.mssm.edu/~mezei/ms/cv54mmc.pdf Mezei and Beveridge, 1986], [http://www.sciencedirect.com/science?_ob=ArticleURL&_udi=B6TFN-44WCYB3-T8&_user=4430&_coverDate=06/03/1994&_rdoc=1&_fmt=&_orig=search&_sort=d&view=c&_acct=C000059594&_version=1&_urlVersion=0&_userid=4430&md5=43ac38d23e3e595dc97c273e012406e6 Beutler et al., 1994]). But integrable singularities still pose very substantial problems for molecular simulation, and this approach can still lead to large forces, numerical instabilities and energy conservation problems ([http://dx.doi.org/10.1016/0009-2614(94)00397-1 Beutler et al., 1994] and [http://www.dillgroup.ucsf.edu/~dmobley/papers/steinbrecher.pdf Steinbrecher et al., 2007]) and make free energy differences extremely difficult to converge ([D. Mobley, unpub. data]).
  
 
Since free energies are path-independent, an elegant solution to this problem was developed ([http://dx.doi.org/10.1016/0009-2614(94)00397-1 Beutler et al., 1994]) – to modify the Lennard-Jones functional form to gradually smooth out the <math>1/r^12</math> term as a function of lambda, rather than simply multiplying it by a prefactor. This removes problems with numerical instabilities and singularities, and improves convergence properties ([http://dx.doi.org/10.1016/0009-2614(94)00397-1 Beutler et al., 1994], [http://dx.doi.org/10.1080/08927020211973 Pitera and van Gunsteren, 2002]).  The basic idea is that it allows particles to gradually begin to overlap as <math>lambda</math> is changed, rather than saving a drastic change in interactions for the point going from <math>lambda=1-epsilon<math> to <math>lambda=1</math>. This approach is known as soft core potentials, and has subsequently been shown to be a nearly optimal path for modifying Lennard-Jones interactions ([http://dx.doi.org/10.1002/jcc.20025 Blondel, 2004]. In some work, several groups have further tested this approach and found a slightly modified functional form and set of parameters from that originally proposed ([http://dx.doi.org/10.1016/0009-2614(94)00397-1 Beutler et al., 1994]) which leads to improved efficiency for free energy calculations ([http://dx.doi.org/10.1063/1.1877132 Shirts and Pande, 2005], [D. Mobley, unpublished data]); we recommend that the soft core potentials and parameters from that work be employed in all free energy calculations involving insertion or deletion of particles.
 
Since free energies are path-independent, an elegant solution to this problem was developed ([http://dx.doi.org/10.1016/0009-2614(94)00397-1 Beutler et al., 1994]) – to modify the Lennard-Jones functional form to gradually smooth out the <math>1/r^12</math> term as a function of lambda, rather than simply multiplying it by a prefactor. This removes problems with numerical instabilities and singularities, and improves convergence properties ([http://dx.doi.org/10.1016/0009-2614(94)00397-1 Beutler et al., 1994], [http://dx.doi.org/10.1080/08927020211973 Pitera and van Gunsteren, 2002]).  The basic idea is that it allows particles to gradually begin to overlap as <math>lambda</math> is changed, rather than saving a drastic change in interactions for the point going from <math>lambda=1-epsilon<math> to <math>lambda=1</math>. This approach is known as soft core potentials, and has subsequently been shown to be a nearly optimal path for modifying Lennard-Jones interactions ([http://dx.doi.org/10.1002/jcc.20025 Blondel, 2004]. In some work, several groups have further tested this approach and found a slightly modified functional form and set of parameters from that originally proposed ([http://dx.doi.org/10.1016/0009-2614(94)00397-1 Beutler et al., 1994]) which leads to improved efficiency for free energy calculations ([http://dx.doi.org/10.1063/1.1877132 Shirts and Pande, 2005], [D. Mobley, unpublished data]); we recommend that the soft core potentials and parameters from that work be employed in all free energy calculations involving insertion or deletion of particles.

Revision as of 16:10, 17 October 2007

Best Practices

Here, we provide an overview of some of what we believe are the best practices for free energy calculations, with references, wherever possible. This document assumes you already have a basic idea of what these calculations are and what they do (if not, start with our FreeEnergyIntroduction), and that you already have a working knowledge of molecular simulations and basic terms like convergence and equilibration (if not, start with a textbook like Leach's Molecular Modelling: Principles and Applications). Simulation-package specific issues will not be addressed here.

Feel free to edit this document or the attached discussion pages. We hope this to be a place storing the community consensus on these issues. Do back up any edits with appropriate references.

Introduction

Free energy calculations are appealing, in that, in principle, they allow calculation of rigorously correct free energies, given a particular set of parameters and physical assumptions. We firmly believe that the goal of these calculations, then, should be to obtain these correct free energies given the particular assumptions -- and not necessarily to match experiment. Only then can the underlying parameters and physical assumptions really be tested. In other words, there exists a single right answer for a free energy calculation, given this particular set of parameters and physical assumptions, and our goal is to obtain it. Here, we will call these free energies "correct" free energies. "Correct", then, implies at the very least that the computed free energies have converged, and that there are no underlying methodological problems.

It is also important to remember in what follows that free energy is a function of state, so there are many possible choices of pathway for a thermodynamic cycle connecting the same two endpoints. Some pathways may be more efficient than others (sometimes by many orders of magnitude) so methods which are in principle correct may not always be practical.

Here, we discuss best practices in the context of several practical examples: Solvation free energies, and binding free energies. Solvation free energies provide a basic starting point for considering a number of the key issues, and, for binding free energies, there are many more choices of pathway, which raises additional complications. In both cases, there are also different methods for computing the relevant free energy differences, which may differ in efficiency.

Guidelines for free energy calculation pathways

Alchemical free energies almost involve some insertion or deletion of atoms -- both in hydration free energy calculations, and in absolute and relative binding free energy calculations. By insertion and deletion, we mean decoupling or annihilation (see Decoupling and annihilation for definitions) of the interactions of the atoms in question. We believe that a basic list of rules and guidelines should be followed in any calculation that involves insertion or deletion:

  • Rule 1: Always use soft-core potentials while decoupling or annihilating Lennard-Jones interactions
  • Rule 2: Never leave a partial atomic charge on an atom while its Lennard-Jones interactions are being removed
  • Guideline 3: It is usually more efficient to perform electrostatic and Lennard-Jones transformations separately
  • Guideline 4: Inserting or deleting atoms is usually less efficient than mutating them, so transformations should involve as few insertions and deletions as possible.

It is worth looking at each of these in more detail.

Rule 1: Soft core potentials

Rule 1 -- that soft core potentials should always be used when turning on or off Lennard-Jones interactions -- really should be a rule observed by all free energy calculations, we believe. Lennard-Jones interactions between particles have a really steep ([math]\displaystyle{ 1/r^{12} }[/math]) rise in potential energy. This prevents particles from overlapping. However, to delete particles (atoms or molecules) these interactions need to be turned off somehow, and this is not as straightforward as it might seem.

One relatively-commonly used choice (Fowler et al., 2005, Chipot, Rozanska and Dixit, 2005, AMBER, and others) for turning these off is simple linear-scaling of that term in the potential energy or Hamiltonian: That is, [math]\displaystyle{ V(\lambda) = (1 - \lambda) V_0 + \lambda V_1 }[/math], where [math]\displaystyle{ V_0 }[/math] is the potential energy with full Lennard-Jones interactions, and [math]\displaystyle{ V_1 }[/math] is the potential energy where the Lennard-Jones interactions have been turned off for the atoms which are being deleted. This means that, for the atoms being deleted, Lennard-Jones interactions scale at small [math]\displaystyle{ r }[/math] as [math]\displaystyle{ (1-\lambda)/r^{12} }[/math]. This has two unfortunate and interconnected consequences. First, there is a discontinuous change in the form of the interaction potential when going from [math]\displaystyle{ lambda=1-epsilon }[/math] (where [math]\displaystyle{ \epsilon }[/math] is a very small number) to [math]\displaystyle{ lambda=1 }[/math], as the [math]\displaystyle{ 1/r^{12} }[/math] term still is fairly important even at [math]\displaystyle{ \lambda }[/math] very near 1, but is entirely turned off at [math]\displaystyle{ lambda=1 }[/math]. Secondly, it leads to large forces, numerical instabilities, and other problems in simulations near [math]\displaystyle{ lambda=1 }[/math]. Formally, it has been shown that this leads to a integrable singularity in [math]\displaystyle{ dV/(d\lambda) }[/math], which means that computing correct free energies with this scheme using thermodynamic integration is impossible using numerical techniques (Mruzik et al., 1976,Mezei and Beveridge, 1986, Resat and Mezei, 1993 and especially Beutler et al., 1994, Pitera and van Gunsteren, 2002 and Steinbrecher et al., 2007 and references therein) and similar problems plague free energy perturbation schemes.

In an attempt to get around this, some have suggested scaling the potential energies with [math]\displaystyle{ (1-\lambda)^k }[/math], where [math]\displaystyle{ k }[/math] is an integer greater than 1. It can be shown that, for [math]\displaystyle{ k \gt = 4 }[/math], this leads to an integrable singularity in [math]\displaystyle{ dV/d\lambda }[/math], so thermodynamic integration can in principle be done (Mezei and Beveridge, 1986, Beutler et al., 1994). But integrable singularities still pose very substantial problems for molecular simulation, and this approach can still lead to large forces, numerical instabilities and energy conservation problems (Beutler et al., 1994 and Steinbrecher et al., 2007) and make free energy differences extremely difficult to converge ([D. Mobley, unpub. data]).

Since free energies are path-independent, an elegant solution to this problem was developed (Beutler et al., 1994) – to modify the Lennard-Jones functional form to gradually smooth out the [math]\displaystyle{ 1/r^12 }[/math] term as a function of lambda, rather than simply multiplying it by a prefactor. This removes problems with numerical instabilities and singularities, and improves convergence properties (Beutler et al., 1994, Pitera and van Gunsteren, 2002). The basic idea is that it allows particles to gradually begin to overlap as [math]\displaystyle{ lambda }[/math] is changed, rather than saving a drastic change in interactions for the point going from [math]\displaystyle{ lambda=1-epsilon\lt math\gt to \lt math\gt lambda=1 }[/math]. This approach is known as soft core potentials, and has subsequently been shown to be a nearly optimal path for modifying Lennard-Jones interactions (Blondel, 2004. In some work, several groups have further tested this approach and found a slightly modified functional form and set of parameters from that originally proposed (Beutler et al., 1994) which leads to improved efficiency for free energy calculations (Shirts and Pande, 2005, [D. Mobley, unpublished data]); we recommend that the soft core potentials and parameters from that work be employed in all free energy calculations involving insertion or deletion of particles.

Some testing has suggested that the [math]\displaystyle{ (1-\lambda)^k }[/math] scaling approach may be essentially adequate for hydration free energy calculations ([D. Mobley, unpublished data],Steinbrecher et al., 2007) but it still less efficient there than soft-core potentials, so this does not affect our recommendation.

In summary: Linearly scaling Lennard-Jones interactions back as a function of [math]\displaystyle{ lambda }[/math] for insertion/deletion of particles is formally incorrect for numerical integration and leads to wrong estimates of free energy differences. While more complicated schemes involving [math]\displaystyle{ lambda^k }[/math] scaling can be formally correct, there are serious concerns regarding their accuracy. Soft-core potentials provide a rigorously correct, efficient alternative to these and should be used whenever particles are inserted or deleted, preferably with the functional form and parameters of ((Shirts and Pande, 2005), unless future work finds a still more efficient set of parameters.