Understanding Contrasts and Interaction in DESeq2 for 2 genotypes, 2 treatments
2
0
Entering edit mode
Shwetal • 0
@9864ce47
Last seen 11 weeks ago
United States

My experimental design has 2 genotypes - KO and WT (WT is the reference and KO is the mutated form of WT) and each of these have been treated with A. So now, I have the following sample types: WT untreated, WT+A, KO untreated, KO+A.

I want to answer the following questions:

  1. How do the KO samples differ from WT when both are untreated (KO vs WT; untreated)
  2. How do the KO samples differ from WT when both are treated with A (KO+A vs WT+A while accounting for the difference between KO and WT as KO is WT mutated. )
  3. How does the treatment affect WT samples (WT+A vs WT)
  4. How does the treatment affect KO samples (KO+A vs KO)

I have the following code so far:

#Creating the DESeq2 object and running DESeq2 on it
dds = DESeqDataSetFromMatrix(count, colData = sampletable, design = ~Batch+Genotype+Treatment+Genotype:Treatment, tidy = FALSE)
dds = DESeq(dds)

#Getting the result tables 

#For answering KO vs WT (1): 
ko_wt_unt = as.data.frame(results(dds, contrast = c("Genotype", "KO", "WT"), alpha = 0.05))

#For answering KO+A vs WT+A (2): 
ko_wt_A = as.data.frame(results(dds, contrast = list("Genotype_KO_vs_WT", "GenotypeKO.TreatmentA"), alpha = 0.05))

#For answering WT+A vs WT (3)
A_veh_BV2 = as.data.frame(results(dds, contrast = c("Treatment", "A", "Veh"), alpha = 0.05))

#For answering KO+A vs KO
A_veh_KO = as.data.frame(results(dds, contrast = list("Treatment_A_vs_Veh", "GenotypeKO.TreatmentA"), alpha = 0.05))

#Interaction term
interaction = as.data.frame(results(dds, name = "GenotypeKO.TreatmentA", alpha = 0.05))

sessionInfo( )

My questions are:

  1. Is the way I have coded this correct?
  2. What samples is my interaction term actually comparing? I read the vignette and checked the ?results, and it says the interaction term is for condition effect in genotype II. But the results from this differs from what I get when ko_wt_A code line is executed. Which would be the correct way to go considering that I want to adjust baseline levels so I can account for the genotype differences too?
  3. I also read that we can add a new column which combines all the conditions and use that to essentially 'subtract' the specific samples we are interested in. I was wondering that this would be easier way for me to answer the second question, but i don't know if this approach also accounts for the baseline changes between the KO and the WT.
  4. When I am comparing the KO vs WT, does the formula consider samples that were treated too? Or would it only compare the untreated ones?

Thank you so much!

RNASeq DESeq2 • 867 views
ADD COMMENT
0
Entering edit mode
BioinfGuru ▴ 70
@yagalbi-11519
Last seen 9 weeks ago
Ireland

This guide to designs and contrasts in DESeq2 is great. Take a look at section 3: Two factors with interaction.

It also has a great contraster() function that helps me see exactly what I'm comparing. Well worth the study.

ADD COMMENT
0
Entering edit mode
swbarnes2 ★ 1.4k
@swbarnes2-14086
Last seen 4 hours ago
San Diego

Your questions are going to be answered in a much more readable manner if you make a new column in ColData of Genotype_Treatment. Make your design ~ batch + Genotype_Treatment, and do different contrasts with Genotype_Treatment.

ADD COMMENT

Login before adding your answer.

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