I noticed that there are multiple ways to get the result table from DESeq2 and I found that the adj pvalues are slightly different when using these methods while the pvalues maintain the same. I would like to know whether this is normal.
I would also like to know whether my understanding of how to use DESeq2 is correct, therefore, I provide some pseudocode here.
Here is the scenario:
I am using 2 by 4 experimental design:
2 Treatment groups (control and treatment)
4 Tissues (A, B, C, and D)
If I would like to get the DEG for tissue B vs A in the control condition:
results(ddsMF, contrast = c("Tissue", "D", "A"))
alternatively, I can also use:
results(ddsMF, contrast = c(0, 0, 0, 1, 0, 0, 0, 0))
given the order of the coefficient is:
"Treatment_treatment_vs_control" "Tissue_B_vs_A" "Tissue_C_vs_A" "Tissue_D_vs_A" "Treatmenttreatment.TissueB" "Treatmenttreatment.TissueC" "Treatmenttreatment.TissueD"
however, the adj pvalues from these two results are slightly different.
I followed the this tutorial
I would like to know whether the following code is correct if I would like to get the comparison between Tissue D and C in the treatment group:
results(ddsMF, contrast = c(0, 0, 0, -1, 1, 0, -1, 1))
It would be nice to also know is there any scenario that we would need to use the intercept? I found that based on the tutorial I mentioned above, we will never call the intercept.
Thank you!
I think that
contrast = c(0, 0, 0, 1, 0, 0, 0)
is equivalent tocontrast = c("Tissue", "D", "A")
, notcontrast = c("Tissue", "B", "A")
Sorry for the typo. I meant to contrasting between tissue D and A. I have edited the original question.
If you have already specified your
Tissue
group, just useresults(ddsMF, contrast = c("Tissue", "D", "C"))
I understood I can just use
results(ddsMF, contrast = c("Tissue", "D", "C"))
for simple comparison. However, as I also mentioned my the last example in the question, I cannot use similar code to produce the comparison I would like to do and have to use the contrast matrix format. And I found that these two input format seems to provide slightly different results.