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 changesDraws the gene annotation labels on a chord diagram. This layer is
independent from geom_gene(): add it after geom_gene()
to annotate the gene arrows with their texts.
Usage
Code
geom_gene_label(
mapping = NULL,
data = NULL,
label_orientation = "horizontal",
label_side = "outside",
label_overlap = "hide",
label_rotation = NULL,
label_radial_offset = 0.04,
label_circum_offset = NULL,
label_circum_limit = NULL,
label_wrap = NULL,
position = "identity",
show.legend = FALSE,
inherit.aes = FALSE,
...
)Arguments
- mapping
Default NULL (uses pre-computed data)
- data
Default NULL (retrieved automatically from the layout)
- label_orientation
Character, default
"horizontal". Text orientation relative to each sequence path:"radial","tangent", or"horizontal".- label_side
Character, default
"outside". Place labels outside the chord, use the strand-based"auto"side, or force"inside"placement.- label_overlap
Character, default
"hide". Fixed-label collision policy: omit later conflicting labels ("hide"), apply the legacy gentle adjustment ("nudge"), or keep all requested positions ("allow"). Input row order therefore provides a simple way to prioritize labels in"hide"mode.- label_rotation
Optional numeric/vector/list. Label rotation angle, default 0
- label_radial_offset
Optional numeric/vector/list. Radial offset of labels, default 0.04
- label_circum_offset
Optional numeric/vector/list. Circumferential offset of labels, default 0
- label_circum_limit
Optional logical/vector/list. Whether to limit circumferential offset, default TRUE
- label_wrap
Numeric or NULL, default NULL. When set, long gene annotations are wrapped at this many characters (e.g. 15), which makes the labels narrower and less prone to overlap.
- position
Position adjustment. Supply the same
position_feature_stack()used by a gene/feature layer when labels are drawn from separate data or without a geometry layer. Incoord_collinear(), labels without an explicit Position share a matching geometry layer's lanes; explicit label Positions do not move the geometry layer. Uniquefeature_idcolumns allow label subsets and reordered labels when their accession, interval and strand agree with the geometry input. Multiple matching geometry layers require an explicit label Position or unambiguous feature IDs.- show.legend, inherit.aes
Standard ggplot2 layer arguments.
- ...
Additional arguments passed to
geom_text()
Value
A ggplot2 layer. To let the labels avoid each other and the
genes (with leader lines), use geom_gene_label_repel()
instead.
Details
This is the deterministic, fixed-position label layer. By default labels
sit outside their sequence and labels that would collide are omitted in
input-row order. Use label_overlap = "nudge" to retain the
legacy gentle adjustment, or "allow" to draw every label at its
requested position. For automatic arrangement with leader lines, use
geom_gene_label_repel() instead.
