Skip to contents
0.16.6 documentation

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

Site guide · find your task

Requires qaccver, saccver, qpos and spos. Positions use the same genomic coordinates as sequence tracks. Curves run from query to subject; an arrow supplied by arrow() therefore points to the subject by default.

Usage

Code
geom_link_line(
  mapping = NULL,
  data = NULL,
  link_type = c("curve", "straight"),
  link_gap = NULL,
  link_ctrl_point = NULL,
  link_avoid = c("none", "smooth", "uniform"),
  link_branch = c("none", "query", "subject"),
  link_branch_fraction = 0.15,
  arrow = NULL,
  colour = "#59636D",
  alpha = 0.6,
  linewidth = 0.4,
  linetype = 1,
  position = "identity",
  show.legend = NA,
  inherit.aes = FALSE,
  ...
)

Arguments

mapping, data

Standard ggplot2 mapping and layer data, including data functions.

Either "curve" (default) or "straight".

Explicit endpoint spacing. With the default link_avoid = "none", NULL uses a fixed spacing of 0.035. Set link_avoid to "smooth" or "uniform" to opt in to entity-aware endpoint spacing.

Bezier control points: two numbers, four numbers, or a list per input row.

One of "none" (default), "smooth", or "uniform". Explicit gap takes precedence.

Share equal query or subject endpoints: "none", "query", "subject".

Shared length relative to the shortest member, in (0, 0.5].

arrow

A grid arrow specification, or NULL.

colour, alpha, linewidth, linetype

Fixed styles; mappings use link_* aesthetics. An explicitly supplied fixed value takes precedence over the matching mapping. Omit the fixed argument to retain a mapped style, including an inherited mapping when inherit.aes = TRUE.

position, show.legend, inherit.aes

Standard ggplot2 layer arguments.

...

Additional path parameters.

Value

A ggplot2 layer.

Examples

Code
library(dplyr)
data(seq_data_example)
seqs <- seq_data_example |>
  select(accver, length)
data(ribbon_data_example)
links <- ribbon_data_example |>
  select(qaccver, saccver, qstart, qend, sstart, send, pident, length)
points <- links |>
  transmute(qaccver, saccver,
    qpos = floor((qstart + qend) / 2),
    spos = floor((sstart + send) / 2)
  )
ggchord(seq_data = seqs) +
  geom_seq() +
  geom_link_line(data = points)