iRMSD#

Molecular structure comparison and ensemble pruning


iRMSD is a toolkit for molecular structure comparison and ensemble pruning based on the permutation-invariant RMSD. A Python API and a command-line tool sit on top of a Fortran backend that handles conformer ensembles with thousands of structures.

  • iRMSD and quaternion RMSD with symmetry handling, canonical atom identifiers, and optimal superposition

  • Grouping and pruning of conformer ensembles via RMSD and (optional) energy thresholds, parallelized with OpenMP

  • A Molecule class with XYZ/extXYZ input and output, and interfaces to ASE and RDKit

  • Structural properties: coordination numbers, rotational constants, point groups

  • Low-level wrappers of the Fortran routines next to the high-level Python functions

iRMSD is meant for conformational sampling, machine learning for molecules, and structural chem-informatics, and works with structures from ASE, RDKit, CREST/xtb, or any other source of XYZ files.

The two structures above are copies of the same fluoxetine conformer, randomly rotated and with a random atom order (the labels are the atom indices in each file). Kept in the atom order of the files, their quaternion RMSD is 5.13 Å; the iRMSD aligns the copies, restores the atom order, and finds them identical:

$ irmsd compare examples/xyz/fluoxetine_1.xyz examples/xyz/fluoxetine_2.xyz | tail -1
iRMSD: 0.0000879250 Å

Quick start#

pip install irmsd

Wheels are available for Linux, macOS (arm64), and Windows (x86_64). The same install provides the irmsd command-line tool:

irmsd compare struc1.xyz struc2.xyz        # iRMSD between two structures, atom order restored
irmsd sort ensemble.xyz -o unique.xyz      # prune an ensemble to its unique structures

and the Python API:

import irmsd

molecules = irmsd.read_structures("ensemble.xyz")        # one Molecule per frame
unique = irmsd.prune(molecules, rthr=0.125)              # RMSD threshold in Å
irmsd.write_structures("unique.xyz", unique)

Documentation#

The documentation is hosted at https://pprcht.github.io/irmsd/.

Topic

Page

Wheels, OpenMP, building from source

Installation

The iRMSD method, a worked example, known limitations

Scientific background

Interactive flowchart of a single comparison, step by step

How a comparison works

Rotamers, randomized atom order, clusters, ensemble pruning, timings

Examples

irmsd prop, compare, and sort, with all options

Command-line tool

Molecule, comparison, sorting, ASE and RDKit, canonical identifiers

Python interface

All functions and classes

Package reference

Citation#

If you use iRMSD in academic work, please cite

P. Pracht, J. Chem. Inf. Model. 2025, 65 (9), 4501–4511. doi:10.1021/acs.jcim.4c02143

A publicly accessible preprint is available at doi:10.26434/chemrxiv-2024-qmcz4.