DA_DESeq2 {benchdamic}R Documentation

DA_DESeq2

Description

Fast run for DESeq2 differential abundance detection method.

Usage

DA_DESeq2(
  object,
  pseudo_count = FALSE,
  design = NULL,
  contrast = NULL,
  alpha = 0.05,
  norm = c("TMM", "TMMwsp", "RLE", "upperquartile", "posupperquartile", "none",
    "ratio", "poscounts", "iterate", "TSS", "CSSmedian", "CSSdefault"),
  weights,
  verbose = TRUE
)

Arguments

object

phyloseq object.

pseudo_count

add 1 to all counts if TRUE (default pseudo_count = FALSE).

design

(Required). A formula which specifies the design of the experiment, taking the form formula(~ x + y + z). That is, a formula with right-hand side only. By default, the functions in this package and DESeq2 will use the last variable in the formula (e.g. z) for presenting results (fold changes, etc.) and plotting. When considering your specification of experimental design, you will want to re-order the levels so that the NULL set is first. For example, the following line of code would ensure that Enterotype 1 is used as the reference sample class in tests by setting it to the first of the factor levels using the relevel function:

sample_data(entill)$Enterotype <- relevel(sample_data(entill)$Enterotype, "1")

contrast

character vector with exactly three elements: the name of a factor in the design formula, the name of the numerator level for the fold change, and the name of the denominator level for the fold change.

alpha

the significance cutoff used for optimizing the independent filtering (by default 0.05). If the adjusted p-value cutoff (FDR) will be a value other than 0.05, alpha should be set to that value.

norm

name of the normalization method used to compute the normalization factors to use in the differential abundance analysis. If norm is equal to "TMM", "TMMwsp", "RLE", "upperquartile", "posupperquartile", "CSSmedian", "CSSdefault", "TSS" the scaling factors are automatically transformed into normalization factors.

weights

an optional numeric matrix giving observational weights.

verbose

an optional logical value. If TRUE, information about the steps of the algorithm is printed. Default verbose = TRUE.

Value

A list object containing the matrix of p-values 'pValMat', the dispersion estimates 'dispEsts', the matrix of summary statistics for each tag 'statInfo', and a suggested 'name' of the final object considering the parameters passed to the function.

See Also

phyloseq_to_deseq2 for phyloseq to DESeq2 object conversion, DESeq and results for the differential abundance method.

Examples

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 poscounts normalization factors
ps_NF <- norm_DESeq2(object = ps, method = "poscounts")
# The phyloseq object now contains the normalization factors:
scaleFacts <- phyloseq::sample_data(ps_NF)[, "NF.poscounts"]
head(scaleFacts)
# Differential abundance
DA_DESeq2(object = ps_NF, pseudo_count = FALSE, design = ~ group, contrast =
              c("group", "B", "A"), norm = "poscounts")

[Package benchdamic version 1.0.0 Index]