Hands-on tutorials: Advanced sampling methods using GROMACS

Scope

Advanced sampling methods, or enhanced sampling methods, are a powerful extension of molecular dynamics that enables much more efficient sampling in the phase space of complex systems. They are particularly useful in gaining thermodynamic and structural insights into the system of interest, such as the solvation free energy of a molecule or the binding ensemble of a binding complex. In this mini-course, we will explore several kinds of advanced sampling methods, including those based on the use of collective variables (e.g., metadynamics, umbrella sampling, and adaptive biasing force), generalized ensemble methods (e.g., temperature replica exchange, Hamiltonian replica exchange, and expanded ensemble), and hybrid methods (e.g., replica exchange umbrella sampling, and alchemical metadynamics). Relevant free energy estimators, such as WHAM, TI, BAR, MBAR, and multiple linear regression, will also be introduced.

Through hands-on practices, this mini-course aims to equip students with the skills to perform and analyze several advanced sampling simulations. We do not aim to review all the advanced sampling methods exhaustively and will only briefly introduce the theoretical backgrounds for the ones presented. For a more comprehensive survey of advanced sampling methods, I recommend the excellent review by Hénin et al.1

Prerequisites

  • Background knowledge: This course assumes that students have a basic understanding of the following.

    • Bash commands and scripting: The students should be comfortable with navigating and manipulating the file system through command lines (e.g., cd, ls, pwd, cp, mv, and rm) and writing simple scripts to automate tasks.
    • Python scripting: The students should be experienced with Python data types, control flow structures (e.g., condition statements, loop statements, and function calls), and using functions and modules. Familiarity with common Python libraries such as NumPy, Matplotlib, and Pandas would be benecial.
    • Parallel computing: To grasp methods that involve parallelism (Chapters 3, 4, and 6), the student needs to understand basic terminologies relevant to parallel computing, including node, core, rank, socket, and MPI process. The student should also be comfortable using MPI executables such as mpirun or mpiexec. If not, I recommend checking this video up to 04:33. If you are interested in running multiple MD simulations in parallel with mpirun or mpiexec, consider watching the video up to 22:41.
    • Statistical mechanics: While we will have a quick review of the basics of statistical mechanics in Chapter 1, a basic understanding of the subject is important to understand the theory of advanced sampling methods.
    • Molecular dynamics and GROMACS: The student should have a basic understanding of molecular dynamics and be able to perform standard molecular dynamics in GROMACS. If not, I recommend reviewing Lemkul’s tutorials on LiveCoMS2 up to Section 3.2.

    Note that familiarity with git commands is not strictly required, but the student should at least know how to clone the course repository that stores all relevant files and codes for the course, using the following command:

    git https://github.com/wehs7661/advanced_sampling_tutorials.git
    
  • Software requirements: Below we tabulate whether MPI-enabled GROMACS or PLUMED is required for each chapter. For Chapters not requiring MPI-enabled GROMACS, a GROMACS build based on thread-MPI (tMPI) can be used. Alchemical metadynamics introduced in Chapter 7 only works with GROMACS 2020/PLUMED 2.8, or newer versions of each. If you want to follow all chapters without the need to build different versions of GROMACS/PLUMED, we would recommend MPI-enabled GROMACS 2020 patched with PLUMED 2.8, or newer versions of each. If you don’t have GROMACS/PLUMED installed, please refer to the corresponding reference manual for the installation guide.

    ChapterTopicMPI-enabled GROMACS required?PLUMED required?
    1Umbrella sampling
    2Metadynamics
    3Temperature replica exchange
    4Hamiltonian replica exchange
    5Expanded ensemble
    6Replica exchange umbrella sampling
    7Alchemical metadynamics

    This course also requires the student to have working versions of Python and MPI executables such as mpirun or mpiexec for the chapters where MPI-enabled GROMACS is required. Python packages required for data analysis of MD simulations will be introduced in each chapter, if any.

  • Hardware requirements: I have made the example simulations in each chapter as computationally affordable as possible such that a PC or desktop should suffice. However, if you have supercomputing resources at hand (such as access to Bridges-2), the simulations will take even less time and you can play around with different parallelism configurations to get more insights for some of the chapters.

Outline

In Chapter 0, we introduce the motivation for advanced sampling techniques and discuss key terminologies. In Chapter 1, Chapter 2, and Chapter 6, we present CV-based methods using NaCl as the system of interest. This system is well-suited for showcasing CV-based methods since the slowest degree of freedom (ion-pair distance) is intuitive. For these chapters, the goal is to reconstruct the free energy profile of NaCl as a function of ion-pair distance. (Details about the preparation of the NaCl system can be found in our repository.) Chapter 3, Chapter 4, Chapter 5, and Chapter 7 introduce generalized ensemble methods, with Chapter 7 additionally leveraging the advantages of configurational CVs. The goal of these chapters is either to compute the free energy as a function of temperature, or to perform alchemical free energy calculations. Details about the system of interest for demonstrating these methods can be found in each corresponding chapter.

Copyright (c) 2023, Wei-Tse Hsu (wehs7661@colorado.edu)



  1. HéninJ.; LelièvreT.; Shirts, M. R.; Valsson, O.; Delemotte, L. Enhanced Sampling Methods for Molecular Dynamics Simulations [Article V1.0]. Living Journal of Computational Molecular Science 2022, 4 (1). https://doi.org/10.33011/livecoms.4.1.1583↩︎

  2. Lemkul, J. From Proteins to Perturbed Hamiltonians: A Suite of Tutorials for the GROMACS-2018 Molecular Simulation Package [Article V1.0]. Living Journal of Computational Molecular Science 2019, 1 (1). https://doi.org/10.33011/livecoms.1.1.5068↩︎