Skip to contents

Replaces the inline ggbarplot body in the "Average +/- sd" loop of the main report template. Filters out the "others" length range (only plots the "All peptides" and the expected-length rows), then renders a faceted barplot showing mean ± SD across BioReplicates per Condition.

Usage

plot_count_mean_sd(df, level, lim_level, group_var = "Condition")

Arguments

df

A counts data frame shaped like counts_size (one row per BioReplicate × Condition × Length_range, with n_Peptides, n_Sequences, n_Proteins columns).

level

One of "Peptides", "Sequences", "Proteins".

lim_level

Upper y-axis limit (e.g. looked up from a count_lim table by Level/"Limit_mean").

group_var

Name of the column mapped to the x-axis (and fill), across which the mean ± SD is computed. Default "Condition" (mean across the replicate samples per Condition); pass "BioReplicate" for a per- BioReplicate variant (mean across the TechReplicate samples per BioReplicate).

Value

A ggpubr barplot with mean ± SD error bars and viridis fill.

Examples

if (FALSE) { # \dontrun{
plot_count_mean_sd(counts_size, "Peptides", lim_level = 30000)
plot_count_mean_sd(counts_size, "Peptides", 30000, group_var = "BioReplicate")
} # }