Perform differential expression analysis on SCE object
runDEAnalysis(method = c("wilcox", "MAST", "DESeq2", "Limma", "ANOVA"), ...)
runDESeq2(
inSCE,
useAssay = "counts",
useReducedDim = NULL,
index1 = NULL,
index2 = NULL,
class = NULL,
classGroup1 = NULL,
classGroup2 = NULL,
analysisName,
groupName1,
groupName2,
covariates = NULL,
fullReduced = TRUE,
onlyPos = FALSE,
log2fcThreshold = NULL,
fdrThreshold = NULL,
overwrite = FALSE
)
runLimmaDE(
inSCE,
useAssay = "logcounts",
useReducedDim = NULL,
index1 = NULL,
index2 = NULL,
class = NULL,
classGroup1 = NULL,
classGroup2 = NULL,
analysisName,
groupName1,
groupName2,
covariates = NULL,
onlyPos = FALSE,
log2fcThreshold = NULL,
fdrThreshold = NULL,
overwrite = FALSE
)
runANOVA(
inSCE,
useAssay = "logcounts",
useReducedDim = NULL,
index1 = NULL,
index2 = NULL,
class = NULL,
classGroup1 = NULL,
classGroup2 = NULL,
analysisName,
groupName1,
groupName2,
covariates = NULL,
onlyPos = FALSE,
log2fcThreshold = NULL,
fdrThreshold = NULL,
overwrite = FALSE
)
runMAST(
inSCE,
useAssay = "logcounts",
useReducedDim = NULL,
index1 = NULL,
index2 = NULL,
class = NULL,
classGroup1 = NULL,
classGroup2 = NULL,
analysisName,
groupName1,
groupName2,
covariates = NULL,
onlyPos = FALSE,
log2fcThreshold = NULL,
fdrThreshold = NULL,
overwrite = FALSE,
check_sanity = TRUE
)
runWilcox(
inSCE,
useAssay = "logcounts",
useReducedDim = NULL,
index1 = NULL,
index2 = NULL,
class = NULL,
classGroup1 = NULL,
classGroup2 = NULL,
analysisName,
groupName1,
groupName2,
covariates = NULL,
onlyPos = FALSE,
log2fcThreshold = NULL,
fdrThreshold = NULL,
overwrite = FALSE
)Character. Specify which method to use when using
runDEAnalysis(). Choose from "wilcox", "MAST",
"DESeq2", "Limma", "ANOVA". Default "wilcox".
Arguments to pass to specific methods when using the generic
runDEAnalysis().
SingleCellExperiment inherited object.
character. A string specifying which assay to use for the
DE regression. Default "counts" for DESeq2, "logcounts" for
other methods.
character. A string specifying which reducedDim to use
for DE analysis. Usually a pathway analysis result matrix. Set
useAssay to NULL when using. Default NULL.
Any type of indices that can subset a
SingleCellExperiment inherited object by cells. Specifies
which cells are of interests. Default NULL.
Any type of indices that can subset a
SingleCellExperiment inherited object by cells. specifies
the control group against those specified by index1. If
NULL when using index specification, index1 cells will be
compared with all other cells. Default NULL.
A vector/factor with ncol(inSCE) elements, or a character
scalar that specifies a column name of colData(inSCE). Default
NULL.
a vector specifying which "levels" given in class
are of interests. Default NULL.
a vector specifying which "levels" given in class
is the control group against those specified by classGroup1. If
NULL when using annotation specification, classGroup1 cells
will be compared with all other cells.
A character scalar naming the DEG analysis. Required
A character scalar naming the group of interests. Required.
A character scalar naming the control group. Required.
A character vector of additional covariates to use when
building the model. All covariates must exist in
names(colData(inSCE)). Default NULL.
Logical, DESeq2 only argument. Whether to apply LRT
(Likelihood ratio test) with a 'full' model. Default TRUE.
Whether to only output DEG with positive log2_FC value.
Default FALSE.
Only out put DEGs with the absolute values of log2FC
greater than this value. Default NULL
Only out put DEGs with FDR value less than this
value. Default NULL
A logical scalar. Whether to overwrite result if exists.
Default FALSE.
Logical, MAST only argument. Whether to perform MAST's
sanity check to see if the counts are logged. Default TRUE.
The input SingleCellExperiment object with
metadata(inSCE)$diffExp updated with the results: a list named by
analysisName, with $groupNames containing the naming of the
two conditions, $useAssay and $useReducedDim storing the matrix
name that was used for calculation, $select storing the cell selection
indices (logical) for each condition, $result storing a
data.frame of the DEGs summary, and $method storing the
character method name used.
SCTK provides Limma, MAST, DESeq2, ANOVA and Wilcoxon test for differential expression analysis, where DESeq2 expects non-negtive integer assay input while others expect logcounts.
Condition specification allows two methods:
1. Index level selection. Arguments index1 and index2 will be
used.
2. Annotation level selection. Arguments class, classGroup1 and
classGroup2 will be used.
See plotDEGHeatmap, plotDEGRegression,
plotDEGViolin and plotDEGVolcano for
visualization method after running DE analysis.
data(scExample, package = "singleCellTK")
sce <- subsetSCECols(sce, colData = "type != 'EmptyDroplet'")
sce <- scaterlogNormCounts(sce, assayName = "logcounts")
sce <- runDEAnalysis(method = "Limma", inSCE = sce, groupName1 = "group1",
groupName2 = "group2", index1 = seq(20), index2 = seq(21,40),
analysisName = "Limma")