alphagenome.visualization.plot_components.VariantAnnotation#

class alphagenome.visualization.plot_components.VariantAnnotation(variants, colors='orange', alpha=0.8, labels=None, use_default_labels=True, label_angle=15, label_position='left')[source]#

Visualizes variants as thin line-like rectangles across plot components.

Attributes#

Table

VariantAnnotation.has_labels#

Returns True if the annotation has labels.

VariantAnnotation.is_variant#

Returns True if the annotation is a variant annotation.

Methods#

Table

plot_ax(ax, interval[, hspace])

Adds a variant annotation to an individual axis.

plot_labels(ax, interval, label_height_factor)

Adds variant labels to an axis.

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

Adds a variant 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.

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

Adds variant 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.