DESeq2 on a complex design
0
0
Entering edit mode
12 weeks ago
Chengrui • 0

Hi everyone,

I have a complex experimental design that includes two groups, A and B, and within each group two subgroup designs, A1/A0 and B1/B0.Now I wish to perform such a comparison to see how A1 and B1 compare after excluding the underlying differences between subgroups A0 or B0.

This is what the official documentation says about the contrast function:

a character vector with exactly three elements: the name of a factor in the design formula, the name of the numerator level for the fold change, and the name of the denominator level for the fold change (simplest case)

a list of 2 character vectors: the names of the fold changes for the numerator, and the names of the fold changes for the denominator. these names should be elements of resultsNames(object). if the list is length 1, a second element is added which is the empty character vector, character(). (more general case, can be to combine interaction terms and main effects)”

Based on the official instructions, I used the following comparison:

contrast = list(c("A_1", "A_0"), c("B_1", "B_0"))). I think this comparison gives a positive LogFC result indicating that A1 is going up over B1, and a negative number indicating that A1 is going down over B1. However, when I directly compare the two LogFC data obtained using A1 vs A0 and B1 vs B0, I find that the situation is exactly the opposite of what is expected: when the LogFC data obtained by A1 vs A0 is larger than that obtained by B1 vs B0, the logFC obtained by c("A_1", "A_0") vs c("B_1", "B_0") is a negative number. Why does this happen? Did I set the numerator denominator wrong?

Thank you very much!!

Here is the code:

dds <- DESeqDataSetFromMatrix(countData = counts, colData = group, design = ~0 + design)
resultsNames(dds)
[1] "A_0" "A_1" "B_0" "B_1"
result <- results(dds, contrast = list(c("A_1", "A_0"), c("B_1", "B_0")))

EDIT: Also asked on https://support.bioconductor.org/p/9159302/ but this post is referenced there.

RNA-seq DESeq2 • 302 views
ADD COMMENT
0
Entering edit mode

Not sure if this will solve the problem. However, I've found this blog post to be really helpful with understanding my designs/contrasts. The author creates a contraster() function that is a bit more intuitive and returns the same results as "contrast = list(c())". I use it to figure out what I am comparing, and what my "contrast = list(c())" needs to contain.

ADD REPLY

Login before adding your answer.

Traffic: 1308 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6