format_tempted {tempted}R Documentation

Format data table into the input of tempted

Description

This function applies a variety of transformations to the read counts and format the sample by feature table and meta data into a data list that can be used as the input of tempted and svd_centralize. For data that are not read counts, or data that are not microbiome data, the user can apply their desired transformation to the data before formatting into list.

Usage

format_tempted(
  featuretable,
  timepoint,
  subjectID,
  threshold = 0.95,
  pseudo = NULL,
  transform = "clr"
)

Arguments

featuretable

A sample by feature matrix.

timepoint

The time stamp of each sample, matched with the rows of featuretable.

subjectID

The subject ID of each sample, matched with the rows of featuretable.

threshold

A threshold for feature filtering for microbiome data. Features with zero value percentage > threshold will be excluded. Default is 0.95.

pseudo

A small number to add to all the counts before normalizing into proportions and log transformation. Default is 1/2 of the smallest non-zero value that is specific for each sample. This pseudo count is added for transform=c("logcomp", "clr", "logit").

transform

The transformation applied to the data. "logcomp" for log of compositions. "comp" for compositions. "ast" for arcsine squared transformation. "clr" for central log ratio transformation. "lfb" for log 2 fold change over baseline (first time point) transformation. "logit" for logit transformation. "none" for no transformation. Default transform="clr" is recommended for microbiome data. For data that are already transformed, use transform="none".

Value

A length n list of matrices as the input of tempted and svd_centralize. Each matrix represents a subject, with columns representing samples from this subject, the first row representing the sampling time points, and the following rows representing the feature values.

See Also

Examples can be found in tempted.


[Package tempted version 0.1.1 Index]