Skip to content

Spyrmsd

Class for calculating RMSD using Spyrmsd tool.

spyrmsdRMSD(target, reference)

Bases: RMSDBase

Calculate RMSD using spyrmsd, accounting for molecular symmetry.

Note: This is only suitable for small molecules, not proteins.

Initialize the spyrmsdRMSD class.

Validates that input files exist and are in a supported format. Converts to SDF automatically if needed.

calculate(symmetry=True, hydrogens=False, superimpose=False, mcs=False, backend='api', save=False, output_filename=None)

Calculate RMSD between reference and target using spyrmsd.

PARAMETER DESCRIPTION
symmetry

Use symmetry-corrected RMSD. Default is True.

TYPE: bool DEFAULT: True

hydrogens

Include hydrogens. Default is False.

TYPE: bool DEFAULT: False

superimpose

Superimpose before calculation. Default is False. Set to False for in-place RMSD of docked poses.

TYPE: bool DEFAULT: False

mcs

Apply MCS so ref and target are compared over their maximum common substructure. Default is False. Only supported with backend='api'; combining mcs=True with backend='cli' falls back to the API path.

TYPE: bool DEFAULT: False

backend

api (in-process via spyrmsd library) or cli (subprocess to python -m spyrmsd). Default is api.

TYPE: str DEFAULT: 'api'

save

If True, write the result to a text file. Default is False.

TYPE: bool DEFAULT: False

output_filename

Output file path (without extension) if save is True.

TYPE: str | None DEFAULT: None

Returns: List of RMSD values.