getDEGTopTable: Get Top Table of a DEG analysis

View source: R/plotDEAnalysis.R

getDEGTopTableR Documentation

Get Top Table of a DEG analysis

Description

Users have to run runDEAnalysis() first, any of the wrapped functions of this generic function. Users can set further filters on the result. A data.frame object, with variables of Gene, Log2_FC, Pvalue, and FDR, will be returned.

Usage

getDEGTopTable(
  inSCE,
  useResult,
  labelBy = S4Vectors::metadata(inSCE)$featureDisplay,
  onlyPos = FALSE,
  log2fcThreshold = 0.25,
  fdrThreshold = 0.05,
  minGroup1MeanExp = NULL,
  maxGroup2MeanExp = NULL,
  minGroup1ExprPerc = NULL,
  maxGroup2ExprPerc = NULL
)

Arguments

inSCE

SingleCellExperiment inherited object, with of the singleCellTK DEG method performed in advance.

useResult

character. A string specifying the analysisName used when running a differential expression analysis function.

labelBy

A single character for a column of rowData(inSCE) as where to search for the labeling text. Leave NULL for rownames. Default metadata(inSCE)$featureDisplay (see setSCTKDisplayRow).

onlyPos

logical. Whether to only fetch DEG with positive log2_FC value. Default FALSE.

log2fcThreshold

numeric. Only fetch DEGs with the absolute values of log2FC larger than this value. Default 0.25.

fdrThreshold

numeric. Only fetch DEGs with FDR value smaller than this value. Default 0.05.

minGroup1MeanExp

numeric. Only fetch DEGs with mean expression in group1 greater then this value. Default NULL.

maxGroup2MeanExp

numeric. Only fetch DEGs with mean expression in group2 less then this value. Default NULL.

minGroup1ExprPerc

numeric. Only fetch DEGs expressed in greater then this fraction of cells in group1. Default NULL.

maxGroup2ExprPerc

numeric. Only fetch DEGs expressed in less then this fraction of cells in group2. Default NULL.

Value

A data.frame object of the top DEGs, with variables of Gene, Log2_FC, Pvalue, and FDR.

Examples

data("sceBatches")
sceBatches <- scaterlogNormCounts(sceBatches, "logcounts")
sce.w <- subsetSCECols(sceBatches, colData = "batch == 'w'")
sce.w <- runWilcox(sce.w, class = "cell_type",
                   classGroup1 = "alpha", classGroup2 = "beta",
                   groupName1 = "w.alpha", groupName2 = "w.beta",
                   analysisName = "w.aVSb")
getDEGTopTable(sce.w, "w.aVSb")

compbiomed/singleCellTK documentation built on Oct. 27, 2024, 3:26 a.m.