TranscriptAnnotation

TranscriptAnnotation#

class alphagenome.visualization.plot_components.TranscriptAnnotation(transcripts, adaptive_fig_height=True, fig_height=1.0, transcript_style=TranscriptStyle(cds_height=0.4, utr_height=0.22, cds_color='black', utr5_color='black', utr3_color='black', first_noncoding_exon_color='black', label_color='black', xlim_pad=0.05), plot_labels_once=True, label_name='gene_name', **kwargs)[source]#

Visualizes transcript annotations.

Initializes the TranscriptAnnotation component.

Parameters:
  • transcripts (Sequence[Transcript]) – A sequence of Transcript objects to visualize.

  • adaptive_fig_height (bool (default: True)) – Whether to adjust the figure height based on the number of transcripts.

  • fig_height (float (default: 1.0)) – The base figure height.

  • transcript_style (TranscriptStyle (default: TranscriptStyle(cds_height=0.4, utr_height=0.22, cds_color='black', utr5_color='black', utr3_color='black', first_noncoding_exon_color='black', label_color='black', xlim_pad=0.05))) – The style to use for plotting transcripts. The options are defined in plot_transcripts.TranscriptStylePreset.

  • plot_labels_once (bool (default: True)) – Whether to plot labels only once per transcript.

  • label_name (str (default: 'gene_name')) – The attribute of the transcript to use for labels.

  • **kwargs – Additional keyword arguments to pass to the plotting function.

Methods

get_ax_height(axis_index)

Returns the height of the axis.

plot_ax(ax, axis_index, interval)

Plots the transcript annotations on the given axis.