Learn R Programming

MetadynMiner3d

Web site

https://metadynamics.cz/metadynminer3d/

https://spiwokv.github.io/metadynminer3d/ (pkgdown web)

Introduction

MetadynMiner is R packages for reading, analysis and visualization of metadynamics HILLS files produced by Plumed. It reads HILLS files from Plumed, calculates free energy surface by fast Bias Sum algorithm, finds minima and analyses transition paths by Nudged Elastic Band method.

MetadynMiner3d is its addendum for plotting 3D free energy surfaces. It uses RGL package. MetadynMiner3d installs and loads metadynminer automatically.

Usage

# Install from R repository
install.packages("metadynminer3d")

# Install from GitHub by devtools
install.packages("devtools")
devtools::install_github("spiwokv/metadynminer3d")

# Load library
library(metadynminer3d)
# Read hills file
hillsf<-read.hills3d("HILLS", per=c(TRUE, TRUE, TRUE)) # HILLS with periodicity on CV1, CV2 and CV3

# Sum two hills files
hillsf+hillsf

# Summary of a hills file
summary(hillsf)

# Plot CVs
plot(hillsf)
# Plot heights
plotheights(hillsf)
# Calculate FES by bias sum (alternatively use fes2 for conventional calculation)
tfes<-fes(hillsf)

# Calculate FES for given range (indexes of hills)
tfes<-fes(hillsf, imin=5000, imax=10000)

# Sum two FESes
tfes+tfes

# Calculate and subtract min, max or mean from a FES
tfes<-tfes-min(tfes)

# Summary of FES
summary(tfes)

# Plot FES
plot(tfes, level=20)
# Find minima
minima<-fesminima(tfes)

# Summary of minima
summary(minima)

# Plot free energy minima
plot(minima)
# Calculate free energy profile for minima
prof<-feprof(minima)

# Plot free energy profile for minima
plot(prof)

Tips and Tricks

Publication quality figures

Following script can be used to generate a publication quality figure:

hillsf<-read.hills3d("HILLS", per=c(TRUE, TRUE, TRUE))
tfes<-fes(hillsf)
plot(tfes)

Change window size, zoom in and rotate if necessary, then (without closing the window) type:

rgl.snapshot(filename="plot.png")

Publication of interactive FES on web

You can save free energy surface in WebGL and present it on a web site by typing:

writeWebGL(filename="fes3d.html")

Making movie

It is possible to make movie of rotation of the plot by:

movie3d(spin3d(axis=c(0,0,1)), duration=3, dir=".", type="gif")

This will create a three-second animated GIF movie.gif file of rotation around z-axis.

Modifying aspect ratio of box

The aspect ratio of the box can be modified by:

aspect3d(2, 1, 1)

after plot command. This makes the x-axis twice longer than other axes.

Training

MetadynMiner Webinar video

Plumed Masterclass tutorial

Plumed Masterclass video 1

Plumed Masterclass video 2

Contact

Vojtech Spiwok - spiwokv{youknowwhat}vscht.cz

To contribute, se CONTRIBUTING.md

Copy Link

Version

Install

install.packages('metadynminer3d')

Monthly Downloads

175

Version

0.0.2

License

GPL-3

Maintainer

Last Published

April 14th, 2022

Functions in metadynminer3d (0.0.2)

min.fes3d

Calculate minimum of 3D free energy surface
fes.hillsfile3d

Calculate 3D free energy surface by Bias Sum algorithm
fes2.hillsfile3d

Calculate 3D free energy surface by conventional algorithm
fespoint.hillsfile3d

Calculate free energy at given point in the CV space
plotheights.hillsfile3d

Plot evolution of heights of hills in hillsfile3d object
fesminima.fes3d

Find free energy minima in the fes3d object
tail.hillsfile3d

Print last n lines of hillsfile3d
plot.minima3d

Plot minima3d object
print.fes3d

Print minimum and maximum of 3D free energy surface
oneminimum.fes3d

Creates one ad hoc 3D free energy minimum for a fes object
print.hillsfile3d

Print hillsfile3d
summary.hillsfile3d

Print summary for hillsfile3d
read.plumed3d

Read 3D free energy surface from PLUMED sum_hills
summary.fes3d

Print summary of 3D free energy surface
plot.hillsfile3d

Plot hillsfile3d object
max.fes3d

Calculate maximum of 3D free energy surface
head.hillsfile3d

Print first n lines of hillsfile3d
plot.fes3d

Plot 3D free energy surface object
summary.minima3d

Print minima3d object summary
feprof.minima3d

Calculate free energy profile for minima3d object
read.hills3d

Read 3D HILLS from Plumed
acealanme3d

Hills from 30 ns metadynamics of AceAlaNme in water with three collective variable
print.minima3d

Print minima3d object