beta.div: Make a distance matrix of samples vs samples.

Description Usage Arguments Value Examples

View source: R/beta.div.r

Description

Make a distance matrix of samples vs samples.

Usage

1
2
beta.div(biom, method, weighted = TRUE, tree = NULL,
  progressbar = NULL)

Arguments

biom

A matrix, simple_triplet_matrix, or BIOM object, as returned from read.biom. For matrices, the rows and columns are assumed to be the taxa and samples, respectively.

method

The distance algorithm to use. Options are: “manhattan”, “euclidean”, “bray-curtis”, “jaccard”, and “unifrac”. Non-ambiguous abbrevations of the method names are also accepted. A phylogentic tree must be present in biom or explicitly provided via tree= to use the UniFrac methods.

weighted

Take relative abundances into account. When weighted=FALSE, only presence/absence is considered.

tree

A phylo object representing the phylogenetic relationships of the taxa in biom. Will be taken from the tree embedded in the biom object if not explicitly specified. Only required for computing UniFrac distance matrices.

progressbar

An object of class Progress.

Value

A distance matrix.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
    library(rbiom)
    
    infile <- system.file("extdata", "hmp50.biom", package = "rbiom")
    biom <- read.biom(infile)
    biom <- select(biom, 1:10)
    
    dm <- beta.div(biom, 'unifrac')
    
    as.matrix(dm)[1:4,1:4]
    plot(hclust(dm))

cmmr/rbiom documentation built on Nov. 21, 2018, 10:04 a.m.