getDA: getDA

View source: R/utilities.R

getDAR Documentation

getDA

Description

Inspect the list of p-values or/and log fold changes from the output of a differential abundance detection method.

Usage

getDA(
  method,
  slot = "pValMat",
  colName = "rawP",
  type = "pvalue",
  direction = NULL,
  threshold_pvalue = 1,
  threshold_logfc = 0,
  top = NULL,
  verbose = FALSE
)

Arguments

method

Output of a differential abundance detection method. pValMat, statInfo matrices, and method's name must be present (See vignette for detailed information).

slot

The slot name where to extract values (default slot = "pValMat").

colName

The column name of the slot where to extract values (default colName = "rawP").

type

The value type of the column selected where to extract values. Two values are possible: "pvalue" or "logfc" (default type = "pvalue").

direction

statInfo's column name containing information about the signs of differential abundance (usually log fold changes) (default direction = NULL).

threshold_pvalue

Threshold value for p-values. If present, features with p-values lower than threshold_pvalue are considered differentially abundant. Set threshold_pvalue = 1 to not filter by p-values.

threshold_logfc

Threshold value for log fold changes. If present, features with log fold change absolute values higher than threshold_logfc are considered differentially abundant. Set threshold_logfc = 0 to not filter by log fold change values.

top

If not null, the top number of features, ordered by p-values or log fold change values, are considered as differentially abundant (default top = NULL).

verbose

Boolean to display the kind of extracted values (default verbose = FALSE).

Value

A data.frame with several columns:

  • stat which contains the p-values or the absolute log fold change values;

  • direction which is present if method was a data.frame object, it contains the information about directionality of differential abundance (usually log fold changes);

  • DA which can contain several values according to thresholds and inputs. "DA" or "non-DA" if method object was a vector, "UP Abundant", "DOWN Abundant", or "non-DA" if method was a data.frame.

See Also

getStatistics, extractDA

Examples

data("ps_plaque_16S")
# Add scaling factors
ps_plaque_16S <- norm_edgeR(object = ps_plaque_16S, method = "TMM")
# DA analysis
da.limma <- DA_limma(
    object = ps_plaque_16S,
    design = ~ 1 + HMP_BODY_SUBSITE,
    coef = 2,
    norm = "TMM"
)
# features with p-value < 0.1 as DA
getDA(
    method = da.limma, slot = "pValMat", colName = "rawP", type = "pvalue",
    direction = NULL, threshold_pvalue = 0.1, threshold_logfc = 0,
    top = NULL
)
# top 10 feature with highest logFC are DA
getDA(
    method = da.limma, slot = "pValMat", colName = "rawP", type = "pvalue",
    direction = "logFC", threshold_pvalue = 1, threshold_logfc = 0, top = 10
)
# features with p-value < 0.1 and |logFC| > 1 are DA
getDA(
    method = da.limma, slot = "pValMat", colName = "rawP", type = "pvalue",
    direction = "logFC", threshold_pvalue = 0.1, threshold_logfc = 1, top =
        NULL
)
# top 10 features with |logFC| > 1 are DA
getDA(
    method = da.limma, slot = "pValMat", colName = "rawP", type = "pvalue",
    direction = "logFC", threshold_pvalue = 1, threshold_logfc = 1, top = 10
)

mcalgaro93/benchdamic documentation built on Nov. 28, 2024, 2:16 p.m.