ps_seriate: Arrange samples in a phyloseq by microbiome similarity

View source: R/ps_seriate.R

ps_seriateR Documentation

Arrange samples in a phyloseq by microbiome similarity

Description

Uses seriation methods from seriation::seriate and often dist_calc (depending on if seriation method requires a distance matrix)

Usage

ps_seriate(
  ps,
  method = "OLO_ward",
  dist = "bray",
  tax_transform = "identity",
  add_variable = FALSE,
  rank = NA
)

Arguments

ps

phyloseq object

method

seriation method for ordering samples, from seriation::seriate

dist

distance method for dist_calc (only used if required for particular seriation method!)

tax_transform

transformation to apply before seriation or any distance calculation

add_variable

add a variable to the sample data indicating seriation order

rank

taxonomic rank to aggregate at, before seriation, NA for no aggregation

Value

phyloseq

See Also

ps_arrange ps_reorder

Examples

library(phyloseq)
data("dietswap", package = "microbiome")

dietswap %>%
  sample_data() %>%
  head(8)

dietswap %>%
  tax_agg("Genus") %>%
  ps_get() %>%
  ps_seriate(method = "OLO_ward", dist = "bray") %>%
  sample_data() %>%
  head(8)

david-barnett/microViz documentation built on April 17, 2025, 4:25 a.m.