Entering edit mode
Dear list,
I am not sure the correct way to interpret the nbinomLRT results in
multiple level factors condition.
Here is a toy example. I would to find DE genes after controlling
batch effect in the experiments, in which there are multiple levels.
## make data library(DESeq2)dds <- makeExampleDESeqDataSet(m =
18)colData <- data.frame(row.names = rownames(colData(dds)), sample =
colData(dds)$sample, condition = rep(LETTERS[1:6], each = 3), batch =
factor(rep(c(1, 1, 2), 6)))dds <- DESeqDataSetFromMatrix(counts(dds),
colData = colData, design = ~ batch + condition)dds <-
estimateSizeFactors(dds)dds <- estimateDispersions(dds)## LRTestdds <-
nbinomLRT(dds, reduced = formula(~ batch ))resultsNames(dds)[1]
"Intercept" "batch_2_vs_1" "condition_B_vs_A"
"condition_C_vs_A" "condition_D_vs_A" "condition_E_vs_A"
"condition_F_vs_A"res.1 <- results(dds, name =
"condition_B_vs_A")res.2 <- results(dds, contrast =
list("condition_B_vs_A", "batch_2_vs_1")
Questions:1.) I would like to get the DE genes between B and A, while
controlling for the batch effect. Should I take "res.1" or "res.2", or
both are wrong? and what is the correct way to do it?
2.) Why "res.3 <- results(dds, contrast = c("condition", "A", "b"))"
gave error: "Error in normalizeSingleBracketSubscript(j, x) :
subscript contains invalid names"
3.) In order to get DE genes between conditions not directly listed in
the "resultsNames", is the following codes correct? should
"batch_2_vs_1" be included int the contrast?##for example, DE between
C and F, controlling for batch effect;res.4 <- results(dds, contrast =
list("condition_C_vs_A", "condition_F_vs_A")
Best, Chunxuan
[[alternative HTML version deleted]]