Question: DESeq 2 two factor design
0
4.3 years ago by
Germany
Christoph0 wrote:

I am trying to use the DESeq2 package on my count data from a targeted RNA sequencing project. I have a two factor design and was wondering about the correct way how to formulate the design formula.

My colData(dds) looks something like this:

       ELS     Cort     sizeFactor
<factor> <factor>  <numeric>
101       Co    naive   0.9500628
103       Co    naive   1.0928817
105       Co    naive   1.0856740
107       MS    naive   1.1095217
109       MS    naive   0.9790554
91        MS    naive   1.1911926
93        MS   inject   0.9647519
95        MS   inject   1.1422150
97        Co   inject   1.1553050
99        Co   inject   1.0367721        

and

design(dds)= ~Cort * ELS

I now want to analyze the main effects of each factor as well as the interaction effect (comparable to a two-way ANOVA).

With this design I get

resultsNames(dds)
[1] "Intercept"            "Cort_inject_vs_naive" "ELS_MS_vs_Co"         "Cortinject.ELSMS"

Do I get the main Cort effect with this results formula?

results(dds, name = “Cort_inject_vs_naive”)

How is the ELS factor handled in this case? Is the Cort effect corrected for ELS or is only a subset of the data with ELS=Co used?

Thanks a lot for your help!

rnaseq deseq2 R • 2.2k views
modified 4.3 years ago by Michael Love26k • written 4.3 years ago by Christoph0
Answer: DESeq 2 two factor design
2
4.3 years ago by
Michael Love26k
United States
Michael Love26k wrote:

"I now want to analyze the main effects of each factor as well as the interaction effect"

The main effects are:

"Cort_inject_vs_naive"

and

"ELS_MS_vs_Co"

These can be called using the 'name' argument.

The first term is the Cort effect for the ELS=Co group.

The second term is the ELS effect for the Cort=naive group.

The interaction effect is:

"Cortinject.ELSMS"

This can also be called using the 'name' argument.

The way interactions work (for all linear models, this is not specific to DESeq2), is that the Cort effect for the ELS=MS group is the sum of the main effect (the first one above) and the interaction term. If this is confusing, I would consult a local statistician who can explain how interaction terms work in linear models.

You can add terms in DESeq2 like so:

results(dds, contrast=c(0,1,0,1))

Or with names:

results(dds, contrast=list(c("Cort_inject_vs_naive", "Cortinject.ELSMS")))
ADD COMMENTlink modified 4.3 years ago • written 4.3 years ago by Michael Love26k