molsysmt.structure.least_rmsd_align#

molsysmt.structure.least_rmsd_align(molecular_system, selection='atom_name=="CA"', structure_indices='all', reference_molecular_system=None, reference_selection=None, reference_structure_index=0, syntax='MolSysMT', engine_sequence_alignment='Biopython', engine_least_rmsd_fit='MolSysMT', in_place=False, use_gpu=None, gpu_backend=None, precision=None, skip_digestion=False)[source]#

Align a molecular system to a reference using sequence alignment followed by least-RMSD fitting.

This is a two-step procedure:

  1. Sequence alignment — the topology of both systems is aligned using molsysmt.topology.get_sequence_identity (via engine_sequence_alignment) to identify structurally equivalent residue groups.

  2. Least-RMSD fit — least_rmsd_fit is called on the equivalent atoms to compute the optimal rotation/translation (Kabsch algorithm) and apply it to all atoms in the selected components.

This function is suitable for aligning homologous proteins whose sequences differ, where a simple atom-by-atom correspondence cannot be assumed.

Parameters:
  • molecular_system (molecular system) – Molecular system in any supported MolSysMT format.

  • selection (str, list, tuple, or numpy.ndarray, default='atom_name=="CA"') – 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_sequence_alignment (str, default='Biopython') – Backend used to align the reference and target sequences.

  • engine_least_rmsd_fit (str, default='MolSysMT') – Backend used for the least-RMSD fit.

  • in_place (bool, default=False) – Whether to modify the input molecular system in place.

  • use_gpu (bool, default=None) – Whether to perform computation using GPU acceleration.

  • gpu_backend (str or None, default=None) – GPU array backend, or None to use the configured backend.

  • precision ({'single', 'double'} or None, default=None) – Floating-point precision, or None to use the configured precision.

  • skip_digestion (bool, default=False) – Whether to skip MolSysMT’s internal argument digestion mechanism.

Returns:

A new molecular system with the aligned coordinates when in_place=False; None when in_place=True.

Return type:

molecular system or None

Raises:

NotImplementedMethodError – If an unsupported sequence-alignment engine or least-RMSD-fit engine is requested.

Added in version 1.0.0.