Complete canonical API text; task articles explain the workflows. Tutorials
Site guide · find your task
Setup and learning paths
HomeInstall and prepare the environmentChoose your learning moduleModule I · Chord
1.1 Tables and field meanings1.2 Produce and import comparisons1.3 Build the layers step by step1.4 Direction, curvature and clearance1.5 Filter and summarize links1.6 Full source-file workflow1.7 Complete chord showcaseModule II · Collinear
2.1 Reuse chord input tables2.2 Switch coordinates and add layers2.3 Routes, clearance and the ruler2.4 Compare CDS neighbourhoods2.5 Focus, anchors and segments2.6 Complete collinear showcaseModule III · Plasmid
3.1 DNA, annotations and 13 references3.2 From a circle to annotation layers3.3 Features, primers and restriction3.4 Thirteen plasmid references3.5 Complete plasmid casesConsult as needed · Data and layers
Prepare tables and coordinatesImport and convert dataImport nucleotide and protein alignmentsProject protein intervals to genomic coordinatesFeatures, stacking and genomic decorationLabels and local placementQuantitative tracksMappings, scales, guides and themesSet values by sequence and strandCommon adjustments and grammarExport, preview and diagnosticsLearning map and reference
Articles and complete workflowsFunction referenceReproducible galleryFrequently asked questionsMigrate to the candidate APITerminology and design sourcesDevelopment status and changesRequires 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.
- link_type
Either "curve" (default) or "straight".
- link_gap
Explicit endpoint spacing. With the default
link_avoid = "none",NULLuses a fixed spacing of 0.035. Setlink_avoidto"smooth"or"uniform"to opt in to entity-aware endpoint spacing.- link_ctrl_point
Bezier control points: two numbers, four numbers, or a list per input row.
- link_avoid
One of "none" (default), "smooth", or "uniform". Explicit gap takes precedence.
- link_branch
Share equal query or subject endpoints: "none", "query", "subject".
- link_branch_fraction
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.
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)