Chapters and reference
Complete canonical API text; task articles explain the workflows. Usage guide

Colour residue cells by chemical group
Source:R/scale-residue.R
scale_fill_residue.RdA standard discrete fill scale for geom_residue(). DNA/RNA use separate
colours for A, C, G and T/U; AA groups residues by side-chain chemistry.
Gaps, stops and ambiguous symbols are neutral. Lowercase symbols receive
the same colours as uppercase symbols. The chemistry colours follow ggmsa;
this scale does not compute conservation or an alignment.
Usage
R · Example code
scale_fill_residue(alphabet = c("DNA", "RNA", "AA"), ...)Arguments
- alphabet
Explicit DNA, RNA or AA palette. Defaults to DNA for direct calls. geom_residue() uses the data's alphabet column, otherwise AA.
- ...
Additional arguments to
ggplot2::scale_fill_manual(), including name, breaks and guide. Use scale_fill_manual() for custom colours.
Value
A ggplot2 discrete fill scale. Explicit user scales take priority over a residue layer's inferred default.
Examples
R · Example code
cells <- as_ggchord_alignment(c(A = "AC-G", B = "ACTG"), "DNA")
ggplot2::ggplot(cells, aes(alignment_column, accver, label = symbol)) +
geom_residue() +
scale_fill_residue("DNA", guide = "none")