Complex Contrast in DESeq2
1
0
Entering edit mode
@f68bdf4c
Last seen 16 months ago
Norway

Hi, I am using DESeq2 to look at the effect of different diet over time. I have 3 different diet (D1, D2, D3), and 3 time points (T1, T2, T3). I am trying to create best model for this, therefore I tried

dds <- DESeqDataSetFromMatrix(countData=rawCounts_totat, 
                                          colData=mapping_file, 
                                          design=~Diet+Time+Diet:Time)
dds.1 <- DESeq(dds, parallel = T)
resultsNames(dds.1)
[1] "Intercept"       "Diet_D1_vs_ctr" "Diet_D2_vs_ctr" "Diet_D3_vs_ctr" "Time_T2_vs_T1"   "Time_T3_vs_T1"  
[7] "DietD1.TimeT2"  "DietD2.TimeT2"  "DietD3.TimeT2"  "DietD1.TimeT3"  "DietD2.TimeT3"  "DietD3.TimeT3" 

table(colData(dds.1)$Time, colData(dds.1)$Diet)
# ctr here means control    
     ctr  D1  D2  D3
  T1  12  12  12  12
  T2  12  12  12  12
  T3  12  12  12  12

Question 1: But my question is to compare within Diet 1 (D1) over time, that means I need to look at the comparison between T1 vs T2, T1 vs T3, and T2 vs T3 for Diet 1, similarly for other Diets (D2 and D3).

Question 2: Secondly, what does lets say, "DietD1.TimeT2" mean here?

res.D1 <- results(dds.1, contrast=c("Diet", "D1", "ctr"))

Question 3: If I use the above contrast function to compare between Diet 1 and control (ctr), does this uses all the samples present in Diet 1 (12+12+12) and in the control (12+12+12)?

But I want to use contrast function to compare between Diet 1 (n=12) and control (n=12) at T1 or at T2 or at T3.

Any suggestion would be helpful.

Many thanks!

DESeq2 • 725 views
ADD COMMENT
0
Entering edit mode
swbarnes2 ★ 1.3k
@swbarnes2-14086
Last seen 9 hours ago
San Diego

If you don't understand what your code is doing, I strongly suggest you put down your data, and run through one or two tutorials with sample data first. (Hint #1; don't just throw interactions into your design. Omit them unless you are sure that you need them and that you are sure you understand how they change the results you can get out)

ADD COMMENT
0
Entering edit mode

I wish there was any option to downgrade your answer, unfortunately not. DESeq2 tutorial is good for simple model, but not very useful for complex ones.

ADD REPLY
0
Entering edit mode

Hi,

Unfortunately I don’t have enough time to provide guidance on statistical design and analysis on the support site but I have to reserve my time for software related questions. I recommend working with a local statistician or someone familiar with linear models in R.

ADD REPLY

Login before adding your answer.

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