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
|
Adds a single angled label to an axis. |
|
Adds the interval annotation to an individual axis. |
|
Adds interval labels to an axis. |
- IntervalAnnotation.add_label(ax, label_x_position, label, angle, label_height_factor, label_position='left')[source]#
Adds a single angled label to an axis.
- Parameters:
ax (
Axes
) – The matplotlib axis to add the label to.label_x_position (
float
) – The x position of the label.label (
str
) – The label text.angle (
float
) – The angle of the label.label_height_factor (
float
) – A scaling factor for the label height.label_position (
str
(default:'left'
)) – The (horizontal) placement of the label, relative to the x position. Can be any position string accepted by the horizontalalignment argument of matplotlib.axes.Axes.text.