Getting Began with PLUMED
Installation:
Not gonna lie, this gets a little bit annoying, it must be patched into your MD engine. If you happen to’re not desirous about GROMACS as your MD engine, here’s a link to the plumed most important page since you’re on your personal regarding installation:
Otherwise, here’s easy methods to install them each and properly patch them. Follow all of those commands if you’ve got neither but ignore the GROMACS installation should you have already got it installed and dealing. These commands ought to be executed one-by-one in your terminal/command line.
#Download GROMACS
wget http://ftp.gromacs.org/pub/gromacs/gromacs-2021.2.tar.gz
tar xfz gromacs-2021.2.tar.gz
cd gromacs-2021.2#Install and source GROMACS
mkdir construct
cd construct
cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON
make
sudo make install
source /usr/local/gromacs/bin/GMXRC
#Download PLUMED
wget https://github.com/plumed/plumed2/releases/download/v2.7.1/plumed-2.7.1.tgz
tar xfz plumed-2.7.1.tgz
cd plumed-2.7.1
#install PLUMED
./configure --prefix=/usr/local/plumed
make
sudo make install
#Patch GROMACS
cd gromacs-2021.2
plumed patch -p
#rebuilld GROMACS
cd construct
cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON -DGMX_PLUMED=on
make
sudo make install
#Check installation
gmx mdrun -plumed
You’ll notice I’ve picked an older version of gromacs; that is just to offer us a greater likelihood that there aren’t any unforseen bugs moving through these articles, you’re greater than welcome to make use of a more moderen version at your discretion, just make sure that it’s PLUMED-compatible.
Basic Configuration:
- Create a PLUMED input file to define the collective variables (CVs) that describe the system’s vital degrees of freedom.
Here’s an example file. I’ll go into more detail on some fancier options in Part 3 of this text series, but for now we’ll start by the conformational state of a set of atoms by utilizing distance and torsion as our CVs. Other potential CVs include distances between atoms, angles, dihedrals, or more complex functions.
# Define collective variables
# Distance between atoms 1 and 10
DISTANCE ATOMS=1,10 LABEL=d1# Dihedral angle involving atoms 4, 6, 8, and 10
TORSION ATOMS=4,6,8,10 LABEL=t1
# Print collective variables to a file
PRINT ARG=d1,t1 FILE=COLVAR STRIDE=100
# Apply metadynamics bias
METAD ...
ARG=d1,t1 # The collective variables to bias
PACE=500 # Add a Gaussian hill every 500 steps
HEIGHT=0.3 # Height of the Gaussian hill
SIGMA=0.1,0.1 # Width of the Gaussian hill for every CV
FILE=HILLS # File to store the hills
BIASFACTOR=10 # Bias factor for well-tempered metadynamics
TEMP=300 # Temperature in Kelvin
... METAD
# Print the bias potential to a file
PRINT ARG=d1,t1,bias FILE=BIAS STRIDE=500
The comments in that code block ought to be extensive enough for a basic understanding of the whole lot happening, but I’ll get to all of this in article 3, and we’ll even delve beyond into complex functions!
Anyway, once you’ve got this input file (typically named plumed.dat) and the .tpr file required for an MD run using GROMACS (have a look at gmx grompp documentation for generating that file), you may run the metadynamics simulation by going to the working directory and typing into the command line:
gmx mdrun -s topol.tpr -plumed plumed.dat
Each PLUMED and GROMACS accept extra arguments. I’ll go over among the more useful ones for each in Part 3 of this series of articles along with some of the scripts I’ve written for more advanced runs, and you may have a look at the documentation for any others.
After the simulation, use PLUMED’s evaluation tools to reconstruct the free energy surface and discover relevant metastable states and transition pathways. Most ubiquitous is the usage of PLUMED’s sum_hills
tool to reconstruct the free energy surface.
You possibly can take a have a look at the free energy surface (FES) after that command using this python code which can inform you how values of 1 CV relate to the opposite.
import matplotlib.pyplot as plt
import numpy as np
import plumed
from matplotlib import cm, ticker# Configure font
plt.rc('font', weight='normal', size=14)
# Read data from PLUMED output
data = plumed.read_as_pandas("/path/to/COLVAR")
# Extract and reshape data for contour plot
# Adjust the reshape parameters as needed, They need to multiply to the
# variety of bins and be as close to one another as possible
d1 = data["d1"].values.reshape(-1, 100)
t1 = data["t1"].values.reshape(-1, 100)
bias = data["bias"].values.reshape(-1, 100)
# Plot contour lines
plt.contour(d1, t1, bias, levels=np.arange(np.min(bias), np.max(bias), 10), linewidths=0.3, colours='k')
# Plot filled contour
cntr = plt.contourf(d1, t1, bias, levels=np.arange(0, 100), cmap=cm.jet)
# Add colorbar
plt.colorbar(cntr, label="u0394G [kJ/mol]")
# Set plot limits and labels
plt.xlim(np.min(d1), np.max(d1))
plt.ylim(np.min(t1), np.max(t1))
plt.xlabel("Distance between atoms 1 and 10 (d1) [nm]")
plt.ylabel("Dihedral angle involving atoms 4, 6, 8, and 10 (t1) [degrees]")
# Show plot
plt.show()
The output should look much like the topographical graph I posted earlier on (I can’t provide you with what your FESwill appear to be since you had the liberty of selecting your personal system).
It is best to also visualize the outcomes using popular visualization software like VMD to realize insights into the molecular behavior in low energy and metastable states.
Conclusion
Metadynamics, powered by PLUMED, offers a strong framework for exploring complex molecular systems. By efficiently sampling the free energy landscape, we are able to uncover hidden mechanisms in molecular systems that may’t be achieved through traditional MD because of computational constraints.
Whether you might be a novice or an experienced researcher, mastering PLUMED can significantly enhance your computational chemistry toolkit, so don’t forget to ascertain out my upcoming two articles to aid you go from beginner to expert!
Article 2 will unveil the mathematical concepts behind adding metadynamics components to an MD engine, and Article 3 will expose you to advanced techniques in metadynamics corresponding to multiple walker metadynamics, condensing greater than 2 variables right into a readable format, utilizing metadynamics on high-performance clusters, and more in-depth analytical techniques to visualise and quantitatively analyze your system results (with loads of sample code).