ContactMaps

Contents

ContactMaps#

class alphagenome.visualization.plot_components.ContactMaps(tdata, track_height=10.0, vmin=-1.0, vmax=2.0, norm=None, ylabel_horizontal=True, ylabel_template='{name}', cmap=None, max_num_tracks=10, **kwargs)[source]#

Component for visualizing contact maps.

The vmin and vmax parameters control the color scaling of the heatmap. Values outside this range will be clipped to vmin or vmax.

Initializes the ContactMaps component.

Parameters:
  • tdata (TrackData) – The TrackData object containing the contact maps.

  • track_height (float (default: 10.0)) – The height of each contact map.

  • vmin (float | None (default: -1.0)) – The minimum value for the color scale.

  • vmax (float | None (default: 2.0)) – The maximum value for the color scale.

  • norm (TwoSlopeNorm | None (default: None)) – An optional normalization for the color scale.

  • ylabel_horizontal (bool (default: True)) – Whether to make the y-axis labels horizontal.

  • ylabel_template (str (default: '{name}')) – A template for the y-axis labels.

  • cmap (LinearSegmentedColormap | None (default: None)) – The colormap to use for the contact maps.

  • max_num_tracks (int (default: 10)) – The maximum number of tracks to plot.

  • **kwargs – Additional keyword arguments to pass to the plotting function.

Raises:

ValueError – If the number of tracks exceeds max_num_tracks, or if the track data does not have 2 positional axes, or if the contact maps are not square, or if the interval is not set in the track data.

Methods

get_ax_height(axis_index)

Returns the height of the axis.

plot_ax(ax, axis_index, interval)

Plots the contact map on the given axis.