Hello,
I have a dataset from 4 patients at 3 timepoints. This is the design formula:
dds <- DESeqDataSetFromMatrix(cluster3_counts,
colData = metadata_3,
design = ~ orig.ident + timepoint)
First question: I tried two design formula, one is design = ~ orig.ident + timepoint
and the other is design = ~ timepoint,
but from PCA plot, they looked the same.
And then I run DESeq2:
dds_lrt <- DESeq(dds, test = "LRT", reduced = ~ orig.ident)
Second question: how to extract the results for all comparisons, like timepoint 2 vs. timepoint 1?
Although I read the tutorial ?results, there are no such an example and I am still confused.
Thank you for your quick reply!
In the contrast tutorial, the example is
results(dds, contrast=c("condition","C","B"))
. In my case, I also have theorig.ident
, I do not know how to include this variable in the contrast or just usingresults(ads_lrt, contrast=c("timepoint", "1", "2"))
?If you want to contrast the timepoints then the latter contrast is valid. The influence of
orig.ident
has already been taken care of as part of whatDESeq()
does under the hood. Hence, the latter contrast will give you timepoint differences that are adjusted for theorig.indent
. As James suggests, for these pairwise comparisons the Wald test is usually preferred since it tests directly for fold change differences.