RigidRMSD is a library for rapid computations of the root mean square deviations (RMSDs) corresponding to a set of rigid body transformations of a coordinate vector (which can be a molecule in PDB format, for example). Calculation of the RMSD splits into two steps:

  1. Initialization, which is linear in the number of vector entities (or particles in a rigid body).
  2. RMSD computation, which is computed in constant time for a single rigid-body spatial transformation (rotation + translation). This step uses the inertia tensor and the the center of mass computed on the first step.

Initialization step is performed only once. It makes RigidRMSD particularly useful when computing multiple RMSDs, since each new RMSD calculation takes only constant time.


Let \(\mathbf{R}\) be a rotation matrix and \(\mathbf{T}\) – a translation vector applied to a molecule with \(N\) atoms at positions \(A=\{\mathbf{a}_{i}\}_{N}\) with \(\mathbf{a}_{i}=\{x_{i},y_{i},z_{i}\}^T\), such that the new positions \(A’=\{\mathbf{a}_{i}’\}_{N}\) are given as


Then, the weighted RMSD between \(A\) and \(A’\) is given as


Introducing the inertia tensor \(\mathbf{I}\), the rotation matrix \(\mathbf{R}\) (with the corresponding rotation quaternion \(\hat{Q}=[s,\mathbf{q}]\)), the center of mass vector \(\mathbf{C}\), and the \(3\times3\) identity matrix \(\mathbf{E}_{3}\), we may simplify the RMSD expression to

\begin{equation} \text{RMSD}^{2}=\mathbf{T}^{2}+\frac{4}{W}\mathbf{q}^{T}\mathbf{I}\mathbf{q}+2\mathbf{T}^{T}\left(\mathbf{R}-\mathbf{E}_{3}\right)\mathbf{C},\label{eq:principal} \end{equation}

where \(\mathbf{C}=\frac{1}{W}\left\{ \sum w_{i}x_{i},\sum w_{i}y_{i},\sum w_{i}z_{i}\right\} ^{T}\), and the inertia tensor \(\mathbf{I}\) is given as

\sum w_{i}(y_{i}^{2}+z_{i}^{2}) & -\sum w_{i}x_{i}y_{i} & -\sum w_{i}x_{i}z_{i}\\
-\sum w_{i}x_{i}y_{i} & \sum w_{i}(x_{i}^{2}+z_{i}^{2}) & -\sum w_{i}y_{i}z_{i}\\
-\sum w_{i}x_{i}z_{i} & -\sum w_{i}y_{i}z_{i} & \sum w_{i}(x_{i}^{2}+y_{i}^{2})

This RMSD equation is the principal result of this work. It consists of three parts, the pure translational contribution \(\mathbf{T}^{2}\), the pure rotational contribution \(\frac{4}{W}\mathbf{q}^{T}\mathbf{I}\mathbf{q}\), and the cross-term \(2\mathbf{T}^{T}\left(\mathbf{R}-\mathbf{E}_{3}\right)\mathbf{C}\), which vanishes in the Centre-Of-Mass (COM) reference frame. In this equation, only two variables depend on the atomic positions \(\{\mathbf{a}_{i}\}_{N}\), the inertia tensor \(\mathbf{I}\), and the center of mass vector \(\mathbf{C}\).

RMSD corresponding to a pure rotation

If a rigid molecule is rotated about a unit axis \(\mathbf{n}\) passing through the origin by an angle \(\alpha\), the RMSD for such a rotation is given as


where \(I(\mathbf{n})\) is the reduction of the inertia tensor to a scalar form for the unit axis \(\mathbf{n}\):



Petr Popov and Sergei Grudinin,

NANO-D, INRIA Grenoble — Rhone-Alpes, 38334 Saint Ismier Cedex, Montbonnot, France.Laboratoire Jean Kuntzmann, B.P. 53, 38041 Grenoble Cedex 9, France.e-mail: Sergei.Grudinin @ inria.fr


RigidRMSD library


This software is governed by the CeCILL license (GPL compatible). See the information delivered on the Free Software Foundation on CeCILL, http://www.gnu.org/licenses/license-list.html.

You can use, modify and/or redistribute the software under the terms of the CeCILL license as circulated by CEA, CNRS and Inria at the following URL: http://www.cecill.info.


Petr Popov and Sergei Grudinin, “Rapid determination of RMSDs corresponding to macromolecular rigid body motions”. J. Comput. Chem.2014, DOI: 10.1002/jcc.23569. Full text pdf.

Comments are closed.