DA_ALDEx2 {benchdamic} | R Documentation

## DA_ALDEx2

### Description

Fast run for the ALDEx2's differential abundance detection method.

### Usage

    DA_ALDEx2(
      object,
      pseudo_count = FALSE,
      conditions = NULL,
      mc.samples = 128,
      test = c("t", "wilcox"),
      denom = "iqlr",
      norm = c("TMM", "TMMwsp", "RLE", "upperquartile", "posupperquartile", "none",
        "ratio", "poscounts", "iterate", "TSS", "CSSmedian", "CSSdefault"),
      verbose = TRUE
    )

### Arguments

`object` | phyloseq object.
`pseudo_count` | add 1 to all counts if TRUE (default `pseudo_count = FALSE`).
`conditions` | A character vector. A description of the data structure used for testing. Typically, a vector of group labels. For `aldex.glm`, use a `model.matrix`.
`mc.samples` | An integer. The number of Monte Carlo samples to use when estimating the underlying distributions. Since we are estimating central tendencies, 128 is usually sufficient.
`test` | A character string. Indicates which tests to perform. "t" runs Welch's t and Wilcoxon tests. "kw" runs Kruskal-Wallace and glm tests. "glm" runs a generalized linear model using a `model.matrix`. "corr" runs a correlation test using `cor.test`.
`denom` | A character string. Indicates which features to retain as the denominator for the Geometric Mean calculation. Using "iqlr" accounts for data with systematic variation and centers the features on the set features that have variance that is between the lower and upper quartile of variance. Using "zero" is a more extreme case where there are many non-zero features in one condition but many zeros in another. In this case the geometric mean of each group is calculated using the set of per-group non-zero features.
`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.
`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 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

`aldex` for the Dirichlet-Multinomial model estimation. Several and more complex tests are present in the ALDEx2 framework.

### Examples

    set.seed(1)
    # Create a very simple phyloseq object
    counts <- matrix(rnbinom(n = 300, size = 3, prob = 0.5), nrow = 50, 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))
    # No use of scaling factors
    ps_NF <- norm_edgeR(object = ps, method = "none")
    # The phyloseq object now contains the scaling factors:
    scaleFacts <- phyloseq::sample_data(ps_NF)[, "NF.none"]
    head(scaleFacts)
    # Differential abundance
    DA_ALDEx2(ps_NF, conditions = "group", test = "t", denom = "iqlr",
        norm = "none")

[Package benchdamic version 1.0.0 Index]