dist.unifrac: Calculate weighted or unweighted UniFrac distances. Adopted...

View source: R/internals.R

dist.unifracR Documentation

Calculate weighted or unweighted UniFrac distances. Adopted from fastUniFrac() from phyloseq

Description

Calculate weighted or unweighted UniFrac distances. Adopted from fastUniFrac() from phyloseq

Usage

dist.unifrac(abund, tree, weighted = FALSE, normalise = TRUE, num_threads = 1L)

Arguments

abund

Abundance table with OTU counts, in ampvis2 objects it is available with simply data$abund

tree

Phylogenetic tree (rooted and with branch lengths) as loaded with read.tree.

weighted

Calculate weighted or unweighted UniFrac distances.

normalise

Should the output be normalised such that values range from 0 to 1 independent of branch length values? Note that unweighted UniFrac is always normalised. (default: TRUE)

num_threads

The number of threads to be used for calculating UniFrac distances. If set to more than 1 then this is set by using registerDoParallel. (default: 1)

Value

A distance matrix of class dist.

Author(s)

Kasper Skytte Andersen ksa@bio.aau.dk


MadsAlbertsen/ampvis2 documentation built on Jan. 28, 2024, 7:12 a.m.