View source: R/dream.wrapper.r
FitDream | R Documentation |
FitDream - run mixed effects model on aggregated (summed) data using the method 'dream' by Hoffman et. al. Bioinformatics (2021) doi.org/10.1093/bioinformatics/btaa687. Fits mixed model using lme4 with REML and voom weights.
FitDream(
pb.list,
sample.metadata,
lme4.formula,
dream.contrast.matrix = NULL,
returnvoom = FALSE,
ncores = 4,
...
)
sample.metadata |
metadata, for example, object returned by AggregateCellMetadata |
lme4.formula |
symbolic model formula for model to be fit, for example, '~ 0 + group.timepoint + age + sex + (1|SubjectID)'. covariates must be in sample.metadata |
dge.lists |
list of DGEList objects indexed by cell types – the object returned by 'scglmmr::Normalize' |
pparam |
number of cores for biocparallel. Set with BiocParallel::register(BiocParallel::SnowParam(4)); pparam = BiocParallel::SnowParam(workers = 4, type = "SOCK", progressbar = TRUE). use the desired number of cores |
sample_column |
quoted character e.g. "sample" the subject level sample variable should have multiple timepoints subjectID_timepoint i.e. s1_0, s1_1 |
list of model fits indexed by celltype
## Not run:
# make contrast matrix
L2 = makeContrastsDream(
formula = f1,
data = metadata,
contrasts = c(
baseline = "Group.time1_0 - Group.time0_0",
treatment_delta = "( Group.time1_1 - Group.time1_0 ) - ( Group.time0_1 - Group.time0_0 )",
treatment = "( Group.time1_1 + Group.time0_1 ) / 2 - ( Group.time1_0 + Group.time0_0 ) / 2 "
)
)
f1 = '0 + group.time + age + sex + (1|SubjectID)'
## End(Not run)
fits = FitDream(pb.list = pb, sample.metadata = metadata, lme4.formula = f1, dream.contrast.matrix = L2, ncores = 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.