In DESeq2, how do you interpret results based on the order of variables in the "contrast" argument?
1
0
Entering edit mode
gpreising • 0
@gpreising-23064
Last seen 4.5 years ago
Reed College

Hi I'm trying to run differential expression using DESeq2 and I'm a little confused about how to interpret results based on contrast. In my dataset I'm looking at 2 levels within my variable "stage" (B and R) and I want to visualize the results on a volcano plot.

I have created my DESeq object using the following code:

    ddsWald_stage <- DESeqDataFromMatrix(countData = countData, colData = colData, design ~= stage)

I then created my results object using:

res_stage <- results(ddsWald_stage, contrast = c("stage", "B", "R"), cooksCutoff=TRUE)

When I plot this on a volcano plot, will genes that have significantly higher fold changes in the B group be on the right or left side of the plot? I'm a little confused by the documentation for contrast. Any help would be appreciated!

deseq2 • 1.5k views
ADD COMMENT
1
Entering edit mode
Kevin Blighe ★ 4.0k
@kevin
Last seen 5 weeks ago
Republic of Ireland

In this case, the comparison will be conducted with B as the numerator, and R as the denominator, i.e., B / R (B divided by R). It therefore follows that genes having positive fold changes will be higher in group B when compared to group R, and these will indeed appear on the right hand side of the volcano plot.

If you don't specify the order for the comparison, then the order will be determined based on the ordering of the levels in the stage variable. In R, one can re-order factor levels like this:

colData$stage <- factor(colData$stage, levels = c('R', 'B')

...or:

colData$stage <- relevel(colData$stage,  ref = 'R')

Both of these will set R as the reference level.

The Kevin

ADD COMMENT
0
Entering edit mode

Oh gotcha that makes sense. That was really helpful, thank you!

ADD REPLY
0
Entering edit mode

You are welcome, gpreising. Please do not work too much on Sunday (then you'll turn into me...).

ADD REPLY

Login before adding your answer.

Traffic: 537 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6