Deseq2 time interaction term
2
0
Entering edit mode
3.0 years ago
gt ▴ 30

I have an experiment with four conditions (control and three treatment groups) and five time points for each condition. I would like to estimate the overall effect of each condition (control as reference) and test the significance of this effect for each condition. I then would like to estimate the effect (along with test for significance of each condition (control still as reference) at each time point separately. So far I have the following

dds <- DESeqDataSetFromMatrix(countData = Counts,colData = meta,design = ~ Condition + Time + Condition:Time)
dds$Condition <- relevel(dds$Condition,ref = 'Control')
dds <- estimateSizeFactors(dds)
dds <- DESeq(dds)
deseq2 rna-seq DE R • 1.8k views
ADD COMMENT
3
Entering edit mode
3.0 years ago

Hey, have you checked the examples accessible via ?DESeq2::results?

 ## Example 2: two conditions, two genotypes, with an interaction term

 dds <- makeExampleDESeqDataSet(n=100,m=12)
 dds$genotype <- factor(rep(rep(c("I","II"),each=3),2))

 design(dds) <- ~ genotype + condition + genotype:condition
 dds <- DESeq(dds) 
 resultsNames(dds)

 # the condition effect for genotype I (the main effect)
 results(dds, contrast=c("condition","B","A"))

 # the condition effect for genotype II
 # this is, by definition, the main effect *plus* the interaction term
 # (the extra condition effect in genotype II compared to genotype I).
 results(dds, list( c("condition_B_vs_A","genotypeII.conditionB") ))

 # the interaction term, answering: is the condition effect *different* across genotypes?
 results(dds, name="genotypeII.conditionB")

Replace genotype with time, and then you should be able to extrapolate the information from this code snippet and apply it to your own situation.

Kevin

ADD COMMENT
0
Entering edit mode

This article Talks about one model for comparison as such

Control versus the rest
Rather than considering each treatment-control comparison separately, suppose that it is of interest to compare the control group to all of the treatment groups simultaneously. The idea of this is to find the genes that may define the control relative to the treatments. The same can also be carried out for individual treatment groups. For example, we could also consider the genes that define treatment I relative to the rest of the groups

It described the model as such

makeContrasts((treatmentI+treatmentII+treatmentIII)/3-treatmentCTL,
  levels=colnames(design))

I would like to compare one reference group vs rest of the condition

How do i implement this in deseq2? or rather how to use this to make contrast as you have shown above?

ADD REPLY
1
Entering edit mode
3.0 years ago

The results function is what matters more here. Always specify the contrast, if only to remove any ambiguity or confusion as to what you actually ran. I'm not actually sure what contrast you are running there. You can use that design to get the difference in slopes between treatments across time points.

To compare a subset of samples to another subset (like control at t = 5 to treatment1 at t = 5, make a new column of Treatment_time, and make that column alone your design.

I strongly recommend you get the normalized counts for your dataset, put them in Excel, and look at some examples to get an idea of approximately what fold changes you should expect. In most cases, DESeq2's olg2fold changes will differ only slightly from what you can calculated yourself in Excel.

ADD COMMENT

Login before adding your answer.

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