Heatmap of PTM counts or proportions for length-filtered peptides
Source:R/plots.R
plot_ptm_heatmap.RdCleans PTM annotation strings, splits multi-PTM entries (;/, delimited),
and renders a ggplot2::geom_tile() heatmap of PTM counts or proportions
per Condition. All data preparation is handled internally — only pep_short
(the length-filtered peptide table) is needed.
Usage
plot_ptm_heatmap(
pep_short,
type = c("count", "proportion"),
shortpep_range = c(8, 13),
translate = TRUE,
reference = ptm_reference()
)Arguments
- pep_short
Length-filtered
pep_all-shaped data frame (e.g. thepep_shortobject created in the report'sinitializechunk).- type
"count"(default) for absolute peptide counts per PTM, or"proportion"for the percentage of PTM-modified vs total peptides.- shortpep_range
Length-2 numeric vector
c(min, max)— used only for the"proportion"subtitle (the denominator is computed directly frompep_short).- translate
Translate the PTM tokens to readable modification names via
translate_ptm()(defaultTRUE). The raw tokens are engine-specific — UniMod accessions for DIA-NN, delta masses for FragPipe and PEAKS — so without this the same modification reads differently per engine. SetFALSEto plot the tokens as the search engine wrote them.- reference
Modification lookup table passed to
translate_ptm(); defaults toptm_reference(). Ignored whentranslate = FALSE.
Examples
if (FALSE) { # \dontrun{
plot_ptm_heatmap(pep_short, type = "count")
plot_ptm_heatmap(pep_short, type = "proportion", shortpep_range = c(8, 13))
plot_ptm_heatmap(pep_short, translate = FALSE) # raw engine tokens
} # }