Generates a barplot with frequency vs read abundance.

amp_frequency(
  data,
  group_by = "Sample",
  tax_class = NULL,
  tax_empty = "best",
  tax_aggregate = "OTU",
  weight = TRUE,
  normalise = TRUE,
  detailed_output = FALSE
)

Arguments

data

(required) Data list as loaded with amp_load.

group_by

Group the samples by a variable in the metadata. (default: "Sample")

tax_class

Converts a specific phylum to class level instead, e.g. "p__Proteobacteria".

tax_empty

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.

tax_aggregate

The taxonomic level to aggregate the OTUs. (default: "OTU")

weight

(logical) Weight the frequency by abundance. (default: TRUE)

normalise

(logical) Transform 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. If detailed_output = TRUE a list with a ggplot2 object and additional data.

Preserving relative abundances in a subset of larger data

See ?amp_filter_samples or the ampvis2 FAQ.

References

Saunders, Aaron M; Albertsen, Mads; Vollertsen, Jes; Nielsen, Per H (2016): The activated sludge ecosystem contains a core community of abundant organisms, ISME Journal 10, 11-20. doi:10.1038/ismej.2015.117

Author

Kasper Skytte Andersen ksa@bio.aau.dk

Mads Albertsen MadsAlbertsen85@gmail.com

Examples

# Load example data
data("AalborgWWTPs")

# Frequency plot
amp_frequency(AalborgWWTPs)