In this tutorial we will learn to use bucket sampling (BS) for efficient sampling of high dimensional free energy landscape. This tutorial follows the method used in the paper: Javed, R., Kapakayala, A. B., & Nair, N. N., Buckets instead of umbrellas for enhanced sampling and free energy calculations. Journal of Chemical Theory and Computation, 20(19), 2024. It is recommended to read this paper for the details of parameters used for the simulation.
We study the free energy surface of alanine dipeptide in vacuo as a function of two backbone dihedral angles (Φ, Ψ) using BS. Here, we are assuming that users are familiar with GROMACS and can run MD simulation using GROMACS-PLUMED interface. The first thing we need to do is build an initial structure using ff14SB force-field and relax this at 300K so that we can use this as the input for our simulation.
This tutorial consist of two parts:
Part 1: BS Simulation
Part 2: Reweighting
Here, we will run the simulation for six windows. The full range for our interest is from -3.14 rad to 3.14 rad along Φ. Thus, we divide the full region into 6 buckets each spanning a region of 1 rad. Thus, we have the η_L and η_U values:
We wish to compute the unbiased probability distribution between η_L and η_U for each bucket window. These distributions will then be combined to obtain the full distribution.
Before starting the BS simulations, it is essential to estimate the collective variable (CV) diffusion length, λ, along which the bucket bias is to be applied. This step ensures that overly rigid wall potentials do not adversely affect the simulation or introduce artifacts.
Steps for computing λ:
Preliminary Metadynamics Simulation:
Conduct short, well-tempered metadynamics (WT-MetaD) simulation starting with the equilibrium structure using the same set of parameters that we plan to use for the bucket sampling. WT-MetaD will be applied on both Φ, Ψ CVs. This simulation will help capture the natural diffusion behavior of the system across the chosen CV.
Diffusion Analysis:
Use the script compute_lambda.py to calculate the diffusion coefficient from each independent simulation. Before running this Python code, you need to edit the following:
CV_COL = 1
cv_is_torsion= True # Make it False if not a torsion
ETA_L=np.array([-3.14, -1.05, 1.05]) #\eta_L
ETA_U=np.array([-1.05, 1.05, 3.14]) #\eta_u
CV_COL is the index of the CV along which the bucket potential is applied.
cv_is_torsion=True if the bucket-CV is a torsion.
ETA_L & ETA_U: List all the values of η_L and η_U are to be entered.
The code will compute the ξ_L and ξ_U values and print them. ξ_L and ξ_U are the positions where the wall potentials are to be positioned:
For the alanine dipeptide in water simulation, we get λ=0.4 rad; thus, we eliminate 0.2 rad from the right and left regions to consider any possibility of boundary effects. See the table below.
We are going to run 10 ns long BS simulation for all windows i.e. apply bucket bias along Φ and MTD bias along Φ and Ψ.
The following input files are required for running BS simulation for each umbrella window:
To run simulations in each window, the user must specify a value of ξ for each bucket (as computed by compute_lambda.py). The corresponding PLUMED input file for any given window is shown below; replace XX with the appropriate wall positions. For reference, see Table 1 for different values of ξ.
Table 1: Details of the BS bias window along the ϕ coordinate in the case of alanine dipeptide simulation.
The main output files of these simulations which are required for analysis are:
COLVAR : Collective Variables files for different windows
HILLS : List of added bias is stored in this file for different windows
The second part of our calculation is to use probability generated by BS simulation to get the free energy surface. But in our simulation we have applied MTD bias in all the 6 windows which will give biased probability distribution. We need to get unbiased probability distribution by reweighting and then patching all the windows using mean force based reweighting technique (Pal et al., 2021).
For reweighting, use the Py-bucket-reweight.py code. The manual for the reweighting code is here (PDF).
You can plot the Pu.dat file and the gradient.dat files:
NOTE: For the reconstruction part, only the η region for each window needs to be taken.
Use gnuplot to plot free_energy_2D.dat to get the free energy as below.