preDA: Pre-processing for DAtest

View source: R/preDA.R

preDAR Documentation

Pre-processing for DAtest

Description

Pre-process the count table before running DAtest functions

Usage

preDA(data, min.samples = 0, min.reads = 0, min.abundance = 0)

Arguments

data

Either a matrix with counts/abundances, OR a phyloseq object. If a matrix/data.frame is provided rows should be taxa/genes/proteins and columns samples

min.samples

Minimum number of samples the features should be present in. Default 0

min.reads

Minimum number of total reads the features should have. Default 0

min.abundance

Minimum mean relative abundance features should have. Default 0

Value

Similar to input, but with features not reaching the criteria given grouped as "Others"

Examples

# Creating random count_table with many low abundant
set.seed(4)
mat <- matrix(rnbinom(1000, size = 0.05, mu = 500), nrow = 100, ncol = 10)
# Keep only those present in at least 3 samples
res <- preDA(mat, min.samples = 3)

# Last feature is now called 'Others' and is a sum of all features present in less than 3 samples
rownames(res)[nrow(res)]

Russel88/DAtest documentation built on March 24, 2022, 3:50 p.m.