Places an ideogram next to the axis and indicates the data range interpreted as genomic positions on the ideogram. The ideograms need to be setup first with the setup_ideogram() function.

guide_ideogram_axis(
  title = waiver(),
  check.overlap = FALSE,
  angle = NULL,
  n.dodge = 1,
  order = 0,
  position = waiver(),
  chromosome = NULL,
  genome = NULL,
  ideo_size = unit(0.5, "cm"),
  funnel_size = unit(0.5, "cm"),
  funnel_col = "dodgerblue",
  regular_axis = TRUE
)

Arguments

title

A character string or expression indicating a title of guide. If NULL, the title is not shown. By default (waiver()), the name of the scale object or the name specified in labs() is used for the title.

check.overlap

silently remove overlapping labels, (recursively) prioritizing the first, last, and middle labels.

angle

Compared to setting the angle in theme() / element_text(), this also uses some heuristics to automatically pick the hjust and vjust that you probably want.

n.dodge

The number of rows (for vertical axes) or columns (for horizontal axes) that should be used to render the labels. This is useful for displaying labels that would otherwise overlap.

order

Used to determine the order of the guides (left-to-right, top-to-bottom), if more than one guide must be drawn at the same location.

position

Where this guide should be drawn: one of top, bottom, left, or right.

chromosome

A character with chromosome name of length one, for example "chr12".

genome

A character with a genome name of length one, for example "hg38".

ideo_size

A unit of length one indicating the size of the ideogram. If a numeric is provided, this is interpreted as millimetre units. A small proportional margin will be added for an indicator.

funnel_size

A unit of length one indicating the size of the funnel space. If a numeric is provided, this is interpreted as millimetre units. If this can be interpreted as zero, no funnel will be drawn.

funnel_col

A character of length one setting the colour for the funnel and indicator. Set to NA to make the funnel and indicator transparent.

regular_axis

A logical of length one: should the ticks and labels of the usual position axis be drawn? (default: TRUE).

Value

A list with the S3 class guide.

Details

Currently does not support S4Vector or genomic scales (yet).

Methods (by generic)

  • guide_train: Trainer for ideogram axis. See guide-exts.

  • guide_transform: Transformer for ideogram axis. See guide-exts.

  • guide_gengrob: Graphic object generator for ideogram axis. See guide-exts.

See also

The setup_ideograms() function for importing and caching ideogram data.

Other position guides: guide_genomic_axis()

Examples

# Setup ideograms and make a basic plot setup_ideograms(genome = "hg38") p <- ggplot(iris, aes(Sepal.Width * 1e7, Sepal.Length * 1e7)) + geom_point() # As main axis p + guides(x = guide_ideogram_axis("hg38", chromosome = "chr2"))
# As secundary axis p + guides(x.sec = guide_ideogram_axis("hg38", chromosome = "chr2", regular_axis = FALSE))
# Without funnel p + guides(x = guide_ideogram_axis("hg38", chromosome = "chr2", funnel_size = 0))
# Without funnel or indicator p + guides(x = guide_ideogram_axis("hg38", chromosome = "chr2", funnel_size = 0, funnel_col = NA))