molsysmt.hbonds.get_luzard_chandler_hbonds#

molsysmt.hbonds.get_luzard_chandler_hbonds(molecular_system, selection='all', acceptors=None, donors=None, structure_indices='all', molecular_system_2=None, selection_2=None, acceptors_2=None, donors_2=None, structure_indices_2=None, distance_threshold='3.5 angstroms', angle_threshold='30 degrees', pbc=True, syntax='MolSysMT', *, output_type='tuple', skip_digestion=False)[source]#

Calculating hydrogen bonds using the Luzard–Chandler geometric criteria.

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

  • selection (str, list, tuple, or numpy.ndarray, default='all') – Selection string or boolean/integer array specifying elements.

  • acceptors (numpy.ndarray, list, or tuple, default=None) – Precomputed atom indices of hydrogen bond acceptors.

  • donors (numpy.ndarray, list, or tuple, default=None) – Precomputed atom indices of hydrogen bond donors.

  • structure_indices (int, list, tuple, or numpy.ndarray, default='all') – Structure indices (0-based) to include or process.

  • molecular_system_2 (object, default=None) – A second molecular system is not supported by this method.

  • selection_2 (str, list, tuple, or numpy.ndarray, default=None) – Second selection string or boolean/integer array.

  • acceptors_2 (numpy.ndarray, list, or tuple, default=None) – Precomputed acceptor atom indices for selection_2.

  • donors_2 (numpy.ndarray, list, or tuple, default=None) – Precomputed donor atom indices for selection_2.

  • structure_indices_2 (int, list, tuple, or numpy.ndarray, default=None) – Structure indices (0-based) for the second selection.

  • distance_threshold (quantity, default='3.5 angstroms') – Maximum donor-to-acceptor separation; equivalent to 0.35 nm.

  • angle_threshold (quantity, default='30 degrees') – Strict upper bound for the H-D-A angle, with the donor as vertex. Equivalent to pi/6 radians.

  • pbc (bool, default=True) – Whether to take periodic boundary conditions into account.

  • syntax (str, default='MolSysMT') – Selection syntax used to evaluate selection (e.g., ‘MolSysMT’, ‘MDTraj’).

  • output_type ({'tuple', 'molsysmt.Interactions'}, default='tuple') – Return the established triples, distances, and angles, or a sparse analysis with evaluated coverage, participant scope, producer versions, and periodic images. The analysis requires automatically identified roles and one selection, two disjoint participant universes, or identical role selections.

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

Returns:

By default, (atoms, distances, angles) in requested structure order. Equal counts give an int64 array of shape (n_structures, n_hbonds, 3) and quantities of shape (n_structures, n_hbonds) in nm and radians. Varying counts give aligned lists of (n_hbonds, 3) triple arrays and (n_hbonds,) quantities, including shaped empty entries. Triples use donor, hydrogen, acceptor order and original atom indices. The optional analysis preserves original local axes and deduplicates repeated requested structures. Its distance is D-A and its angle is H-D-A.

Return type:

tuple or molsysmt.Interactions

Raises:
  • NotImplementedMethodError – If a second molecular system is supplied, or the optional analysis uses supplied role arrays, a second structure axis, or partially overlapping participant universes.

  • InternalAlgorithmError – If observed periodic images disagree with the detector’s D-A distances or H-D-A angles.

Notes

The result is independent and is not automatically attached to the system. With PBC, donor-anchored D-H and D-A images reproduce the two minimum-image vectors used for the angle. The optional analysis records the calculation-time MolSysMT version in software. This method uses eager execution and does not stream large trajectories. The optional analysis records the luzar_chandler criterion and original paper in its parameters. Completed calculations contribute to an optional Ackredit workflow session; tuple outputs keep their existing layout.

Examples

>>> import molsysmt as msm
>>> from molsysmt.interactions.hbonds.get_luzard_chandler_hbonds import get_luzard_chandler_hbonds
>>> molsys = msm.convert(msm.systems["chicken villin HP35"][
...     "chicken_villin_HP35.h5msm"], to_form="molsysmt.MolSys")
>>> result = get_luzard_chandler_hbonds(molsys, selection=[0],
...     output_type="molsysmt.Interactions")
>>> result.n_interactions
0
>>> result.measure_units
{'distance': 'nm', 'angle': 'rad'}

User guide

See Get Luzar-Chandler hydrogen bonds for both geometric criteria and Querying interaction results for sparse queries and persistence.

Added in version 1.0.0.