I want to use limma for the analysis of changing values over time. My data set consists of 2 conditions and 9 evenly spread time points (without replicates) for each condition.
I have two biological questions that I would like to address:
1) I want to identify genes whose values change significantly over time in one condition.
2) I want to identify genes who respond differently over time in condition 2 compared to condition 1.
I read in the user’s guide concerning time-course experiments in one condition that this problem “can be viewed as a factorial experiment but a simpler approach is to use the group-mean parametrization.”
However, I am still not quite sure how the contrast matrix should look like.
The user’s guide explains that “Any two contrasts between the three times would give the same result. The same gene list would be obtained had "wt.24hr-wt.0hr" been used in place of "wt.24hr-wt.6hr" for example.”
I have already read the question "Limma and time-course data" covering a similar problem but I am not sure whether I understood it correctly.
Does it suffice to fit one contrast for the end point and the start point as long as they span the entire time course as described here? Or should I make a pairwise comparison of the 8 later time points with the first one?
This is what I have:
lev <- c("cond1_t1","cond1_t2","cond1_t3","cond1_t4","cond1_t5","cond1_t6","cond1_t7","cond1_t8","cond1_t9","cond2_t1","cond2_t2","cond2_t3","cond2_t4","cond2_t5","cond2_t6","cond2_t7","cond2_t8","cond2_t9") f <- factor(targets$Target, levels=lev) design <- model.matrix(~0+f) colnames(design) <- lev fit <- lmFit(eset, design) # identify genes whose values change significantly over time in condition 1 contr_cond1 <- makeContrasts("cond1_t9-cond1_t1", "cond1_t8-cond1_t1", "cond1_t7-cond1_t1", "cond1_t6-cond1_t1", "cond1_t5-cond1_t1", "cond1_t4-cond1_t1", "cond1_t3-cond1_t1", "cond1_t2-cond1_t1", levels=design) # identify genes whose values change significantly over time in condition 2 contr_cond2 <- makeContrasts("cond2_t9-cond2_t1", "cond2_t8-cond2_t1", "cond2_t7-cond2_t1", "cond2_t6-cond2_t1", "cond2_t5-cond2_t1", "cond2_t4-cond2_t1", "cond2_t3-cond2_t1", "cond2_t2-cond2_t1", levels=design) # identify genes who respond differently over time in condition 2 compared to condition 1 contr.dif <- makeContrasts(dif9 =(cond2_t9-cond2_t1)-(cond1_t9-cond1_t1), dif8 =(cond2_t8-cond2_t1)-(cond1_t8-cond1_t1), dif7 =(cond2_t7-cond2_t1)-(cond1_t7-cond1_t1), dif6 =(cond2_t6-cond2_t1)-(cond1_t6-cond1_t1), dif5 =(cond2_t5-cond2_t1)-(cond1_t5-cond1_t1), dif4 =(cond2_t4-cond2_t1)-(cond1_t4-cond1_t1), dif3 =(cond2_t3-cond2_t1)-(cond1_t3-cond1_t1), dif2 =(cond2_t2-cond2_t1)-(cond1_t2-cond1_t1), levels=design)
fit2_cond1 <- contrasts.fit(fit, contr_cond1) fit2_cond2 <- contrasts.fit(fit, contr_cond2) fit2_dif <- contrasts.fit(fit, contr_dif) fit2_cond1 <- eBayes(fit2_cond1) fit2_cond2 <- eBayes(fit2_cond2) fit2_dif <- eBayes(fit2_dif) topTableF(fit2_cond1, adjust="BH") topTableF(fit2_cond2, adjust="BH") topTableF(fit2_dif, adjust="BH")
Is this approach appropriate for my biological questions or is there a better way to do it?
I would be very grateful for any help.