enhancer_arcs_plot

enhancer_arcs_plot#

alphagenome.visualization.plot.enhancer_arcs_plot(links, ax=None, tss=None, *, interval=None, interval_contained=True, gene_id=None, start_col='start', end_col='end', peak_col=None, tss_col='tss', score_col='gradient_score', color='#810f7c', cmap=None, vmin=None, vmax=None, alpha_range=(0.35, 0.9), linewidth_range=(1.0, 2.6), upward=True)[source]#

Plots enhancer-to-gene links as cubic Bezier arcs on ax.

Parameters:
  • links (DataFrame) – DataFrame of enhancer-to-gene links.

  • ax (Axes | None (default: None)) – Matplotlib axis to draw on (defaults to plt.gca()).

  • tss (int | None (default: None)) – Target gene TSS coordinate; if None, uses tss_col from links.

  • interval (Interval | None (default: None)) – Optional genomic interval filter and horizontal span reference.

  • interval_contained (bool (default: True)) – If True, only plot arcs whose endpoints both lie within interval; if False, plot any arc whose enhancer-to-TSS span overlaps interval. Ignored when interval is None.

  • gene_id (str | None (default: None)) – Optional target gene ID filter (ignoring Ensembl version suffix).

  • start_col (str (default: 'start')) – Column name for enhancer start coordinate.

  • end_col (str (default: 'end')) – Column name for enhancer end coordinate.

  • peak_col (str | None (default: None)) – Optional summit column name; if None, uses 0.5 * (start + end).

  • tss_col (str (default: 'tss')) – Column name for target gene TSS when tss is None.

  • score_col (str | None (default: 'gradient_score')) – Column used to scale arc opacity, width, and colormap shading.

  • color (str | tuple[float, float, float] | tuple[float, float, float, float] (default: '#810f7c')) – Default arc color when cmap is None.

  • cmap (str | Colormap | None (default: None)) – Optional colormap for shading arcs by score.

  • vmin (float | None (default: None)) – Optional minimum score for normalization.

  • vmax (float | None (default: None)) – Optional maximum score for normalization.

  • alpha_range (tuple[float, float] (default: (0.35, 0.9))) – Minimum and maximum alpha transparency for arcs.

  • linewidth_range (tuple[float, float] (default: (1.0, 2.6))) – Minimum and maximum line width for arcs.

  • upward (bool (default: True)) – If True, arcs curve upward; otherwise downward.

Raises:
  • ValueError – If tss is None and tss_col is not in links.

  • KeyError – If required coordinate, gene, peak, or score columns are missing from links.

Return type:

None