Analysis

PLUMED can be used to analyze trajectories either on the fly during an MD run or via post processing a trajectory using driver. A molecular dynamics trajectory is in essence an ordered set of configurations of atoms. Trajectory analysis algorithms are methods that allow us to extract meaningful information from this extremely high-dimensionality information. In extracting this information much of the information in the trajectory will be discarded and assumed to be irrelevant to the problem at hand. For example, when we calculate a histogram from a trajectory we throw away all information on the order the frames were visited during the trajectory. We instead opt to display a time average that shows the parts of configuration space that were
visited most frequently. There are many situations in which this is a reasonable thing to do as we know that time averages are equivalent to ensemble averages in the long timescale limit and that these average probabilities of being in different parts of configuration space, \(P(s)\), are thus related to the underlying free energy, \(F(s)\), via:

\[ F(s) = - k_B T \ln P(s) \]

About the simplest form of analysis that PLUMED can perform involves printing information to a file. PLUMED can output various different kinds of information to files as described below:

COMMITTOR Does a committor analysis.
DUMPATOMS Dump selected atoms on a file.
DUMPDERIVATIVES Dump the derivatives with respect to the input parameters for one or more objects (generally CVs, functions or biases).
DUMPFORCES Dump the force acting on one of a values in a file.
DUMPMASSCHARGE Dump masses and charges on a selected file.
DUMPPDB Output PDB file.
DUMPPROJECTIONS Dump the derivatives with respect to the input parameters for one or more objects (generally CVs, functions or biases).
DUMPVECTOR Print a vector to a file
PRINT Print quantities to a file.
PRINT_NDX Print an ndx file
SELECT_COMPONENTS Create a new value to hold a subset of the components that are in a vector or matrix
UPDATE_IF Conditional update of other actions.

The UPDATE_IF action allows you to do more complex things using the above print commands. As detailed in the documentation for UPDATE_IF when you put any of the above actions within an UPDATE_IF block then data will only be output to the file if colvars are within particular ranges. In other words, the above printing commands, in tandem with UPDATE_IF, allow you to identify the frames in your trajectory that satisfy some particular criteria and output information on those frames only.

Another useful command is the COMMITTOR command. As detailed in the documentation for COMMITTOR this command tells PLUMED (and the underlying MD code) to stop the calculation one some criteria is satisfied, alternatively one can use it to keep track of the number of times a criteria is satisfied.

A number of more complicated forms of analysis can be performed that take a number of frames from the trajectory as input. In all these commands the STRIDE keyword is used to tell PLUMED how frequently to collect data from the trajectory. In all these methods the output from the analysis is a form of ensemble average. If you are running with a bias it is thus likely that you may want to reweight the trajectory frames in order to remove the effect the bias has on the static behavior of the system. The following methods can thus be used to calculate weights for the various trajectory frames so that the final ensemble average is an average for the canonical ensemble at the appropriate temperature.

Reweighting and Averaging

COVARIANCE_MATRIX Calculate a covariance matix
REWEIGHT_BIAS Calculate weights for ensemble averages that negate the effect the bias has on the region of phase space explored
REWEIGHT_METAD Calculate the weights configurations should contribute to the histogram in a simulation in which a metadynamics bias acts upon the system.
REWEIGHT_TEMP_PRESS Calculate weights for ensemble averages at temperatures and/or pressures different than those used in your original simulation.
WHAM Calculate the weights for configurations using the weighted histogram analysis method.
WHAM_HISTOGRAM This can be used to output the a histogram using the weighted histogram technique
WHAM_WEIGHTS Calculate and output weights for configurations using the weighted histogram analysis method.

You can then calculate ensemble averages using the following actions.

ACCUMULATE Sum the elements of this value over the course of the trajectory
AVERAGE Calculate the ensemble average of a collective variable
CUSTOM_GRID Calculate a function of the grid or grids that are input and return a new grid
EVALUATE_FUNCTION_FROM_GRID Calculate the function stored on the input grid at an arbitrary point
EVALUATE_FUNCTION_FROM_GRID_SCALAR Calculate the function stored on the input grid at an arbitrary point
EVALUATE_FUNCTION_FROM_GRID_VECTOR Calculate the function stored on the input grid for each of the points in the input vector/s
FIND_GRID_MAXIMUM Find the point with the highest value of the function on the grid
FIND_GRID_MINIMUM Find the point with the lowest value of the function on the grid
HISTOGRAM Accumulate the average probability density along a few CVs from a trajectory.
INTEGRATE_GRID Calculate the numerical integral of the function stored on the grid
MATHEVAL_GRID Calculate a function of the grid or grids that are input and return a new grid
MULTICOLVARDENS Evaluate the average value of a multicolvar on a grid.
REFERENCE_GRID Setup a constant grid by either reading values from a file or definining a function in input
SUM_GRID Sum the values of all the function at the points on a grid

For many of the above commands data is accumulated on the grids. These grids can be further analyzed using one of the actions detailed below at some time.

CONVERT_TO_FES Convert a histogram to a free energy surface.
DUMPCONTOUR Print the contour
DUMPCUBE Output a three dimensional grid using the Gaussian cube file format.
DUMPGRID Output the function on the grid to a file with the PLUMED grid format.
FIND_CONTOUR Find an isocontour in a smooth function.
FIND_CONTOUR_SURFACE Find an isocontour by searching along either the x, y or z direction.
FIND_SPHERICAL_CONTOUR Find an isocontour in a three dimensional grid by searching over a Fibonacci sphere.
FOURIER_TRANSFORM Compute the Discrete Fourier Transform (DFT) by means of FFTW of data stored on a 2D grid.
INTERPOLATE_GRID Interpolate a smooth function stored on a grid onto a grid with a smaller grid spacing.

As an example the following set of commands instructs PLUMED to calculate the distance between atoms 1 and 2 for every fifth frame in the trajectory and to accumulate a histogram from this data which will be output every 100 steps (i.e. when 20 distances have been added to the histogram).

Click on the labels of the actions for more information on what each action computes
tested on master