Adding lfcShrink to DESeq2 analysis
1
0
Entering edit mode
23 months ago
Trivas ★ 1.8k

I'm trying to incorporate lfcShrink into my DESeq2 analysis and I'm running into a problem with the coef argument in lfcShrink.

I performed an experiment with 4 cell lines, treated and untreated, in biological triplicate, for a total of 24 samples. I can use

results(dds, contrast = c("condition", "cell.line.2.treated", "cell.line.2.untreated"))

and get my DGE results and downstream analysis is fine.

My problem arises when trying to use lfcShrink. This forces me to use the coef argument, but when I look at the options in resultsNames, all of the comparisons are with cell.line.1.untreated, e.g.

condition_cell.line.2.treated_vs_cell.line.1.untreated
condition_cell.line.2.untreated_vs_cell.line.1.untreated
condition_cell.line.3.treated_vs_cell.line.1.untreated
condition_cell.line.3.untreated_vs_cell.line.1.untreated

which isn't what I need for my analysis.

I've tried looking into setting the base condition in the DESeq object without any luck. The only thing I can think of doing is setting cell.line.2.untreated as the first level within my colData object, but I'm thinking there's a better way of doing this.

I tried running lfcShrink with contrast instead of coef and get this error:

Error in lfcShrink(dds, contrast = c("condition", "cell.line.2.treated", "cell.line.2.untreated"), : 
type='apeglm' shrinkage only for use with 'coef'
DGE DESeq2 lfcShrink • 1.6k views
ADD COMMENT
2
Entering edit mode

To my knowledge setting the factor level is the only way to accomplish this with apeglm.

ADD REPLY
1
Entering edit mode

I've tried looking into setting the base condition in the DESeq object without any luck.

use relevel to specify the reference level for this factor: http://bioconductor.org/packages/devel/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#note-on-factor-levels

or use ashr shrinkage method which I think uses contrast instead of coef.

For more info see http://bioconductor.org/packages/devel/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#extended-section-on-shrinkage-estimators

ADD REPLY
0
Entering edit mode
ADD COMMENT

Login before adding your answer.

Traffic: 2747 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