Rarefy: Rarefying of count data

Description Usage Arguments Details Value Author(s) References Examples

Description

The method normalizes count data by rarefying

Usage

1
Rarefy(e_data, edata_id, size = NULL)

Arguments

e_data

a p \times n data.frame of count data, where p is the number of features and n is the number of samples. Each row corresponds to data for a feature, with the first column giving the feature name.

edata_id

character string indicating the name of the feature identifier. Usually obtained by calling attr(omicsData, "cnames")$edata_cname.

size

the library size to rarefy down to. Default uses the minimum sample size.

Details

Count data is normalized by rarefying, subsampling samples down to a specified library size. If the specified library size is larger than a sample's library size, the sample will be discarded. A warning message will display which samples are discarded. This normalization method is likely not the best course of action.

Value

List containing 4 elements: norm_data is a data.frame with same structure as e_data that contains the rarefied data, location_param is NULL, and scale_param is the library size counts were rarefied to.

Author(s)

Allison Thompson

References

McMurdie, Paul J., and Susan Holmes. "Waste Not, Want Not: Why Rarefying Microbiome Data Is Inadmissible." PLOS Computational Biology. 10.4 (2014)

Examples

1
2
3
4
library(mintJansson)
data(cDNA_hiseq_data)
cDNA_rarefy <- Rarefy(e_data = cDNA_hiseq_data$e_data, edata_id = attr(cDNA_hiseq_data, "cnames")$edata_cname)
library_size <- attr(cDNA_rarefy,"data_info")$scale_param

pmartR/pmartRseq documentation built on May 25, 2019, 9:20 a.m.