diffExp(object, ...) # S4 method for SingleCellExperiment diffExp(object, numerator, denominator, caller = c("edgeR", "DESeq2"), minCells = 2L, minCellsPerGene = 1L, minCountsPerCell = 1L, BPPARAM = BiocParallel::SerialParam()) # S4 method for Seurat diffExp(object, numerator, denominator, caller = c("edgeR", "DESeq2"), minCells = 2L, minCellsPerGene = 1L, minCountsPerCell = 1L, BPPARAM = BiocParallel::SerialParam())
Varies depending on the
caller = "edgeR":
caller = "DESeq2": Unshrunken
DESeq2::lfcShrink() if shrunken results are desired.
Perform pairwise differential expression across groups of cells. Currently supports edgeR and DESeq2 as DE callers.
We are currently recommending the ZINB-WaVE method over zingeR, since it is faster, and has been show to be more sensitive for most single-cell RNA-seq datasets.
We're providing preliminary support for DESeq2 as the differential expression caller. It is currently considerably slower for large datasets than edgeR.
We're trying to follow the conventions used in DESeq2 for contrasts, defining
the name of the factor in the design formula, numerator, and denominator
level for the fold change calculations. See
DESeq2::results() for details.
Van de Berge and Perraudeau and others have shown the LRT may perform better
for null hypothesis testing, so we use the LRT. In order to use the Wald
test, it is recommended to set
useT = TRUE (not currently in use).
For UMI data, for which the expected counts may be very low, the likelihood
ratio test implemented in
nbinomLRT() should be used.
Note that DESeq2 supports
weights in assays automatically, if slotted using
zinbwave, which is no longer recommended for droplet scRNA-seq.
The LRT has been shown to perform better for null hypothesis testing with
droplet scRNA-seq data. Here we are using
edgeR is currently significantly faster than DESeq2 for large datasets.
Note that Seurat currently uses the convention
cells.1 for the numerator
cells.2 for the denominator. See
Seurat::FindMarkers() for details.
data(seurat) object <- seurat ## Compare expression in cluster 3 relative to 2. ident <- clusterID(object) numerator <- names(ident)[ident == "3"] summary(numerator)#> Length Class Mode #> 0 character character#> Length Class Mode #> 19 character character## edgeR # x <- diffExp( # object = object, # numerator = numerator, # denominator = denominator, # caller = "edgeR" # ) # class(x) # summary(x) ## DESeq2 # This will warn about weights with the minimal example. # x <- diffExp( # object = object, # numerator = numerator, # denominator = denominator, # caller = "DESeq2" # ) # class(x) # summary(x)