data_prep: data_prep

Description Usage Arguments Value

View source: R/data_prep.R

Description

Checks data input for transformation (pltransform) and dissimilarity (pldist) functions. Prepares matrix of OTU proportions and CLR-transformed matrix.

Usage

1
data_prep(otus, metadata, paired, pseudoct = NULL)

Arguments

otus

Matrix of OTU counts (better) or proportions. Row names must be sample identifiers (matching metadata), and column names must be OTU identifiers (enforced if using UniFrac distances).

metadata

Data frame with three columns: subject identifiers (n unique values, column name "subjID"), sample identifiers (must match row names of otu.tab, column name "sampID"), and time point or group identifier (if using longitudinal distances, this must be numeric or convertable to numeric).

paired

Logical indicating whether to use the paired version of the metric (TRUE) or the longitudinal version (FALSE). Paired analyis is only possible when there are exactly 2 unique time points/identifiers for each subject or pair.

pseudoct

Pseudocount value to be added to each cell of the matrix. Default is NULL; if NULL, 0.5 will be added if data are counts, min(1e-06, 0.5*min(nonzero p)) will be added if data are proportions, and nothing will be added if no cells have zero values. This is only done for the CLR-transformed data matrix, not the OTU proportion matrix.

Value

Returns OTU proportions, CLR-transformed OTU proportions, and metadata files, all checked for formatting and value problems.


aplantin/pldist documentation built on Feb. 26, 2021, 2:19 p.m.