I have RNA seq data from tissues that were treated with several compounds, at different doses. I am analyzing compound vs. vehicle in single comparisons using DESeq2 which is working fine. We are also trying to compare some compounds against each other in the following ways:
(Compound A vs Vehicle 1) vs (Compound B vs Vehicle 1)
(Compound C vs Vehicle 2) vs (Compound B vs Vehicle 1)
If the vehicle data is the same, can I just directly compare Compound A vs. Compound B? What if it's different? Can I do the 2 comparisons in DESeq2 and then directly take the ratio? That seems overly simple, and I'm not sure how to calculate p-values in that case. Is there a way to write the design formula to accommodate this?
Thank you, this definitely answers my question regarding when the controls are the same. It doesn't seem to apply when the controls are different, though. I edited the original post to make that more clear. Some of my original comparisons have the same denominator and some don't.
If the comparison is different you can use a numeric contrast. Check resultsNames(dds) to see the coefficients in the model. Then you would give a -1 to a term in the denominator and a +1 to a term in the numerator.
E.g. if the resultsNames are:
Intercept, A, B, C, D
And you want to compare (D vs C) vs (B vs A), this is: (D/C) / (B/A) = AD / BC
So the numeric contrast would be:
contrast=c(0,1,-1,-1,1)
That's helpful, thanks!