Command-line tool#

Installing the package places an irmsd executable on the PATH. It reads an arbitrary number of structures and runs one of three subcommands on them:

Subcommand

Purpose

irmsd prop

Structural properties: coordination numbers, rotational constants, point group, canonical atom identifiers

irmsd compare

iRMSD (default) or quaternion RMSD between two structures, with the aligned structures

irmsd sort (alias prune)

Pruning of an ensemble to its unique structures

Input structures#

.xyz and .extxyz files are read by the package itself, and every frame of a multi-frame file is used. All other formats (e.g. .pdb, .cif, POSCAR) are read via ASE, which requires pip install "irmsd[ase]".

Energies are taken from the comment line of each frame and are used by irmsd sort:

  • an extended-XYZ energy= key, in Hartree unless the line also carries energy_units=eV,

  • otherwise the first bare number on the comment line, in Hartree (the format written by CREST and xtb).

An extended-XYZ file may carry a per-atom canonical_id column (written e.g. by irmsd prop --canonical -o out.extxyz). compare and sort use these identifiers when they are consistent between the structures and recompute them otherwise; --recompute-ids discards them altogether.

Examples#

Properties of a single structure:

irmsd prop --all molecule.xyz
irmsd prop --canonical --heavy -o ids.extxyz molecule.xyz

Compare two structures; the iRMSD restores the atom order, the quaternion RMSD does not:

irmsd compare struc1.xyz struc2.xyz -o aligned.xyz
irmsd compare --quaternion struc1.xyz struc2.xyz

Prune a conformer ensemble and write one representative per unique structure:

irmsd sort ensemble.xyz -o unique.xyz
irmsd sort ensemble.xyz --rthr 0.2 --ethr          # looser RMSD threshold, energy presorting
irmsd sort ensemble.xyz --classic                  # CREGEN-style sorting (cheaper, more empirical)

If the input contains different molecules, sort first splits it into separate ensembles by sum formula. The default RMSD threshold of 0.125 Å is discussed in Example 4. The iRMSD comparisons inside sort run in parallel with OpenMP; see Parallel sorting (OpenMP).

Reference#

CLI to read an arbitrary number of structures and run selected analysis commands on them.

usage: irmsd [-h] [-v] {prop,compare,sort,prune} ...

Positional Arguments#

command

Possible choices: prop, compare, sort, prune

Subcommand to run.

Named Arguments#

-v, --version

show program’s version number and exit

Sub-commands#

prop#

Compute structural properties (CN, rotational constants, point group, canonical IDs).

irmsd prop [-h] [--cn] [--rot] [--canonical] [--sym] [--sym-thr BOHR]
           [--sym-primary BOHR] [--sym-maxat N] [--sym-maxorder N]
           [--sym-maxcycles N] [--all] [--heavy] [-o OUTPUT]
           structures [structures ...]
Positional Arguments#
structures

Paths to structure files (e.g. .xyz, .pdb, .cif).

Named Arguments#
--cn

Calculate coordination numbers according to the covalent D4 scheme.

Default: False

--rot

Calculate the rotational constants.

Default: False

--canonical

Calculate the canonical identifiers.

Default: False

--sym

Determine the Schoenflies point group and symmetry operations (skipped above –sym-maxat atoms).

Default: False

--all

Calculate all of the above.

Default: False

--heavy

When calculating canonical atom identifiers, consider only heavy atoms.

Default: False

-o, --output

Output file name (optional). Pickle (.pkl) holds all computed properties; an .xyz/.extxyz output dumps the structures, including a per-atom canonical_id column when –canonical was requested.

symmetry detection#

Settings for –sym. Tolerances are in Bohr. For large or noisy structures, raise –sym-maxat and –sym-thr.

--sym-thr

Final tolerance: largest atom displacement a symmetry element may cause (default: 0.1).

Default: 0.1

--sym-primary

Tolerance for pairing symmetry-related atoms and prescreening candidates; larger values are slower (default: 0.5).

