decideTestsPerLabel {scran} | R Documentation

## Decide tests for each label

### Description

Decide which tests (i.e., genes) are significant for differential expression between conditions in each label, using the output of `pseudoBulkDGE`. This mimics the `decideTests` functionality from limma.

### Usage

    decideTestsPerLabel(
      results,
      method = c("separate", "global"),
      threshold = 0.05,
      pval.field = NULL,
      lfc.field = "logFC"
    )

    summarizeTestsPerLabel(results, ...)

### Arguments

`results` | A List containing the output of `pseudoBulkDGE`. Each entry should be a DataFrame with the same number and order of rows, containing at least a numeric `"PValue"` column (and usually a `"logFC"` column). For `summarizeTestsPerLabel`, this may also be a matrix produced by `decideTestsPerLabel`.
`method` | String specifying whether the Benjamini-Hochberg correction should be applied across all clustesr or separately within each label.
`threshold` | Numeric scalar specifying the FDR threshold to consider genes as significant.
`pval.field` | String containing the name of the column containing the p-value in each entry of `results`. Defaults to `"PValue"`, `"P.Value"` or `"p.value"` based on fields in the first entry of `results`.
`lfc.field` | String containing the name of the column containing the log-fold change. Ignored if the column is not available Defaults to `"logFC"` if this field is available.
`...` | Further arguments to pass to `decideTestsPerLabel` if `results` is a List.

### Details

If a log-fold change field is available and specified in `lfc.field`, values of `1`, `-1` and `0` indicate that the gene is significantly upregulated, downregulated or not significant, respectively. Note, the interpretation of “up” and “down” depends on the design and contrast in `pseudoBulkDGE`.

Otherwise, if no log-fold change is available or if `lfc.field=NULL`, values of `1` or `0` indicate that a gene is significantly DE or not, respectively.

`NA` values indicate either that the relevant gene was low-abundance for a particular label and filtered out, or that the DE comparison for that label was not possible (e.g., no residual d.f.).

### Value

For `decideTestsPerLabel`, an integer matrix indicating whether each gene (row) is significantly DE between conditions for each label (column).

For `summarizeTestsPerLabel`, an integer matrix containing the number of genes of each DE status (column) in each label (row).

### Author(s)

Aaron Lun

### See Also

`pseudoBulkDGE`, which generates the input to this function.

`decideTests`, which inspired this function.

### Examples

    example(pseudoBulkDGE)
    head(decideTestsPerLabel(out))
    summarizeTestsPerLabel(out)

[Package scran version 1.18.7 Index]