Generates boxplots of the most abundant taxa.
amp_boxplot(
data,
group_by = NULL,
sort_by = median,
plot_type = "boxplot",
point_size = 1,
tax_aggregate = "Genus",
tax_add = NULL,
tax_show = 20,
tax_empty = "best",
tax_class = NULL,
order_group = NULL,
order_y = NULL,
plot_flip = FALSE,
plot_log = FALSE,
adjust_zero = NULL,
normalise = TRUE
)
(required) Data list as loaded with amp_load
.
Group the samples by a variable in the metadata.
Generic function name to use for sorting most abundant taxa, fx mean
, median
, or sum
. (default: median
)
Plot type. "boxplot"
or "point"
. (default: "boxplot"
)
The size of points. (default: 1
)
The taxonomic level to aggregate the OTUs. (default: "Genus"
)
Additional taxonomic level(s) to display, e.g. "Phylum"
. (default: "none"
)
The number of taxa to show, or a vector of taxa names. (default: 20
)
How to show OTUs without taxonomic information. One of the following:
"remove"
: Remove OTUs without taxonomic information.
"best"
: (default) Use the best classification possible.
"OTU"
: Display the OTU name.
Converts a specific phylum to class level instead, e.g. "p__Proteobacteria"
.
A vector to order the groups by.
A vector to order the y-axis by.
(logical) Flip the axes of the plot axis. (default: FALSE
)
(logical) Log10-scale the plot. (default: FALSE
)
Keep abundances of 0 in the calculation of medians by adding this value. (default: NULL
)
(logical) Transform the OTU read counts to be in percent per sample. (default: TRUE
)
A ggplot2 object. If detailed_output = TRUE
a list with a ggplot2 object and additional data.
# Load example data
data("AalborgWWTPs")
# 10 boxplots grouped by WWTP with phylum name added
amp_boxplot(AalborgWWTPs,
group_by = "Plant",
tax_show = 10,
tax_add = "Phylum"
)