I have a design with 7 conditions: S1, S2, S3, (...) S7.
I want to compare S1 to S2, S3 and S4 and find the genes overexpressed in S1 compared to each of these samples, i. e. the genes overexpressed in S1 compared to S2 and overexpressed in S1 compared to S3 and overexpressed in S1 compared to S4. Is this possible using the DESeq2 contrast approach?
What I have done is:
res <- results(dds,contrast=c("stage", c("S2","S3","S4"), "S1"))
but this gives:
> res <- results(dds,contrast=c("stage", c("S2","S3","S4"), "S1")) Error in checkContrast(contrast, resNames) : 'contrast', as a character vector of length 3, should have the form: contrast = c('factorName','numeratorLevel','denominatorLevel'), see the manual page of ?results for more information
The solution I could think of is get the intersection between the comparisons S1 and S2, S1 and S3, S1 and S4, but it would be convenient to run all comparisons at once.
Thanks for your help!
You need to more clearly define what you want to test. Do you want to test for differential expression between S1 and the mean of S2 through S4? Do you want to test whether S1 is significantly different from each of S2 through S4?
Yes, this is what I'd like. I edited the post!