lib5c.plotters.extendable.bed_extendable_heatmap module¶
Module for the BedExtendableHeatmap class, which adds bed track plotting functionality for the extendable heatmap system.
-
class
lib5c.plotters.extendable.bed_extendable_heatmap.
BedExtendableHeatmap
(array, grange_x, grange_y=None, colorscale=None, colormap='obs', norm=None)[source]¶ Bases:
lib5c.plotters.extendable.base_extendable_heatmap.BaseExtendableHeatmap
ExtendableHeatmap mixin class providing bed track plotting functionality.
-
add_bed_track
(bed_tracks, loc='bottom', size='3%', pad=0.0, name='bed', axis_limits=(0, 1), intron_height=0.05, colors=None, track_label=None)[source]¶ Adds one bed track along either the x- or y-axis of the heatmap.
- Parameters
bed_tracks (list of dict) –
Each dict should represent a bed feature and could have the following keys:
{ 'chrom' : str, 'start' : int, 'end' : int, 'strand': '+' or '-' }
The ‘strand’ key is optional and is only used for color-coding bed features when
colors
is passed.loc ({'top', 'bottom', 'left', 'right'}) – Which side of the heatmap to add the new bed track to.
size (str) – The size of the new axis as a percentage of the main heatmap width. Should be passed as a string ending in ‘%’.
pad (float) – The padding to use between the existing parts of the figure and the newly added axis.
name (str) – Base name for the new axis. This name will be prefixed with the orientation of the track (‘vertical’ or ‘horizontal’).
axis_limits (tuple of float) – Axis limits for the non-genomic axis of the bed track.
intron_height (float) – The height to draw each bed feature with.
colors (dict, optional) – Map from the value of the ‘strand’ key in the
bed_tracks
dicts (usually ‘+’ or ‘-‘) to color name for bed features with that strand value (i.e., orientation). If not provided for a given strand or if the bed feature doesn’t have a ‘strand’ key the color is black by default.track_label (str, optional) – Pass a string to label the track.
- Returns
The newly added bed track axis.
- Return type
pyplot axis
-
add_bed_tracks
(bed_tracks, size='3%', pad=0.0, axis_limits=(0, 1), intron_height=0.05, name=None, colors=None, track_label=None)[source]¶ Adds bed tracks for a single set of bed features to both the bottom and left side of the heatmap by calling
add_bed_track()
twice.- Parameters
bed_tracks (list of dict) –
Each dict should represent a bed feature and could have the following keys:
{ 'chrom' : str, 'start' : int, 'end' : int, 'strand': '+' or '-' }
The ‘strand’ key is optional and is only used for color-coding bed features when
colors
is passed.size (str) – The size of the new axis as a percentage of the main heatmap width. Should be passed as a string ending in ‘%’.
pad (float) – The padding to use between the existing parts of the figure and the newly added axis.
axis_limits (tuple of float) – Axis limits for the non-genomic axis of the bed track.
intron_height (float) – The height to draw each bed feature with.
name (str) – Base name for the new axis. This name will be prefixed with the orientation of the track (‘vertical’ or ‘horizontal’).
colors (dict, optional) – Map from the value of the ‘strand’ key in the
bed_tracks
dicts (usually ‘+’ or ‘-‘) to color name for bed features with that strand value (i.e., orientation). If not provided for a given strand or if the bed feature doesn’t have a ‘strand’ key the color is black by default.track_label (str, optional) – Pass a string to label the track.
- Returns
The newly added bed track axes.
- Return type
list of pyplot axes
-