kabsch_align
- qcelemental.molutil.kabsch_align(rgeom, cgeom, weight=None)[source]
Finds optimal translation and rotation to align cgeom onto rgeom via Kabsch algorithm by minimizing the norm of the residual, \(|| R - U * C ||\).
- Parameters:
rgeom (
ndarray
) – (nat, 3) array of reference/target/unchanged geometry. Assumed [a0] for RMSD purposes.cgeom (
ndarray
) – (nat, 3) array of concern/changeable geometry. Assumed [a0] for RMSD purposes. Must have same Natom, units, and 1-to-1 atom ordering as rgeom.weight (
Optional
[ndarray
]) – (nat,) array of weights applied to rgeom. Note that definitions of weights (nothing to do with atom masses) are several, and I haven’t seen one yet that can make centroid the center-of-mass and also make the RMSD match the usual mass-wtd-RMSD definition. Also, only one weight vector used rather than split btwn R & C, which may be invalid if not 1-to-1. Weighting is not recommended.
- Returns:
First item is RMSD [A] between rgeom and the optimally aligned geometry computed. Second item is (3, 3) rotation matrix to optimal alignment. Third item is (3,) translation vector [a0] to optimal alignment.
- Return type:
Notes
Kabsch: Acta Cryst. (1978). A34, 827-828 http://journals.iucr.org/a/issues/1978/05/00/a15629/a15629.pdf
C++ affine code: https://github.com/oleg-alexandrov/projects/blob/master/eigen/Kabsch.cpp
weighted RMSD: http://www.amber.utah.edu/AMBER-workshop/London-2015/tutorial1/
protein wRMSD code: https://pharmacy.umich.edu/sites/default/files/global_wrmsd_v8.3.py.txt
quaternion: https://cnx.org/contents/HV-RsdwL@23/Molecular-Distance-Measures
Author: dsirianni