This is a test version of Biostars. For the public version, visit https://www.biostars.org.
DESeq2 : foldchange calculation with multi-factor design

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

1 answer

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).

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

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

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.

Log in to answer this question.