molsysmt.structure.get_least_rmsd#
- molsysmt.structure.get_least_rmsd(molecular_system, selection='atom_type!="H"', structure_indices='all', reference_molecular_system=None, reference_selection=None, reference_structure_index=0, syntax='MolSysMT', engine='MolSysMT', use_gpu=None, parallel=None, num_threads=None, skip_digestion=False)[source]#
Compute the least-RMSD (optimal superposition RMSD) between structures.
Unlike
get_rmsd, this function finds the rotation that minimises the RMSD before measuring it. The algorithm operates in nm and returns a quantity in the MolSysMT standard length unit.The function handles three broadcasting scenarios:
Many query structures vs. one reference — each query frame is aligned to the single reference frame.
One query structure vs. many reference frames — the single query is aligned to each reference frame.
Equal numbers of frames on both sides — frame-by-frame alignment.
- Parameters:
molecular_system (molecular system) – Molecular system in any supported MolSysMT format.
selection (str, list, tuple, or numpy.ndarray, default='atom_type!="H"') – Selection string or boolean/integer array specifying elements.
structure_indices (int, list, tuple, or numpy.ndarray, default='all') – Structure indices (0-based) to include or process.
reference_molecular_system (molecular system or None, default=None) – Reference molecular system; None uses the input molecular system.
reference_selection (str, list, tuple, or numpy.ndarray, or None, default=None) – Atoms selected from the reference molecular system.
reference_structure_index (int, default=0) – Zero-based structure index selected from the reference system.
syntax (str, default='MolSysMT') – Selection syntax used to evaluate selection (e.g., ‘MolSysMT’, ‘MDTraj’).
engine (str, default='MolSysMT') – Backend used to perform the calculation.
use_gpu (bool, default=None) – Whether to perform computation using GPU acceleration.
parallel (bool or None, default=None) – Whether to use CPU parallelism, or None to use the configured default.
num_threads (int or None, default=None) – Number of CPU worker threads, or None to use the configured default.
skip_digestion (bool, default=False) – Whether to skip MolSysMT’s internal argument digestion mechanism.
- Returns:
PyUnitWizard length quantity of shape
(n_structures,)containing the least-RMSD values in the standard length unit (nm).- Return type:
quantity
- Raises:
NotImplementedMethodError – If an unsupported engine is requested.
StructuralInconsistencyError – If the number of atoms resolved by
selectionandreference_selectiondiffer.
Added in version 1.0.0.