Help understanding the contrast function in DESeq2
1
0
Entering edit mode
@eric-de-sousa-22678
Last seen 3.2 years ago

I have an experiment with 4 different conditions.

My idea was to use the contrast function to make the comparisons between the conditions but some comparisons don't seem to have have any DE genes.

Since this was disappointing I wanted to make sure I was using the contrast function properly so this time I only imported the data from 2 conditions instead of 4. And I compared res <- results(dds) with res2 <- results(dds, contrast=c("condition","A","B")).

Shouldn't the results from res and res2 be the same in this situation? But they are not.

deseq2 • 1.0k views
1
Entering edit mode
@fischer-philipp-18490
Last seen 10 months ago
Austria

What does head(res) and head(res2) return? One is able to see log2 fold change (MLE): A vs B in both, res and res2.
Probably your conditions are not named Aand Bso as reference label another variable is beeing used.

To make sure to use the suiting reference label use something like this: dds$condition <- relevel(dds$condition, ref = "B")

0
Entering edit mode

By checking head(res) and head(res2) I was able to figure out that I made a mistake in the design matrix.

Now that I've fixed that the results of res <- results(dds) and res2 <- results(dds, contrast=c("condition","A","B")) match up.

Thanks!