heat_tree_pq: Heat tree from 'metacoder' package using 'tax_table' slot

View source: R/plot_functions.R

heat_tree_pqR Documentation

Heat tree from metacoder package using tax_table slot

Description

[Maturing]

Note that the number of ASV is store under the name n_obs and the number of sequences under the name nb_sequences

Usage

heat_tree_pq(physeq, taxonomic_level = NULL, ...)

Arguments

physeq

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

taxonomic_level

(default: NULL): a vector of selected taxonomic level using their column numbers (e.g. taxonomic_level = 1:7)

...

Arguments passed on to heat_tree

Value

A plot

Author(s)

Adrien Taudière

Examples


if (requireNamespace("metacoder")) {
  library("metacoder")
  data("GlobalPatterns", package = "phyloseq")

  GPsubset <- subset_taxa(
    GlobalPatterns,
    GlobalPatterns@tax_table[, 1] == "Bacteria"
  )

  GPsubset <- subset_taxa(
    GPsubset,
    rowSums(GPsubset@otu_table) > 5000
  )

  GPsubset <- subset_taxa(
    GPsubset,
    rowSums(is.na(GPsubset@tax_table)) == 0
  )

  heat_tree_pq(GPsubset,
    node_size = n_obs,
    node_color = n_obs,
    node_label = taxon_names,
    tree_label = taxon_names,
    node_size_trans = "log10 area"
  )

  heat_tree_pq(GPsubset,
    node_size = nb_sequences,
    node_color = n_obs,
    node_label = taxon_names,
    tree_label = taxon_names,
    node_size_trans = "log10 area"
  )
}


adrientaudiere/MiscMetabar documentation built on May 1, 2024, 6:22 a.m.