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
)

Arguments

data

(required) Data list as loaded with amp_load.

group_by

Group the data based on a sample metadata variable. amp_venn currently only supports a maximum of 3 different groups.

cut_a

Abundance cutoff in percent. OTU's below this abundance are excluded from the analysis. (default: 0.1)

cut_f

Frequency cutoff in percent. OTU's within the top cut_f of the reads are considered a "core" OTU. (default: 80)

text_size

Size of the plotted text. (default: 5)

normalise

(logical) Normalise the OTU read counts to be in percent per sample. (default: TRUE)

detailed_output

(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)

Value

A ggplot2 object.

Preserving relative abundances in a subset of larger data

See ?amp_filter_samples or the ampvis2 FAQ.

References

[Saunders et al, 2016](https://www.nature.com/articles/ismej2015117)

See also

Author

Kasper Skytte Andersen ksa@bio.aau.dk

Mads Albertsen MadsAlbertsen85@gmail.com

Examples

# Load example data
data("AalborgWWTPs")

# Venn diagram grouped by WWTP
amp_venn(AalborgWWTPs, group_by = "Plant")