Skip to contents

This function adds text annotation to a genome track at a specific position. It is useful for labeling specific genomic features.

Usage

add_text(
  plot,
  x,
  y,
  label,
  color = "black",
  size = 3,
  angle = 0,
  hjust = 0.5,
  vjust = 0.5
)

Arguments

plot

A ggplot2 object representing a genome track

x

X-value (genomic position)

y

Y-value

label

Text label

color

Text color (default: "black")

size

Text size (default: 3)

angle

Text angle (default: 0)

hjust

Horizontal justification (default: 0.5)

vjust

Vertical justification (default: 0.5)

Value

A ggplot2 object with the text annotation added

Examples

if (FALSE) { # \dontrun{
track <- ez_coverage("signal.bw", "chr1:1000000-2000000")
track <- add_text(track, 1500000, 20, "Peak")
} # }