charnley / rmsd

Calculate Root-mean-square deviation (RMSD) of two molecules, using rotation, in xyz or pdb format
BSD 2-Clause "Simplified" License
495 stars 114 forks source link

How to calculate rotation matrix using rmsd? #69

Closed Z-Jeff closed 3 years ago

Z-Jeff commented 3 years ago

How to calculate the rotation matrix between two set paired sets of points using rmsd?

nbehrnd commented 3 years ago

While this thought did not occur to mine earlier, I welcome and support the suggestion to add an optional report of the transformation matrix.

Aside from «reproducible research» for working with 'calculate_rmsd.py' with either Kabsch algorithm, or quarternion approach, there are other programs in search for a best fit of two structures superimposed (e.g., PyMol, CrystalCMP allow to work with batches of structures; aRMSD restrains to a one-by-one basis). Here, the optional report of the transformation matrix were of diagnostic value, complementary to the measure «... and what is the remaining difference between the two?» already provided.

On Wed, 18 Nov 2020 17:59:19 -0800 Z-Jeff notifications@github.com wrote:

How to calculate the rotation matrix between two set paired sets of points using rmsd?

andersx commented 3 years ago
# Center geometries
query_geometry -= np.mean(query_geometry, axis=0)
reference_geometry -= np.mean(reference_geometry, axis=0)

# Get rotation matrix
U = rmsd.kabsch(query_geometry, reference_geometry)
charnley commented 3 years ago

@Z-Jeff did that answer your question?