Interaction terms and selection of coef in normal and shrunk results
1
0
Entering edit mode
Richelle • 0
@c8796f9b
Last seen 6 weeks ago
Sweden

Hello,

I have been reading the vignette and online forum about the interaction terms and selection of coef as well as releveling to the reference. I thought I understood it but then it got me confused. My design involves 4 cell lines and 4 conditions so my code is like this:

dds <- DESeqDataSetFromMatrix(countData=cells2, colData = info2, design = cellline + condition + cellline:condition)


Assuming cell line 1 and condition A are my references. If I want to know the effect of condition C vs Condition A in cell line 2 (just cell line 2, not in comparison to cell line 1), I select in the list combining main effect of C and interaction term of cell line 2:

 results(dds, contrast =  list("condition_C_vs_A", "cellline2.conditionC"), independentFiltering = T, pAdjustMethod = "fdr")


Is this correct? Based on my understanding of linear regression, it makes sense to add the main effect plus the interaction term. But when I look at the results, it says that the logFC is based on condition_C_vs_A vs celline2.conditionC. If I follow this in the model matrix, it means that the numerator is all condition C (in all cell lines) and denominator are samples of cell 2 condition C. So the differential genes I am seeing is comparing the C in all cell lines vs C in cell line 2. Did I understand this correctly? But what I want is to compare Condition C to Condition A in cell line 2 only. How do I get this?

When I try to select just the interaction term, it says that the logFC is "cellline2.conditionC effect". What does this mean exactly? Is it the samples of the cell line 2 condition 2 compared to the reference Cell line 1 condition A? Apologies if my questions are very basic but I really want to understand how all the comparisons and contrasts work exactly so I know how to use it both for the results() as well as for the lfcShrink() which allows only one coef.

Thank you!

DESeq2 • 125 views
0
Entering edit mode
@mikelove
Last seen 4 hours ago
United States

Please see the diagram in the vignette on interactions, but for further questions on setting up the design, I recommend to consult with a local statistician or someone familiar with linear models in R. I unfortunately have to limit my time on the support site to software-specific questions.

0
Entering edit mode

Hi Michael, thank you for your reply. I am now following as the vignette indicated - to combine the two factors under one variable. It is easier and much simpler this way indeed. Thank you for your time!