DESeq2 : foldchange calculation with multi-factor design
1
1
Entering edit mode
9.5 years ago

Hi,

I've a question concerning DESeq2. I've a multi-factor design as follow :

samples      condition      type
Sample_A1    untreated      X
Sample_A2    untreated      X
Sample_A3    untreated      Y
Sample_A4    untreated      Y
Sample_B1    treated        X
Sample_B2    treated        X
Sample_B3    treated        Y
Sample_B4    treated        Y

so I do

dds <- DESeqDataSetFromHTSeqCount(sampleTable=samples,directory="./",design= ~ type+condition)
dds <- DESeq(dds)
res <- results(dds)

In the results, I wonder how the log2foldchange is computed ? How it takes into account this two-factor design ?

Thanks

multifactor deseq2 • 5.4k views
ADD COMMENT
2
Entering edit mode
9.5 years ago
Michael Love ★ 2.6k

The two factor design is taken into account as with normal linear regression: we have a term which represents the changes due to type, and a term which represents the change due to condition. Then when you call results(), it is by default testing the condition treated vs untreated effect. But you could also test the type Y vs X effect (more on this in the vignette).

ADD COMMENT
0
Entering edit mode

So in my code the foldchange in the results will only take the factor "condition" into account?

ADD REPLY
0
Entering edit mode

It's "log2 fold change of the condition while controlling for type".

ADD REPLY
0
Entering edit mode

No. It is testing the condition term, but the design includes type, so the type effect is "taken into account" or "controlled for" in the model. You might want to check a reference on linear models for further reference on how this work.

ADD REPLY

Login before adding your answer.

Traffic: 2263 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