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 changes
Draw restriction sites, labels and deterministic leaders
Source:R/restriction-sites.R
geom_restriction_site.RdDraw restriction sites, labels and deterministic leaders
Usage
Code
geom_restriction_site(
mapping = NULL,
data = NULL,
label = TRUE,
label_style = c("enzyme_position", "enzyme", "position"),
label_order = c("auto", "enzyme_position", "position_enzyme"),
label_side = c("outside", "inside", "auto"),
leader = c("radial", "elbow", "straight"),
min_label_gap = NULL,
tick_length = 0.04,
label_offset = 0.18,
colour = "#202020",
linewidth = 0.28,
label_size = 3.2,
fontface = NULL,
family = NULL,
position = "identity",
show.legend = FALSE,
inherit.aes = FALSE,
...
)Arguments
- mapping, data
Standard layer inputs.
- label
Draw labels.
- label_style
Label enzyme and position, enzyme only, or position only.
- label_order
Automatic mirrored label order, enzyme first, or position first.
- label_side
Draw labels outside, inside, or automatically.
- leader
Leader routing style. The default
"radial"measures actual text boxes, separates site anchors from final radial label positions, and routes either a direct connector or an independent radial stub plus fan segment. All enzyme-facing text edges follow one close circular contour in genomic order. Dense lateral clusters use evenly spaced contour fans, while sparse clusters retain their natural angular positions. The former"trunk"alias was removed in v0.16.1; use"radial"."straight"connects the tick tip directly to the final label edge, without detours around the sequence or other leaders."elbow"uses one bend, starting with a local-normal departure where possible. Label positions and grouping are shared by all routing styles.- min_label_gap
Minimum genomic fraction between label slots.
NULLderives a compact device-aware default from the rendered labels.- tick_length, label_offset
Local-normal distances.
- colour, linewidth, label_size, fontface, family
Fixed appearance. With the default
fontface = NULL, enzyme names are bold only when that enzyme cuts once in the supplied sequence; coordinates remain regular. An explicitfontfacedisables this automatic distinction.- position, show.legend, inherit.aes
Standard layer arguments.
- ...
Additional geom parameters.