| DA_limma {benchdamic} | R Documentation |
Fast run for limma voom differential abundance detection method.
DA_limma(
object,
pseudo_count = FALSE,
design = NULL,
coef = 2,
norm = c("TMM", "TMMwsp", "RLE", "upperquartile", "posupperquartile", "none",
"ratio", "poscounts", "iterate", "TSS", "CSSmedian", "CSSdefault"),
weights,
verbose = TRUE
)
object |
phyloseq object. |
pseudo_count |
add 1 to all counts if TRUE (default
|
design |
character name of the metadata columns, formula, or design matrix with rows corresponding to samples and columns to coefficients to be estimated. |
coef |
integer or character index vector indicating which coefficients of the linear model are to be tested equal to zero. |
norm |
name of the normalization method used to compute the
scaling factors to use in the differential abundance analysis. If |
weights |
an optional numeric matrix giving observational weights. |
verbose |
an optional logical value. If |
A list object containing the matrix of p-values 'pValMat', the matrix of summary statistics for each tag 'statInfo', and a suggested 'name' of the final object considering the parameters passed to the function.
voom for the mean-variance relationship
estimation, lmFit for the linear model framework.
set.seed(1)
# Create a very simple phyloseq object
counts <- matrix(rnbinom(n = 60, size = 3, prob = 0.5), nrow = 10, ncol = 6)
metadata <- data.frame("Sample" = c("S1", "S2", "S3", "S4", "S5", "S6"),
"group" = as.factor(c("A", "A", "A", "B", "B", "B")))
ps <- phyloseq::phyloseq(phyloseq::otu_table(counts, taxa_are_rows = TRUE),
phyloseq::sample_data(metadata))
# Calculate the TMM scaling factors
ps_NF <- norm_edgeR(object = ps, method = "TMM")
# The phyloseq object now contains the scaling factors:
scaleFacts <- phyloseq::sample_data(ps_NF)[, "NF.TMM"]
head(scaleFacts)
# Differential abundance
DA_limma(object = ps_NF, pseudo_count = FALSE, design = ~ group, coef = 2,
norm = "TMM")