plot_guild_pq: Plot information about Guild from tax_table slot previously...

View source: R/dada_phyloseq.R

plot_guild_pqR Documentation

Plot information about Guild from tax_table slot previously created with add_funguild_info()

Description

lifecycle-experimental

Graphical function.

Usage

plot_guild_pq(physeq, levels_order = NULL, clean_pq = TRUE, ...)

Arguments

physeq

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

levels_order

(Default NULL) A character vector to reorder the levels of guild. See examples.

clean_pq

(logical, default TRUE): Does the phyloseq object is cleaned using the clean_pq() function?

...

Other params for be passed on to clean_pq() function

Value

A ggplot2 object

Author(s)

Adrien Taudière

See Also

add_funguild_info()

Examples


if (requireNamespace("httr")) {
  d_fung_mini <- add_funguild_info(data_fungi_mini,
    taxLevels = c(
      "Domain",
      "Phylum",
      "Class",
      "Order",
      "Family",
      "Genus",
      "Species"
    )
  )
  sort(table(d_fung_mini@tax_table[, "guild"]), decreasing = TRUE)

  p <- plot_guild_pq(d_fung_mini)
  if (requireNamespace("patchwork")) {
    (plot_guild_pq(subset_samples(d_fung_mini, Height == "Low"),
      levels_order = p$data$Guild[order(p$data$nb_seq)]
    ) + theme(legend.position = "none")) +
      (plot_guild_pq(subset_samples(d_fung_mini, Height == "High"),
        levels_order = p$data$Guild[order(p$data$nb_seq)]
      ) + ylab("") + theme(axis.text.y = element_blank()))
  }
}


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