## Task 2 : RigidRMSD

**About**

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:

- Initialization, which is linear in the number of vector entities (or particles in a rigid body).
- 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.

**Methods**

Let * R* be a rotation matrix and

**T**- a translation vector applied to a molecule with

*N*atoms at positions A={

**a**

_{i}}

_{N}with

**a**

_{i}={

**x**

_{i},

**y**

_{i},

**z**

_{i}}

^{T}, such that the new positions A'={

**a**

_{i}'}

_{N}are given as

\begin{align}\mathbf{a}'_{i}=\mathbf{R}\mathbf{a}_{i}+\mathbf{T}.\end{align}

Then, the weighted RMSD between A and A*'* is given as

$$\text{RMSD}^{2}(A,A')=\frac{1}{W}\sum_{i}w_{i}\left|\mathbf{a}_{i}-\mathbf{R}\mathbf{a}_{i}-\mathbf{T}\right|^{2}.$$

Introducing the inertia tensor **I**, the rotation matrix **R** (with the corresponding rotation quaternion **Q**=[s,**q**]), the center of mass vector **C**, and the 3x3 identity matrix **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 **C**={∑ w_{i}x_{i},∑w_{i}y_{i},∑ w_{i}z_{i}}^{T}/W, and the inertia tensor **I** is given as

\begin{equation}

\mathbf{I}=\left(\begin{array}{ccc}

\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})

\end{array}\right).\label{eq:inertiaTensor}

\end{equation}

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

**RMSD corresponding to a pure rotation**

If a rigid molecule is rotated about a unit axis **n** passing through the origin by an angle α, the RMSD for such a rotation is given as

\begin{equation}

\text{RMSD}^{2}=\frac{4}{W}\sin^{2}\frac{\alpha}{2}I(\mathbf{n}),

\label{eq:pureRotation}

\end{equation}

where I(**n**) is the reduction of the inertia tensor to a scalar form for the unit axis **n**:

\begin{equation}

I(\mathbf{n})=\mathbf{n}^{T}\mathbf{I}\mathbf{n}.

\label{eq:scalarForm}

\end{equation}

**Download**

http://nano-d.inrialpes.fr/software/RigidRMSD

**Reference**

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.