biotite.structure.rmspd(reference, subject, periodic=False, box=None)[source]

Calculate the RMSD of atom pair distances for given structures relative to those found in a reference structure.

Unlike the standard RMSD, the root-mean-square-pairwise-deviation (RMSPD) is a fit-free method to determine deviations between a structure and a preset reference.

\[RMSPD = \sqrt{ \frac{1}{n^2} \sum\limits_{i=1}^n \sum\limits_{j \neq i}^n (d_{ij} - d_{ref,ij})^2} \]
referenceAtomArray or ndarray, dtype=float, shape=(n,3)

The reference structure. Alternatively, coordinates can be provided directly as ndarray.

subjectAtomArray or AtomArrayStack or ndarray, dtype=float, shape=(n,3) or shape=(m,n,3)

Structure(s) to be compared with reference. Alternatively, coordinates can be provided directly as ndarray.

periodicbool, optional

If set to true, periodic boundary conditions are taken into account (minimum-image convention). The box attribute of the atoms parameter is used for calculation. An alternative box can be provided via the box parameter. By default, periodicity is ignored.

boxndarray, shape=(3,3) or shape=(m,3,3), optional

If this parameter is set, the given box is used instead of the box attribute of atoms.

rmspdfloat or ndarray, dtype=float, shape=(m,)

Atom pair distance RMSD between subject and reference. If subject is an AtomArray a float is returned. If subject is an AtomArrayStack a ndarray containing the RMSD for each model is returned.


Internally, this function uses index_distance(). For non-orthorombic boxes (at least one angle deviates from 90 degrees), periodic boundary conditions should be corrected prior to the computation of RMSPDs with periodic set to false to ensure correct results. (e.g. with remove_pbc()).