Faceted histogram of peptide lengths across conditions, with bars coloured by
whether each length falls within shortpep_range ("X to Y AAs") or outside
("others"). Replaces the plot_peplength_dens() + lapply + ggarrange
approach in the report with a single facet_wrap call.
Arguments
- input
A
pep_all-shaped data frame withLengthandConditioncolumns. Typicallypep_all_unique(one row per peptide–condition pair).- shortpep_range
Length-2 integer vector giving the inclusive range
[min, max]that defines the "in-range" fill category. Defaultc(8, 13).- type
One of
"density"(y-axis = relative frequency) or"count"(y-axis = raw count). Matched viamatch.arg().- palette
Named character vector of length 2 mapping the range label (
"X to Y AAs") and"others"to colours. WhenNULL, falls back toggplot2::scale_fill_viridis_d().- xlimits
Length-2 numeric vector for the x-axis limits. Default
c(5, 25).