unifracMatrix: Calculate the shared branch length from a matrix of taxonomic...

View source: R/abundance.R

unifracMatrixR Documentation

Calculate the shared branch length from a matrix of taxonomic labels

Description

Calculate the shared branch length from a matrix of taxonomic labels

Usage

unifracMatrix(
  xx,
  yy = NULL,
  weighted = TRUE,
  checkUpstream = TRUE,
  vocal = FALSE,
  mc.cores = 1
)

Arguments

xx

a matrix with a row for each read and a column for each taxonomic assignment or if yy is NULL then a list of matrices

yy

a matrix with a row for each read and a column for each taxonomic assignment

weighted

logical indicating whether to sum the differences in reads for each branch or if FALSE to look only at presence absence

checkUpstream

a logical indicating whether to make sure taxa with the same name are counted separetely if their upstream taxa differ e.g. two species Bos taurus and Repipta taurus. If you are sure this is not a problem, then computation can be reduced by skipping this step.

vocal

only used if xx is a list. If TRUE output the index as each matrix is processed

mc.cores

an integer giving how many cores to use for multiprocessing if xx is a list

Value

the proportion of the shared branches

Examples

x<-matrix(c('a','b','a','c'),ncol=2,byrow=TRUE)
y<-matrix(c('a','b','a','d'),ncol=2,byrow=TRUE)
unifracMatrix(x,x)
unifracMatrix(x,y)

sherrillmix/dnar documentation built on July 18, 2022, 10:07 p.m.