Calculates the number of "core" OTUs shared by groups given thresholds for how frequent the OTUs should be above a certain abundance. Also returns the average abundance of the OTUs in a particular group.
amp_venn(
data,
group_by = NULL,
cut_a = 0.1,
cut_f = 80,
text_size = 5,
normalise = TRUE,
detailed_output = FALSE
)
(required) Data list as loaded with amp_load
.
Group the data based on a sample metadata variable. amp_venn
currently only supports a maximum of 3 different groups.
Abundance cutoff in percent. OTU's below this abundance are excluded from the analysis. (default: 0.1
)
Frequency cutoff in percent. OTU's within the top cut_f
of the reads are considered a "core" OTU. (default: 80
)
Size of the plotted text. (default: 5
)
(logical) Normalise the OTU read counts to be in percent per sample. (default: TRUE
)
(logical) Return additional details or not. If TRUE
, it is recommended to save to an object and then access the additional data by View(object$data)
. (default: FALSE
)
A ggplot2 object.
See ?amp_filter_samples
or the ampvis2 FAQ.
[Saunders et al, 2016](https://www.nature.com/articles/ismej2015117)
# Load example data
data("AalborgWWTPs")
# Venn diagram grouped by WWTP
amp_venn(AalborgWWTPs, group_by = "Plant")