Friday, September 20, 2024

Unveiling Metadynamics. Unlock the facility of metadynamics with… | by Don Robert Stimpson | Jun, 2024

Must read


Getting Began with PLUMED

Set up:

Not gonna lie, this will get a little bit annoying, it must be patched into your MD engine. In case you’re not fascinated about GROMACS as your MD engine, right here’s a hyperlink to the plumed important web page since you’re by yourself concerning set up:

In any other case, right here’s set up them each and correctly patch them. Observe all of those instructions you probably have neither however ignore the GROMACS set up if you have already got it put in and dealing. These instructions must be executed one-by-one in your terminal/command line.

#Obtain GROMACS
wget http://ftp.gromacs.org/pub/gromacs/gromacs-2021.2.tar.gz
tar xfz gromacs-2021.2.tar.gz
cd gromacs-2021.2

#Set up and supply GROMACS
mkdir construct
cd construct
cmake .. -DGMX_BUILD_OWN_FFTW=ON -DREGRESSIONTEST_DOWNLOAD=ON
make
sudo make set up
supply /usr/native/gromacs/bin/GMXRC

#Obtain PLUMED
wget https://github.com/plumed/plumed2/releases/obtain/v2.7.1/plumed-2.7.1.tgz
tar xfz plumed-2.7.1.tgz
cd plumed-2.7.1

#set up PLUMED
./configure --prefix=/usr/native/plumed
make
sudo make set up

#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 set up

#Test set up
gmx mdrun -plumed

You’ll discover I’ve picked an older model of gromacs; that is simply to present us a greater likelihood that there aren’t any unforseen bugs shifting via these articles, you’re greater than welcome to make use of a newer model at your discretion, simply make positive that it’s PLUMED-compatible.

Fundamental Configuration:

  • Create a PLUMED enter file to outline the collective variables (CVs) that describe the system’s essential levels of freedom.

Right here’s an instance file. I’ll go into extra element on some fancier choices in Half 3 of this text collection, however for now we’ll begin by wanting on the conformational state of a set of atoms through the use of distance and torsion as our CVs. Different potential CVs embody distances between atoms, angles, dihedrals, or extra advanced features.

# Outline 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 each 500 steps
HEIGHT=0.3 # Top of the Gaussian hill
SIGMA=0.1,0.1 # Width of the Gaussian hill for every CV
FILE=HILLS # File to retailer the hills
BIASFACTOR=10 # Bias issue 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 feedback in that code block must be in depth sufficient for a fundamental understanding of the whole lot occurring, however I’ll get to all of this in article 3, and we’ll even delve past into advanced features!

Anyway, after getting this enter file (sometimes named plumed.dat) and the .tpr file required for an MD run utilizing GROMACS (take a look at gmx grompp documentation for producing that file), you’ll be able to run the metadynamics simulation by going to the working listing and typing into the command line:

gmx mdrun -s topol.tpr -plumed plumed.dat

Each PLUMED and GROMACS settle for further arguments. I’ll go over a few of the extra helpful ones for each in Half 3 of this collection of articles alongside with some of the scripts I’ve written for extra superior runs, and you’ll take a look at the documentation for any others.

After the simulation, use PLUMED’s evaluation instruments to reconstruct the free vitality floor and establish related metastable states and transition pathways. Most ubiquitous is the usage of PLUMED’s sum_hills instrument to reconstruct the free vitality floor.

You possibly can check out the free vitality floor (FES) after that command utilizing 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='regular', dimension=14)

# Learn knowledge from PLUMED output
knowledge = plumed.read_as_pandas("/path/to/COLVAR")

# Extract and reshape knowledge for contour plot
# Regulate the reshape parameters as wanted, They need to multiply to the
# variety of bins and be as shut to one another as doable
d1 = knowledge["d1"].values.reshape(-1, 100)
t1 = knowledge["t1"].values.reshape(-1, 100)
bias = knowledge["bias"].values.reshape(-1, 100)

# Plot contour traces
plt.contour(d1, t1, bias, ranges=np.arange(np.min(bias), np.max(bias), 10), linewidths=0.3, colours='ok')

# Plot crammed contour
cntr = plt.contourf(d1, t1, bias, ranges=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]")

# Present plot
plt.present()

The output ought to look just like the topographical graph I posted earlier on (I can’t offer you what your FESwill appear like since you had the liberty of selecting your personal system).

You also needs to visualize the outcomes utilizing fashionable visualization software program like VMD to realize insights into the molecular conduct in low vitality and metastable states.

Conclusion

Metadynamics, powered by PLUMED, presents a sturdy framework for exploring advanced molecular techniques. By effectively sampling the free vitality panorama, we are able to uncover hidden mechanisms in molecular techniques that may’t be achieved via conventional MD attributable to computational constraints.

Whether or not you’re a novice or an skilled researcher, mastering PLUMED can considerably improve your computational chemistry toolkit, so don’t overlook to take a look at my upcoming two articles that can assist you go from newbie to skilled!

Article 2 will unveil the mathematical ideas behind including metadynamics parts to an MD engine, and Article 3 will expose you to superior strategies in metadynamics resembling a number of walker metadynamics, condensing greater than 2 variables right into a readable format, using metadynamics on high-performance clusters, and extra in-depth analytical strategies to visualise and quantitatively analyze your system outcomes (with loads of pattern code).



Supply hyperlink

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article