Skip to contents
0.16.6 documentation

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

Site guide · find your task

Draw 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. NULL derives 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 explicit fontface disables this automatic distinction.

position, show.legend, inherit.aes

Standard layer arguments.

...

Additional geom parameters.

Value

A ggplot2 layer.