prolint.analysis.distances

Distance analysis for residue pair interactions.

Classes

AtomDistancesAnalysis

Compute atom-atom distance matrix at a specific frame.

DistanceAnalysis

Analyze distances between query and database residues over time.

Module Contents

class prolint.analysis.distances.AtomDistancesAnalysis(universe, contacts: prolint.core.contact_provider.ComputedContacts)[source]

Bases: prolint.analysis.base.BaseAnalysis

Compute atom-atom distance matrix at a specific frame.

Provides detailed per-atom distance information between two residues at a single trajectory frame.

See also

DistanceAnalysis

Distance time series over multiple frames

name = 'atom_distances'[source]

Analysis name for registry.

description = 'Atom-atom distance matrix at a specific frame'[source]

Human-readable description.

run(query_residue: int, database_residue: int, frame_idx: int) prolint.analysis.base.AnalysisResult[source]

Compute atom-atom distance matrix between two residues.

Parameters:
  • query_residue (int) – Query residue ID.

  • database_residue (int) – Database residue ID.

  • frame_idx (int) – Frame index to analyze. Clamped to valid range.

Returns:

Result with data containing:

  • frame : int frame index

  • query_atoms : list of str atom names

  • database_atoms : list of str atom names

  • distance_matrix : 2D list of float distances

  • min_distance, max_distance : float extrema

Return type:

AnalysisResult

Raises:

ValueError – If query or database residue not found in universe.

class prolint.analysis.distances.DistanceAnalysis(universe, contacts: prolint.core.contact_provider.ComputedContacts)[source]

Bases: prolint.analysis.base.BaseAnalysis

Analyze distances between query and database residues over time.

Computes center-of-mass distances and optionally minimum atom-atom distances between a query-database residue pair across trajectory frames.

See also

AtomDistancesAnalysis

Full distance matrix at single frame

name = 'distances'[source]

Analysis name for registry.

description = 'Distance computations between residue pairs'[source]

Human-readable description.

run(query_residue: int, database_residue: int, frame_start: int = 0, frame_end: int | None = None, frame_step: int = 1, compute_min_distances: bool = True, compute_positions: bool = True) prolint.analysis.base.AnalysisResult[source]

Compute distance time series between a residue pair.

Parameters:
  • query_residue (int) – Query residue ID.

  • database_residue (int) – Database residue ID.

  • frame_start (int, default=0) – First frame to process.

  • frame_end (int, optional) – Last frame (exclusive). Defaults to total frames.

  • frame_step (int, default=1) – Step between frames.

  • compute_min_distances (bool, default=True) – Whether to compute minimum atom-atom distances.

  • compute_positions (bool, default=True) – Whether to compute 2D positions relative to query COM.

Returns:

Result with data containing:

  • frames : list of int frame indices

  • distances : list of float center-of-mass distances

  • contact_frames : list of int frames where contact occurred

  • min_distances : list of float (if compute_min_distances)

  • positions : dict with query/database 2D positions (if compute_positions)

Return type:

AnalysisResult

Raises:

ValueError – If query or database residue not found in universe.