{'fraction_non_alphanumeric': 0.02644466209598433, 'fraction_numerical': 0.019588638589618023, 'mean_word_length': 4.7740112994350286, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Using quaternions to calculate RMSD

A widely used way to compare the structures of biomolecules or solid bodies is to translate and rotate one structure with respect to the other to minimize the root‐mean‐square deviation (RMSD). We present a simple derivation, based on quaternions, for the optimal solid body transformation (rotation‐translation) that minimizes the RMSD between two sets of vectors. We prove that the quaternion method is equivalent to the well‐known formula due to Kabsch. We analyze the various cases that may arise, and give a complete enumeration of the special cases in terms of the arrangement of the eigenvalues of a traceless, 4 × 4 symmetric matrix. A key result here is an expression for the gradient of the RMSD as a function of model parameters. This can be useful, for example, in finding the minimum energy path of a reaction using the elastic band methods or in optimizing model parameters to best fit a target structure. © 2004 Wiley Periodicals, Inc. J Comput Chem 25: 1849–1857, 2004