prolint.plotting.heatmap

Heatmap plotters for contact visualization.

This module provides heatmap-style visualizations for contact matrices, distance matrices, and database contact patterns.

Classes

HeatmapPlotter

Heatmap plotter for contact counts or correlation matrices.

DistanceHeatmapPlotter

Heatmap plotter for atom-atom distance matrices.

DatabaseContactsHeatmapPlotter

Heatmap plotter for per-molecule contact timelines.

Module Contents

class prolint.plotting.heatmap.HeatmapPlotter[source]

Bases: prolint.plotting.base.BasePlotter

Heatmap plotter for contact counts or correlation matrices.

Works with timeseries results (residue × frame heatmaps) or shared_contacts results (residue × residue correlation matrices).

See also

TimeSeriesAnalysis

Generates timeseries data

SharedContactsAnalysis

Generates correlation matrices

name = 'heatmap'[source]
required_analysis = 'timeseries'[source]
description = '2D heatmap for contact counts or correlation matrices'[source]
classmethod validate_result(result: prolint.analysis.base.AnalysisResult) None[source]

Validate that the AnalysisResult contains required data keys.

Parameters:

result (AnalysisResult) – Result to validate.

Raises:

ValueError – If result is missing required keys for this plotter.

classmethod plot(result: prolint.analysis.base.AnalysisResult, colorscheme: str = 'viridis', figsize: Tuple[float, float] | None = None, show_row_labels: bool = True, show_col_labels: bool = True, show_colorbar: bool = True, xlabel: str = '', ylabel: str = '', title: str = '', vmin: float | None = None, vmax: float | None = None, aspect: str = 'auto', ax: matplotlib.axes.Axes | None = None, cbar_label: str = '', max_display_rows: int = 40, max_display_cols: int = 200, origin: str = 'upper') Tuple[matplotlib.figure.Figure, matplotlib.axes.Axes][source]

Create a 2D heatmap visualization.

Parameters:
  • result (AnalysisResult) – Result from timeseries or shared_contacts analysis.

  • colorscheme (str, default="viridis") – Color scale name.

  • figsize (tuple of float, optional) – Figure size (width, height). Auto-calculated if None.

  • vmin (float, optional) – Color scale limits.

  • vmax (float, optional) – Color scale limits.

  • ax (Axes, optional) – Existing axes to plot on.

  • max_display_rows (int) – Maximum rows/columns before sampling.

  • max_display_cols (int) – Maximum rows/columns before sampling.

Returns:

Matplotlib figure and axes objects.

Return type:

tuple of (Figure, Axes)

class prolint.plotting.heatmap.DistanceHeatmapPlotter[source]

Bases: prolint.plotting.base.BasePlotter

Heatmap plotter for atom-atom distance matrices.

Visualizes pairwise distances between atoms of two residues at a specific frame.

See also

AtomDistancesAnalysis

Generates distance matrix data

name = 'distance_heatmap'[source]
required_analysis = 'atom_distances'[source]
description = 'Atom-atom distance matrix heatmap'[source]
classmethod validate_result(result: prolint.analysis.base.AnalysisResult) None[source]

Validate that result contains distance matrix data.

classmethod plot(result: prolint.analysis.base.AnalysisResult, colorscheme: str = 'viridis', figsize: Tuple[float, float] | None = None, show_colorbar: bool = True, xlabel: str = 'Database Atoms', ylabel: str = 'Query Atoms', title: str = '', vmin: float | None = None, vmax: float | None = None, ax: matplotlib.axes.Axes | None = None, cbar_label: str = 'Distance (Å)', annotate: bool = False, annotation_fontsize: int = 8) Tuple[matplotlib.figure.Figure, matplotlib.axes.Axes][source]

Create atom-atom distance matrix heatmap.

Parameters:
  • result (AnalysisResult) – Result from atom_distances analysis.

  • colorscheme (str, default="viridis") – Color scale name.

  • annotate (bool, default=False) – Whether to annotate cells with distance values.

  • ax (Axes, optional) – Existing axes to plot on.

Returns:

Matplotlib figure and axes objects.

Return type:

tuple of (Figure, Axes)

class prolint.plotting.heatmap.DatabaseContactsHeatmapPlotter[source]

Bases: prolint.plotting.base.BasePlotter

Heatmap plotter for per-molecule contact timelines.

Shows binary contact states (on/off) for each database molecule across trajectory frames for a single query residue.

See also

DatabaseContactsAnalysis

Generates contact timeline data

name = 'database_contacts_heatmap'[source]
required_analysis = 'database_contacts'[source]
description = 'Per-residue database contact timeline heatmap'[source]
classmethod validate_result(result: prolint.analysis.base.AnalysisResult) None[source]

Validate that result contains database contacts data.

classmethod plot(result: prolint.analysis.base.AnalysisResult, colorscheme: str = 'blues', figsize: Tuple[float, float] | None = None, show_colorbar: bool = True, xlabel: str = 'Frame', ylabel: str = 'Database Molecule ID', title: str = '', ax: matplotlib.axes.Axes | None = None, cbar_label: str = 'Contact', max_display_rows: int = 50, max_display_cols: int = 500) Tuple[matplotlib.figure.Figure, matplotlib.axes.Axes][source]

Create binary contact timeline heatmap.

Parameters:
  • result (AnalysisResult) – Result from database_contacts analysis.

  • colorscheme (str, default="blues") – Color scale name.

  • max_display_rows (int) – Maximum rows/columns before sampling.

  • max_display_cols (int) – Maximum rows/columns before sampling.

  • ax (Axes, optional) – Existing axes to plot on.

Returns:

Matplotlib figure and axes objects.

Return type:

tuple of (Figure, Axes)