Default: 0.5

--sym-maxat

Skip structures with more atoms than this; 0 disables the limit (default: 200).

Default: 200

--sym-maxorder

Highest rotation axis order searched, including S2n axes; values below 10 can miss e.g. Ih (default: 10).

Default: 10

--sym-maxcycles

Maximum optimization cycles per symmetry element (default: 100).

Default: 100

compare#

Compare structures via iRMSD (default) or quaternion RMSD.

irmsd compare [-h] [--quaternion] [--inversion {on,off,auto}] [--heavy]
              [--recompute-ids] [-o OUTPUT] [--ref-idx REF_IDX]
              [--align-idx ALIGN_IDX]
              structures [structures ...]
Positional Arguments#
structures

Paths to structure files (e.g. .xyz, .pdb, .cif).

Named Arguments#
--quaternion

Use the quaternion-based Cartesian RMSD instead of the invariant RMSD.

Default: False

--inversion

Possible choices: on, off, auto

Control coordinate inversion in iRMSD runtypes: ‘on’, ‘off’, or ‘auto’ (default: auto). Used only for iRMSD.

Default: 'auto'

--heavy

When comparing structures, consider only heavy atoms.

Default: False

--recompute-ids

Discard any per-atom canonical IDs read in from the input file(s) and let the code regenerate them from scratch.

Default: False

-o, --output

Output file name (optional). If not provided, results are only printed.

--ref-idx

Index of the reference structure in the provided structure list (default: 0, i.e., the first structure).

Default: 0

--align-idx

Index of the structure to align to the reference structure (default: 1, i.e., the second structure). Used only for quaternion RMSD.

Default: 1

sort (prune)#

Sort, prune or cluster structures based on inter-structure measures. By default, the more expensive iRMSD version is used. The use of the molecules’ energies is optional (–ethr) but recommended. To fall back to the quicker, but more empirical CREGEN workflow for ensemble sorting (using energies, quaternion RMSDs and rotational constants), use –classic

irmsd sort [-h] [--rthr RTHR] [--ethr [ETHR]] [--bthr BTHR] [--ewin EWIN]
           [--inversion {on,off,auto}] [--align] [--classic] [--heavy]
           [--recompute-ids] [--maxprint MAXPRINT] [-o OUTPUT]
           structures [structures ...]
Positional Arguments#
structures

Paths to structure files (e.g. .xyz, .pdb, .cif).

Named Arguments#
--rthr

Inter-structure RMSD threshold for sorting in Angström. Structures closer than this threshold are treated as similar.

Default: 0.125

--ethr

Inter-structure energy threshold in Hartree. If set, the default is 8.0e-5 Ha (≈0.05 kcal/mol) or a user-specified value. Optional for iRMSD-based runtypes.

--bthr

Inter-structure rotational threshold used in the classical CREGEN sorting procedure. The default is 0.01.

Default: 0.01

--ewin

Energy window specification for CREGEN. Structures higher in energy than this threshold (relative to the lowest energy structure in the ensemble) will be removed. There is no default (all conformers are considered).

--inversion

Possible choices: on, off, auto

Control coordinate inversion when evaluating RMSDs during sorting: ‘on’, ‘off’, or ‘auto’ (default: auto). Only for iRMSD-based runtypes.

Default: 'auto'

--align

Just sort by energy and align.

Default: False

--classic, --cregen

Perform conformer classification with the CREGEN workflow based on a comparison of quaternion RMSD, energy, interatomic distances, and rotational constants. This routine is cheaper but more empirical than iRMSD-based sorting. Does NOT restore mismatching atom order. Does not keep individual rotamers.

Default: False

--heavy

TODO for sorting routines.

Default: False

--recompute-ids

Discard any per-atom canonical IDs read in from the input file(s) and let the code regenerate them from scratch.

Default: False

--maxprint

Printout option; determine how many rows are printed for each sorted ensemble.

Default: 15

-o, --output

Optional output file for sorted / clustered results.