Calculate RMSD using, translation and rotation, between molecules
Project description
The root-mean-square deviation (RMSD) is calculated, using Kabsch algorithm (1976) or Quaternion algorithm (1991) for rotation, between two Cartesian coordinates in either .xyz or .pdb format, resulting in the minimal RMSD.
For more information please read RMSD and Kabsch algorithm.
Installation
From PyPI
pip install rmsd
Download Python file
There is only one Python file, so you can also download that and put it in your bin folder.
wget -O calculate_rmsd https://raw.githubusercontent.com/charnley/rmsd/master/calculate_rmsd.py
If you want to use it as a python package, then clone it the down and copy-paste the rmsd folder to the directory you need.
Usage
Type calculate_rmsd --help for all the arguments.
Pretty straight forward execution, clone and run as
calculate_rmsd molecule1.xyz molecule2.xyz
or
calculate_rmsd protein.pdb protein.pdb
Citation
- Kabsch algorithm:
Kabsch W., 1976, A solution for the best rotation to relate two sets of vectors, Acta Crystallographica, A32:922-923, doi: http://dx.doi.org/10.1107/S0567739476001873
- Quaternion algorithm:
Michael W. Walker and Lejun Shao and Richard A. Volz, 1991, Estimating 3-D location parameters using dual number quaternions, CVGIP: Image Understanding, 54:358-367, doi: http://dx.doi.org/10.1016/1049-9660(91)90036-o
- Implementation:
Calculate RMSD for two XYZ structures, GitHub, http://github.com/charnley/rmsd, <commit hash or version number>
Please remmeber to cite this implementation when using it for scientific publications.
More usage examples
Same structure, but translated in space, so the RMSD should be zero
calculate_rmsd examples/ethane.xyz examples/ethane_translate.xyz
You can also output (stdout) molecule1’s coordinates centered and rotated to molecule2. Useful to visualize the difference. The output will be in XYZ format.
calculate_rmsd --output examples/ethane.xyz examples/ethane_translate.xyz
You can also use PDB format by using the argument -f pdb as seen:
calculate_rmsd -f pdb examples/ci2_1.pdb examples/ci2_2.pdb
Problems?
Submit issues on GitHub or submit pull requests.