| guide_glycan | R Documentation |
guide_glycan() is a legend guide that replaces the usual text labels with
glycan cartoons while retaining the legend keys drawn by the plot layers.
Mapped discrete values and values returned by the scale's labels argument
may be glycan structure strings supported by glyparse::auto_parse() or
glyrepr::glycan_structure() vectors.
guide_glycan(
title = ggplot2::waiver(),
theme = NULL,
position = NULL,
direction = NULL,
override.aes = list(),
nrow = NULL,
ncol = NULL,
reverse = FALSE,
order = 0,
size = 0.4,
orient = c("H", "V"),
hjust = 0,
vjust = vjust_red_end(),
show_linkage = TRUE,
red_end = "",
fuc_orient = c("flex", "up"),
edge_linewidth = 0.8,
node_linewidth = 0.8,
node_size = 1,
colors = NULL,
style = NULL
)
title |
A character string or expression indicating a title of guide.
If |
theme |
A |
position |
A character string indicating where the legend should be placed relative to the plot panels. One of "top", "right", "bottom", "left", or "inside". |
direction |
A character string indicating the direction of the guide. One of "horizontal" or "vertical". |
override.aes |
A list specifying aesthetic parameters of legend key. See details and examples. |
nrow, ncol |
The desired number of rows and column of legends respectively. |
reverse |
logical. If |
order |
positive integer less than 99 that specifies the order of this guide among multiple guides. This controls the order in which multiple guides are displayed, not the contents of the guide itself. If 0 (default), the order is determined by a secret algorithm. |
size |
Positive scalar that uniformly scales each legend-label cartoon.
Defaults to |
orient |
Glycan drawing orientation, either |
hjust |
Horizontal cartoon justification between |
vjust |
Vertical cartoon justification between |
show_linkage |
Whether to show glycosidic linkage annotations inside
the cartoons. Defaults to |
red_end |
Reducing-end annotation passed to |
fuc_orient |
Fuc-like triangle orientation passed to |
edge_linewidth |
Linkage linewidth passed to |
node_linewidth |
Node-border linewidth passed to |
node_size |
Node-size multiplier passed to |
colors |
Optional named character vector of monosaccharide fill colors
passed to |
style |
A |
A ggplot2 legend guide that draws glycan cartoons in place of text labels.
glycans <- data.frame(
structure = c(
"Gal(b1-3)GalNAc(a1-",
"Man(a1-3)[Man(a1-6)]Man(b1-4)GlcNAc(b1-"
),
abundance = c(12, 8)
)
ggplot2::ggplot(
glycans,
ggplot2::aes(
x = .data$structure,
y = .data$abundance,
fill = .data$structure
)
) +
ggplot2::geom_col() +
ggplot2::scale_fill_discrete(guide = guide_glycan())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.