tax_bar_pq: Plot the distribution of sequences or ASV in one taxonomic...

View source: R/plot_functions.R

tax_bar_pqR Documentation

Plot the distribution of sequences or ASV in one taxonomic levels

Description

lifecycle-experimental

Graphical representation of distribution of taxonomy, optionnaly across a factor.

Usage

tax_bar_pq(
  physeq,
  fact = "Sample",
  taxa = "Order",
  percent_bar = FALSE,
  nb_seq = TRUE
)

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

(default: 'Order') Name of the taxonomic rank of interest

percent_bar

(default FALSE) If TRUE, the stacked bar fill all the space between 0 and 1. It just set position = "fill" in the ggplot2::geom_bar() function

nb_seq

(logical; default TRUE) If set to FALSE, only the number of ASV is count. Concretely, physeq otu_table is transformed in a binary otu_table (each value different from zero is set to one)

Value

A ggplot2 plot with bar representing the number of sequence en each taxonomic groups

Author(s)

Adrien Taudière

See Also

plot_tax_pq() and multitax_bar_pq()

Examples


data_fungi_ab <- subset_taxa_pq(data_fungi, taxa_sums(data_fungi) > 10000)
tax_bar_pq(data_fungi_ab) + theme(legend.position = "none")

tax_bar_pq(data_fungi_ab, taxa = "Class")
tax_bar_pq(data_fungi_ab, taxa = "Class", percent_bar = TRUE)
tax_bar_pq(data_fungi_ab, taxa = "Class", fact = "Time")


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