build_dendrograms: Build dendrograms

View source: R/build_dendrograms.R

build_dendrogramsR Documentation

Build dendrograms

Description

This function performs hierarchical clustering on microbial relative abundance data binned at a specified level of taxonomic classification.

Usage

build_dendrograms(
  binned.taxonomy,
  metadata,
  color.by,
  trans = "log10",
  sub.comms,
  cores = 1
)

Arguments

binned.taxonomy

Output from bin_taxonomy()

metadata

Sample metadata

color.by

Metadata column by which to color

trans

Transformation to apply to relative abundance data (default = none). Can be one of "log10", "log", "sqrt", or "none"

sub.comms

(Optional) Metadata column by which to split dendrograms into subcommunities

cores

(Optional) Number of CPUs (default = 1)

Value

This function can be applied directly to the output from bin_taxonomy(). A list is returned:

  • tip_data: underlying dendrogram data; can be used in build_taxa.barplot()

  • hclust_plots: hierarchical clustering plot

  • legends: legend corresponding to hclust_plot

Examples

build_dendrograms(binned_tax, metadata, "sample_type", "sqrt")

mselensky/bngal documentation built on June 3, 2024, 6:27 a.m.