prolint.plotting.heatmap ======================== .. py:module:: prolint.plotting.heatmap .. autoapi-nested-parse:: Heatmap plotters for contact visualization. This module provides heatmap-style visualizations for contact matrices, distance matrices, and database contact patterns. Classes ------- .. autoapisummary:: prolint.plotting.heatmap.HeatmapPlotter prolint.plotting.heatmap.DistanceHeatmapPlotter prolint.plotting.heatmap.DatabaseContactsHeatmapPlotter Module Contents --------------- .. py:class:: HeatmapPlotter Bases: :py:obj:`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). .. seealso:: :py:obj:`TimeSeriesAnalysis` Generates timeseries data :py:obj:`SharedContactsAnalysis` Generates correlation matrices .. py:attribute:: name :value: 'heatmap' .. py:attribute:: required_analysis :value: 'timeseries' .. py:attribute:: description :value: '2D heatmap for contact counts or correlation matrices' .. py:method:: validate_result(result: prolint.analysis.base.AnalysisResult) -> None :classmethod: Validate that the AnalysisResult contains required data keys. :param result: Result to validate. :type result: AnalysisResult :raises ValueError: If result is missing required keys for this plotter. .. py:method:: plot(result: prolint.analysis.base.AnalysisResult, colorscheme: str = 'viridis', figsize: Optional[Tuple[float, float]] = None, show_row_labels: bool = True, show_col_labels: bool = True, show_colorbar: bool = True, xlabel: str = '', ylabel: str = '', title: str = '', vmin: Optional[float] = None, vmax: Optional[float] = None, aspect: str = 'auto', ax: Optional[matplotlib.axes.Axes] = None, cbar_label: str = '', max_display_rows: int = 40, max_display_cols: int = 200, origin: str = 'upper') -> Tuple[matplotlib.figure.Figure, matplotlib.axes.Axes] :classmethod: Create a 2D heatmap visualization. :param result: Result from timeseries or shared_contacts analysis. :type result: AnalysisResult :param colorscheme: Color scale name. :type colorscheme: str, default="viridis" :param figsize: Figure size (width, height). Auto-calculated if None. :type figsize: tuple of float, optional :param vmin: Color scale limits. :type vmin: float, optional :param vmax: Color scale limits. :type vmax: float, optional :param ax: Existing axes to plot on. :type ax: Axes, optional :param max_display_rows: Maximum rows/columns before sampling. :type max_display_rows: int :param max_display_cols: Maximum rows/columns before sampling. :type max_display_cols: int :returns: Matplotlib figure and axes objects. :rtype: tuple of (Figure, Axes) .. py:class:: DistanceHeatmapPlotter Bases: :py:obj:`prolint.plotting.base.BasePlotter` Heatmap plotter for atom-atom distance matrices. Visualizes pairwise distances between atoms of two residues at a specific frame. .. seealso:: :py:obj:`AtomDistancesAnalysis` Generates distance matrix data .. py:attribute:: name :value: 'distance_heatmap' .. py:attribute:: required_analysis :value: 'atom_distances' .. py:attribute:: description :value: 'Atom-atom distance matrix heatmap' .. py:method:: validate_result(result: prolint.analysis.base.AnalysisResult) -> None :classmethod: Validate that result contains distance matrix data. .. py:method:: plot(result: prolint.analysis.base.AnalysisResult, colorscheme: str = 'viridis', figsize: Optional[Tuple[float, float]] = None, show_colorbar: bool = True, xlabel: str = 'Database Atoms', ylabel: str = 'Query Atoms', title: str = '', vmin: Optional[float] = None, vmax: Optional[float] = None, ax: Optional[matplotlib.axes.Axes] = None, cbar_label: str = 'Distance (Å)', annotate: bool = False, annotation_fontsize: int = 8) -> Tuple[matplotlib.figure.Figure, matplotlib.axes.Axes] :classmethod: Create atom-atom distance matrix heatmap. :param result: Result from atom_distances analysis. :type result: AnalysisResult :param colorscheme: Color scale name. :type colorscheme: str, default="viridis" :param annotate: Whether to annotate cells with distance values. :type annotate: bool, default=False :param ax: Existing axes to plot on. :type ax: Axes, optional :returns: Matplotlib figure and axes objects. :rtype: tuple of (Figure, Axes) .. py:class:: DatabaseContactsHeatmapPlotter Bases: :py:obj:`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. .. seealso:: :py:obj:`DatabaseContactsAnalysis` Generates contact timeline data .. py:attribute:: name :value: 'database_contacts_heatmap' .. py:attribute:: required_analysis :value: 'database_contacts' .. py:attribute:: description :value: 'Per-residue database contact timeline heatmap' .. py:method:: validate_result(result: prolint.analysis.base.AnalysisResult) -> None :classmethod: Validate that result contains database contacts data. .. py:method:: plot(result: prolint.analysis.base.AnalysisResult, colorscheme: str = 'blues', figsize: Optional[Tuple[float, float]] = None, show_colorbar: bool = True, xlabel: str = 'Frame', ylabel: str = 'Database Molecule ID', title: str = '', ax: Optional[matplotlib.axes.Axes] = None, cbar_label: str = 'Contact', max_display_rows: int = 50, max_display_cols: int = 500) -> Tuple[matplotlib.figure.Figure, matplotlib.axes.Axes] :classmethod: Create binary contact timeline heatmap. :param result: Result from database_contacts analysis. :type result: AnalysisResult :param colorscheme: Color scale name. :type colorscheme: str, default="blues" :param max_display_rows: Maximum rows/columns before sampling. :type max_display_rows: int :param max_display_cols: Maximum rows/columns before sampling. :type max_display_cols: int :param ax: Existing axes to plot on. :type ax: Axes, optional :returns: Matplotlib figure and axes objects. :rtype: tuple of (Figure, Axes)