Thank you for your answer! With "collapsing through the mean" I meant taking the mean across repeated samples using limma's avearrays. That throws out a tonne of information however; duplicateCorrelation seems much better suited and I will look into it!
I'm currently performing differential expression analysis on a longitudinal experiment. To simplify, let's say I have the following:
- 3 subjects (there are actually more of them)
- measured once before treatment
- measured twice after treatment (at set time points)
I am interested in the effect of the treatment, and simply started by using DESeq2 with design ~ treatment + subject. However, this underestimates the p-value, because samples after treatment (from same subjects) are not independent.
How can I model this correctly, keeping my statistical power as large as possible?
My current approach is to collapse the post-treatment samples per study using the mean, and then using limma. Unfortunately, shrinkage using apeglm is then not possible anymore, which is unfortunate because it seems more vigorous than other shrinkage methods.
I have also considered DESeq2::collapseReplicates, but my coding agent warned that summing in this way would still give the collapsed samples inflated importance. Also, the function clearly states that it's meant to be applied to technical replicates.
Before, I was also looking into variancePartition::dream, which allows for the inclusion of mixed effects in limma. However, I did not manage to figure out how to correct for autocorrelation over time using the package.
1 answer
You have a mixed effects design here. The if you believe that there shouldn't be a systematic difference between the two post treatment samples, then you can regard them as a repeated sample. However, its unclear what you mean by "colllapsing through the mean". DESeq's collapseReplicates just adds the counts together. Thats almost certainly not what you want here (unless the two post treatment samples are just replicate sequencing of the same library). instead, you should collapse the replicates through limma's duplicateCorrelation.
Log in to answer this question.
Related: