dist_mat: Create Distance Matrix

dist_matR Documentation

Create Distance Matrix

Description

This utility function calculates distance based on a user defined measure and optionally filters probes by leading log fold change.

Usage

dist_mat(dat, dist, p, top, filter_method, center, robust = FALSE)

Arguments

dat

Omic data matrix.

dist

Distance measure to be used.

p

Power of the Minkowski distance.

top

Optional number (if > 1) or proportion (if < 1) of top probes to be used for distance calculations.

filter_method

String specifying whether to apply a "pairwise" or "common" filter if top is non-NULL.

center

Center each probe prior to computing distances?

robust

Use robust probe centering?

Details

Data are optionally centered by probe and samplewise distance calculated using one of the following methods:

  • "euclidean", "maximum", "manhattan", and "minkowski" are all documented in the dist function. bioplotr relies on a lower level implementation via Rfast::Dist to speed up computations.

  • "cosine" and "canberra" are implemented and documented in wordspace::dist.matrix.

  • "pearson", "kendall", and "spearman" correspond to various forms of correlation distance, generally defined as 1 – the absolute value of the correlation coefficient. See cor for more details.

  • "bray", "kulczynski", "jaccard", "gower", "altGower", "morisita", "horn", "mountford", "raup", "binomial", "chao", "cao", and "mahalanobis" are all available and documented in the vegan::vegdist function. These are designed for use with ecological data, e.g. a matrix of microbial OTU counts.

  • "bhattacharyya", "hellinger", "kullback_leibler", and "MI" are information theoretic distance metrics. The former three are implemented in Rfast::Dist. See bioDist::MIdist for details on the latter.


dswatson/bioplotr documentation built on March 3, 2023, 9:43 p.m.