Deseq2 time interaction term
2
0
Entering edit mode
28 days 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 • 184 views
1
Entering edit mode
27 days 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

1
Entering edit mode
27 days 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.