sankey_pq: Sankey plot of 'phyloseq-class' object

View source: R/plot_functions.R

sankey_pqR Documentation

Sankey plot of phyloseq-class object

Description

lifecycle-maturing

Graphical representation of distribution of taxa across Taxonomy and (optionnaly a factor).

Usage

sankey_pq(
  physeq = NULL,
  fact = NULL,
  taxa = 1:4,
  add_nb_seq = FALSE,
  min_prop_tax = 0,
  tax2remove = NULL,
  units = NULL,
  symbol2sub = c("\\.", "-"),
  ...
)

Arguments

physeq

(required): a phyloseq-class object obtained using the phyloseq package.

fact

Name of the factor to cluster samples by modalities. Need to be in physeq@sam_data.

taxa

a vector of taxonomic rank to plot

add_nb_seq

Represent the number of sequences or the number of OTUs (add_nb_seq = FALSE). Note that plotting the number of sequences is slower.

min_prop_tax

(default: 0) The minimum proportion for taxa to be plotted. EXPERIMENTAL. For the moment each links below the min.prop. tax is discard from the sankey network resulting in sometimes weird plot.

tax2remove

a vector of taxonomic groups to remove from the analysis (e.g. c('Incertae sedis', 'unidentified'))

units

character string describing physical units (if any) for Value

symbol2sub

(default: c('\.', '-')) vector of symbol to delete in the taxonomy

...

Additional arguments passed on to sankeyNetwork

Value

A sankeyNetwork plot representing the taxonomic distribution of OTUs or sequences. If fact is set, represent the distribution of the last taxonomic level in the modalities of fact

Author(s)

Adrien Taudière

See Also

sankeyNetwork, ggaluv_pq()

Examples

data("GlobalPatterns", package = "phyloseq")
GP <- subset_taxa(GlobalPatterns, GlobalPatterns@tax_table[, 1] == "Archaea")
if (requireNamespace("networkD3")) {
  sankey_pq(GP, fact = "SampleType")
}

if (requireNamespace("networkD3")) {
  sankey_pq(GP, taxa = 1:4, min_prop_tax = 0.01)
  sankey_pq(GP, taxa = 1:4, min_prop_tax = 0.01, add_nb_seq = TRUE)
}


adrientaudiere/MiscMetabar documentation built on Oct. 13, 2024, 9:42 p.m.