View source: R/meta_analysis.R
meta_analysis | R Documentation |
Meta-analysis across multiple studies
meta_analysis(
x,
method = "FE",
group = c("ID", "assay"),
control = list(maxiter = 2000)
)
x |
|
method |
meta-analysis method. Values are fed into |
group |
colums in |
control |
passed to |
'FE'
: fixed effects meta-analysis
'REML'
: random effects meta-analysis
'RE2C'
: joint testing of fixed and random effects
library(dreamlet)
library(muscat)
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
# just 'CD14+ Monocytes' for speed
res.proc <- processAssays(pb, ~group_id, assays = "CD14+ Monocytes")
# dreamlet
res.dl <- dreamlet(res.proc, ~group_id)
tab1 <- topTable(res.dl, coef = "group_idstim", number = Inf)
tab1$Dataset <- "1"
# Results from a second cohort
# Here, just a copy of the same results for simplicity
tab2 <- tab1
tab2$Dataset <- "2"
# rbind
tab_combined <- rbind(tab1, tab2)
# Perform fixed effects meta-analysis
res <- meta_analysis(tab_combined, method = "FE")
res[1:3, ]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.