I have RNA-Seq data from 4 time points (3 hours awake, 9 hours awake, 3 hours asleep, 9 hours asleep). I'm interested in doing something similar to a LRT where genes are found to be significant if they changed at any point in the time course.

However, I'm not sure how to do this considering this is cyclical. Running a LRT test in DESeq2 gives different results depending on which timepoint I choose as the beginning of the time course since I assume it doesn't calculate the last transition back to being awake (Or asleep depending on your reference).
Any ideas on an appropriate way to do this?

time = c(3,9,15,21)
ddsLRT <- DESeqDataSetFromTximport(txi.rsem.lrt, sampleTable, ~time)  
ddsLRT<- DESeq(ddsLRT, test="LRT", reduced = ~1)

1 Answer 1


I think the problem is that you have time as a linear value rather than a factor. While this naively makes sense (after all, you have to go through 3 hours awake before you can get to 9 hours awake), what you end up doing is fitting a single coefficient to each gene of "linearly changes with time". What you want instead is factor, so you can have a system where things like per and clk can cycle:

time = factor(c(3,9,15,21))

The rest is then correct. Note that LRTs are not asking, "is there a change at any time point?", since there will likely be DE genes according to this that are not DE at any single time point. Rather an LRT such as this is asking, "What are genes that vary significantly over time?" There's a subtle different between those two questions. The former question is actually answered by a bunch of pairwise comparisons (taking the union of the DE genes).

  • $\begingroup$ Thanks for this! I actually tried this last night after posting and it seemed to work, but I wasn't 100% sure it meant what I thought it meant until your post. Much appreciated. $\endgroup$ Mar 22, 2018 at 3:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.