Deseq2 time interaction term
Entering edit mode
4 weeks ago
townsendae • 0

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 • 193 views
Entering edit mode
4 weeks 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) 

 # 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.


Entering edit mode
4 weeks ago
swbarnes2 9.9k

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.


Login before adding your answer.

Traffic: 1094 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6