dreamlet | R Documentation |
Perform differential expression for each assay using linear (mixed) models
dreamlet(
x,
formula,
data = colData(x),
assays = assayNames(x),
contrasts = NULL,
min.cells = 10,
robust = FALSE,
quiet = FALSE,
BPPARAM = SerialParam(),
use.eBayes = TRUE,
...
)
## S4 method for signature 'dreamletProcessedData'
dreamlet(
x,
formula,
data = colData(x),
assays = assayNames(x),
contrasts = NULL,
min.cells = 10,
robust = FALSE,
quiet = FALSE,
BPPARAM = SerialParam(),
use.eBayes = TRUE,
...
)
x |
SingleCellExperiment or dreamletProcessedData object |
formula |
regression formula for differential expression analysis |
data |
metadata used in regression formula |
assays |
array of assay names to include in analysis. Defaults to |
contrasts |
character vector specifying contrasts specifying linear combinations of fixed effects to test. This is fed into |
min.cells |
minimum number of observed cells for a sample to be included in the analysis |
robust |
logical, use eBayes method that is robust to outlier genes |
quiet |
show messages |
BPPARAM |
parameters for parallel evaluation |
use.eBayes |
should |
... |
other arguments passed to |
Fit linear (mixed) model on each cell type separately. For advanced use of contrasts see variancePartition::makeContrastsDream()
and vignette https://gabrielhoffman.github.io/variancePartition/articles/dream.html#advanced-hypothesis-testing-1.
Object of class dreamletResult
storing results for each cell type
variancePartition::dream()
, variancePartition::makeContrastsDream()
library(muscat)
library(SingleCellExperiment)
data(example_sce)
# create pseudobulk for each sample and cell cluster
pb <- aggregateToPseudoBulk(example_sce,
assay = "counts",
cluster_id = "cluster_id",
sample_id = "sample_id",
verbose = FALSE
)
# voom-style normalization
res.proc <- processAssays(pb, ~group_id)
# Differential expression analysis within each assay,
# evaluated on the voom normalized data
res.dl <- dreamlet(res.proc, ~group_id)
# Examine results
res.dl
# Examine details for each assay
details(res.dl)
# show coefficients estimated for each cell type
coefNames(res.dl)
# extract results using limma-style syntax
# combines all cell types together
# adj.P.Val gives study-wide FDR
topTable(res.dl, coef = "group_idstim", number = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.