Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (
Help us improve Python packaging - Donate today!

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.


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

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.


Type calculate_rmsd --help for all the arguments.

Pretty straight forward execution, clone and run as



calculate_rmsd protein.pdb protein.pdb


  • Kabsch algorithm:
    Kabsch W., 1976, A solution for the best rotation to relate two sets of vectors, Acta Crystallographica, A32:922-923, doi:
  • 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:
  • Implementation:
    Calculate RMSD for two XYZ structures, GitHub,, <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/ examples/

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/ examples/

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


Submit issues on GitHub or submit pull requests.

Release History

This version
History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(7.4 kB) Copy SHA256 Hash SHA256
Source May 15, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting