alphagenome.visualization.plot_components.IntervalAnnotation#

class alphagenome.visualization.plot_components.IntervalAnnotation(intervals, colors='darkgray', alpha=0.2, labels=None, use_default_labels=True, label_angle=15)[source]#

Visualizes intervals as rectangles across all plot components.

A rectangle is drawn for each interval and overlaid on top of the final plot, spanning all plot components.

Attributes#

Table

IntervalAnnotation.has_labels#

Returns True if the annotation has labels.

IntervalAnnotation.is_variant#

Returns True if the annotation is a variant annotation.

Methods#

Table

plot_ax(ax, interval[, hspace])

Adds the interval annotation to an individual axis.

plot_labels(ax, interval, label_height_factor)

Adds interval labels to an axis.

IntervalAnnotation.plot_ax(ax, interval, hspace=0.0)[source]#

Adds the interval annotation to an individual axis.

Parameters:
  • ax (Axes) – The matplotlib axis to add the annotation to.

  • interval (Interval) – The genomic interval to plot.

  • hspace (float (default: 0.0)) – The vertical space between subplots.

IntervalAnnotation.plot_labels(ax, interval, label_height_factor)[source]#

Adds interval labels to an axis.

Parameters:
  • ax (Axes) – The matplotlib axis to add the labels to.

  • interval (Interval) – The genomic interval to plot.

  • label_height_factor (float) – A scaling factor for the label height.