A 'ggplot2' geom to add text labels to transcription terminators
Source:R/geom_terminator_label.R
geom_terminator_label.Rdgeom_terminator_label() adds text labels to terminators drawn with
geom_terminator().
Arguments
- mapping, data, stat, position, na.rm, show.legend, inherit.aes, ...
As standard for ggplot2. inherit.aes is set to FALSE by default, as terminators are not likely to share any plot aesthetics other than y.
- terminator_height
grid::unit()object giving the offset from the molecule line to the inner edge of the label's bounding box. Can be set as a negative value to position labels on the opposite side of the molecule line. Defaults to 4 mm, which provides a 1 mm gap between terminator and label when used with the defaultterminator_heightofgeom_terminator()(3 mm).- label_height
grid::unit()object giving the height of the label text. Defaults to 3 mm.
Aesthetics
x (required; position of the terminator)
y (required; molecule)
label (required; the label text)
colour
size
alpha
family
fontface
angle
Examples
ggplot2::ggplot(example_genes, ggplot2::aes(xmin = start, xmax = end,
y = molecule, fill = gene)) +
geom_gene_arrow() +
geom_terminator(data = example_terminators,
ggplot2::aes(x = position, y = molecule)) +
geom_terminator_label(data = example_terminators,
ggplot2::aes(x = position, y = molecule, label = name)) +
ggplot2::facet_wrap(~ molecule, scales = "free")