meltDistanceToTable: Convert Distance matrix to Data Frame

View source: R/meltDistanceToTable.R

meltDistanceToTableR Documentation

Convert Distance matrix to Data Frame

Description

Convert Distance matrix to Data Frame

Usage

meltDistanceToTable(x, dist_mat = NULL, name_dist_column = "value", ...)

Arguments

x

A phyloseq object

dist_mat

An object of class dist

name_dist_column

A specific name for column where distance values are stored. Default="value"

...

Option to pass biomeUtils::getSampleTibble like column name and columns to be included in the output.

Details

Converts dist object from phyloseq::distance() to a data frame combined with sample data

Value

A data frame with pairwise distance and sample information

Author(s)

Sudarshan A. Shetty

Examples

library(biomeUtils)
data("FuentesIliGutData")
ps <- filterSampleData(FuentesIliGutData, ILI != "L2")
ps <- phyloseq::rarefy_even_depth(ps)
dist.mat <- phyloseq::distance(ps, "bray")
dist.melt.sample <- meltDistanceToTable(ps,
                                        dist_mat = dist.mat,
                                        name_dist_column = "Bray-Curtis",
                                        select_cols = c("participant_id", "ILI"))
head(dist.melt.sample)


RIVM-IIV-Microbiome/biomeUtils documentation built on July 20, 2023, 10:29 a.m.