Skip to contents
0.16.6 documentation

Complete canonical API text; task articles explain the workflows. Tutorials

Site guide · find your task

Maps positions for ordinary ggplot2 annotation layers without modifying source tables. Inverse mapping returns the chosen relative or source bp. In a segmented layout, specify the window accession rather than its parent source accession. Positions outside that window, including display gaps, produce an error instead of being extrapolated into omitted sequence.

Usage

Code
map_ggchord_position(plot, accver, position, inverse = FALSE, source = FALSE)

Arguments

plot

A ggchord plot using coord_collinear().

accver

Sequence identifiers, scalar or one per position.

position

Numeric genomic positions, or layout x when inverse = TRUE.

inverse

Convert layout x back to bp.

source

Use original source coordinates after focusing.

Value

A data frame with accver, position, x and backbone y.

Examples

Code
library(dplyr)
data(seq_data_example)
seqs <- seq_data_example |>
  select(accver, length)
p <- ggchord(seq_data = seqs) +
  geom_seq() +
  coord_collinear()
map_ggchord_position(p, seqs$accver[1], position = 100)