amp_otu_network: Network plot

View source: R/amp_otu_network.R

amp_otu_networkR Documentation

Network plot

Description

Generates network plot of taxa and samples based on ggnet2.

Usage

amp_otu_network(
  data,
  min_abundance = 0,
  color_by = NULL,
  tax_aggregate = "Phylum",
  tax_add = NULL,
  tax_show = 10,
  tax_class = NULL,
  tax_empty = "best",
  normalise = TRUE,
  ...
)

Arguments

data

(required) Data list as loaded with amp_load.

min_abundance

Minimum taxa abundance pr. sample. (default: 0)

color_by

A metadata variable to color the samples by.

tax_aggregate

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

tax_add

Additional taxonomic level(s) to display, e.g. "Phylum". (default: "none")

tax_show

The number of taxa to show, or a vector of taxa names. (default: 10)

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.

normalise

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

...

Additional arguments passed on to ggnet2.

Details

See ggnet2

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.

Author(s)

Kasper Skytte Andersen ksa@bio.aau.dk

Mads Albertsen MadsAlbertsen85@gmail.com

See Also

amp_load

Examples

# Load example data
data("AalborgWWTPs")

# OTU network plot
amp_otu_network(AalborgWWTPs)

MadsAlbertsen/ampvis2 documentation built on Jan. 28, 2024, 7:12 a.m.