DESeq 2 two factor design
1
0
Entering edit mode
Christoph • 0
@christoph-8483
Last seen 6.2 years ago
Germany

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!

deseq2 R rnaseq • 3.0k views
2
Entering edit mode
@mikelove
Last seen 22 hours ago
United States

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