alphagenome.visualization.plot_components.AbstractAnnotation#
- class alphagenome.visualization.plot_components.AbstractAnnotation(annotations, colors, labels, use_default_labels)[source]#
Abstract base class for plot annotations.
Annotations are visual elements that can be added to plots to highlight specific features or regions. This class defines the common interface for all annotations.
- annotations#
A sequence of
Variant
orInterval
objects representing the annotations.
- colors#
An optional string or sequence of strings specifying the colors of the annotations.
- labels#
An optional sequence of strings to use as labels for the annotations.
- use_default_labels#
Whether to use default labels for the annotations if
labels
is not provided.
Attributes#
Table
Returns True if the annotation has labels. |
|
Returns True if the annotation is a variant annotation. |
- AbstractAnnotation.has_labels#
Returns True if the annotation has labels.
- AbstractAnnotation.is_variant#
Returns True if the annotation is a variant annotation.
Methods#
Table
|
Adds a single angled label to an axis. |
|
Adds the annotation to an individual axis. |
|
Adds labels for the annotation to an axis. |
- AbstractAnnotation.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.
- abstract AbstractAnnotation.plot_ax(ax, interval, hspace)[source]#
Adds the annotation to an individual axis.