RMSD
This is part of the colvar module

Calculate the RMSD with respect to a reference structure.

The aim with this colvar it to calculate something like:

\[ d(X,X') = \vert X-X' \vert \]

where \( X \) is the instantaneous position of all the atoms in the system and \( X' \) is the positions of the atoms in some reference structure provided as input. \( d(X,X') \) thus measures the distance all the atoms have moved away from this reference configuration. Oftentimes, it is only the internal motions of the structure - i.e. not the translations of the center of mass or the rotations of the reference frame - that are interesting. Hence, when calculating the the root-mean-square deviation between the atoms in two configurations you must first superimpose the two structures in some way. At present PLUMED provides two distinct ways of performing this superposition. The first method is applied when you use TYPE=SIMPLE in the input line. This instruction tells PLUMED that the root mean square deviation is to be calculated after the positions of the geometric centers in the reference and instantaneous configurations are aligned. In other words \(d(X,x')\) is to be calculated using:

\[ d(X,X') = \sqrt{ \sum_i \sum_\alpha^{x,y,z} \frac{w_i}{\sum_j w_j}( X_{i,\alpha}-com_\alpha(X)-{X'}_{i,\alpha}+com_\alpha(X') )^2 } \]

with

\[ com_\alpha(X)= \sum_i \frac{w'_{i}}{\sum_j w'_j}X_{i,\alpha} \]

and

\[ com_\alpha(X')= \sum_i \frac{w'_{i}}{\sum_j w'_j}X'_{i,\alpha} \]

Obviously, \( com_\alpha(X) \) and \( com_\alpha(X') \) represent the positions of the center of mass in the reference and instantaneous configurations if the weights $w'$ are set equal to the atomic masses. If the weights are all set equal to one, however, \(com_\alpha(X) \) and \( com_\alpha(X') \) are the positions of the geometric centers. Notice that there are sets of weights: \( w' \) and \( w \). The first is used to calculate the position of the center of mass (so it determines how the atoms are aligned). Meanwhile, the second is used when calculating how far the atoms have actually been displaced. These weights are assigned in the reference configuration that you provide as input (i.e. the appear in the input file to this action that you set using REFERENCE=whatever.pdb). This input reference configuration consists of a simple pdb file containing the set of atoms for which you want to calculate the RMSD displacement and their positions in the reference configuration. It is important to note that the indices in this pdb need to be set correctly. The indices in this file determine the indices of the instantaneous atomic positions that are used by PLUMED when calculating this colvar. As such if you want to calculate the RMSD distance moved by the 1st, 4th, 6th and 28th atoms in the MD codes input file then the indices of the corresponding refernece positions in this pdb file should be set equal to 1, 4, 6 and 28.

The pdb input file should also contain the values of \(w\) and \(w'\). In particular, the OCCUPANCY column (the first column after the coordinates) is used provides the values of \( w'\) that are used to calculate the position of the centre of mass. The BETA column (the second column after the Cartesian coordinates) is used to provide the \( w \) values which are used in the the calculation of the displacement. Please note that it is possible to use fractional values for beta and for the occupancy. However, we recommend you only do this when you really know what you are doing however as the results can be rather strange.

In PDB files the atomic coordinates and box lengths should be in Angstroms unless you are working with natural units. If you are working with natural units then the coordinates should be in your natural length unit. For more details on the PDB file format visit http://www.wwpdb.org/docs.html. Make sure your PDB file is correclty formatted as explained in this page.

A different method is used to calculate the RMSD distance when you use TYPE=OPTIMAL on the input line. In this case the root mean square deviation is calculated after the positions of geometric centers in the reference and instantaneous configurations are aligned AND after an optimal alignment of the two frames is performed so that motion due to rotation of the reference frame between the two structures is removed. The equation for \(d(X,X')\) in this case reads:

\[ d(X,X') = \sqrt{ \sum_i \sum_\alpha^{x,y,z} \frac{w_i}{\sum_j w_j}[ X_{i,\alpha}-com_\alpha(X)- \sum_\beta M(X,X',w')_{\alpha,\beta}({X'}_{i,\beta}-com_\beta(X')) ]^2 } \]

where \( M(X,X',w') \) is the optimal alignment matrix which is calculated using the Kearsley [54] algorithm. Again different sets of weights are used for the alignment ( \(w'\)) and for the displacement calcuations ( \(w\)). This gives a great deal of flexibility as it allows you to use a different sets of atoms (which may or may not overlap) for the alignment and displacement parts of the calculation. This may be very useful when you want to calculate how a ligand moves about in a protein cavity as you can use the protein as a reference system and do no alignment of the ligand.

(Note: when this form of RMSD is used to calculate the secondary structure variables (ALPHARMSD, ANTIBETARMSD and PARABETARMSD all the atoms in the segment are assumed to be part of both the alignment and displacement sets and all weights are set equal to one)

Please note that there are a number of other methods for calculating the distance between the instantaneous configuration and a reference configuration that are available in plumed. More information on these various methods can be found in the section of the manual on Distances from reference configurations.

Warning
The molecule used for RMSD calculation should be whole (both atoms used in alignment and in displacement calculation). In case it is broken by the host MD code, please use WHOLEMOLECULES to reconstruct it before RMSD calculation.
Compulsory keywords
REFERENCE a file in pdb format containing the reference structure and the atoms involved in the CV.
TYPE ( default=SIMPLE ) the manner in which RMSD alignment is performed. Should be OPTIMAL or SIMPLE.
Options
NUMERICAL_DERIVATIVES ( default=off ) calculate the derivatives for these quantities numerically
SQUARED

( default=off ) This should be setted if you want MSD instead of RMSD

Examples

The following tells plumed to calculate the RMSD distance between the positions of the atoms in the reference file and their instantaneous position. The Kearseley algorithm is used so this is done optimally.

RMSD REFERENCE=file.pdb TYPE=OPTIMAL

...