I would like to study the effect of a multilevel factor on gene expression in my single-cell RNAseq dataset. (An example dataset can be downloaded from https://github.com/vitamin3615/SigRNA.git) In this example, the variable “condition” is a 3-level factor: E2, E3, and E4. Shown below is the model I constructed with the MAST package. After the likelihood ratio test of the effect of “condition”, I want to do a post-hoc pairwise comparison between the 3 levels of “condition”, say with the multcomp package in R. How can we do that with the MAST output?
Any input is greatly appreciated!
Code should be placed in three backticks as shown below
library('MAST')
# load the data
# download the sample data from https://github.com/vitamin3615/SigRNA.git
sca <- readRDS('sca.rds')
dim(sca)
# check the metadata
head(colData(sca))
str(colData(sca))
# to model the data
zlmCond <- zlm(~ bg + condition + sex + zAge + cngeneson + percent.MT + Seq_sat + Bulk_RIN + (1|ID),
method = 'glmer',
ebayes = FALSE,
fitArgsD = list(nAGQ = 0),
sca)
# test the effect of "condition" on gene expression
LmTest <- lrTest(zlmCond, 'condition ')
sessionInfo( )
HI, did you ever get a good answer for this question? I have the same question.