Question: DESeq2 LFC shrinkage is for designs with interactions
gravatar for yk.gatc
5 days ago by
yk.gatc0 wrote:


It seems like LFC shrinkage is not implemented for designs with interactions. Is there a way to get shrinked LFC values for designs with interactions?




ADD COMMENTlink modified 4 days ago • written 5 days ago by yk.gatc0

Thanks Michael for the quick response. 

I did try "ashr" method, but it gave me the following warning - 

> resultsNames(dds)
 [1] "Intercept"    "grp_Y_vs_X"   "grpX.ind.n10" "grpY.ind.n10" "grpX.ind.n2"
 [6] "grpY.ind.n2"  "grpX.ind.n3"  "grpY.ind.n3"  "grpX.ind.n4"  "grpY.ind.n4"
[11] "grpX.ind.n5"  "grpY.ind.n5"  "grpX.ind.n6"  "grpY.ind.n6"  "grpX.ind.n7"
[16] "grpY.ind.n7"  "grpX.ind.n8"  "grpY.ind.n8"  "grpX.ind.n9"  "grpY.ind.n9"
[21] "grpX.cndT"    "grpY.cndT"
> res <- results(dds, contrast=list("grpY.cndT","grpX.cndT"))

> resLFC <- lfcShrink(dds,type="ashr", res=res)
using 'ashr' for LFC shrinkage. If used in published research, please cite:
    Stephens, M. (2016) False discovery rates: a new deal. Biostatistics, 18:2.
Due to absence of package REBayes, switching to EM algorithm
Warning message:
In estimate_mixprop(data, g, prior, optmethod = optmethod, control = control) :
  Optimization failed to converge. Results may be unreliable. Try increasing maxiter and rerunning.

Any thoughts?

ADD REPLYlink modified 4 days ago • written 4 days ago by yk.gatc0

I moved your "Answer" to a "Comment".

I would recommend to use apeglm in this case.

ADD REPLYlink written 4 days ago by Michael Love15k
gravatar for Michael Love
4 days ago by
Michael Love15k
United States
Michael Love15k wrote:

If you check ?lfcShrink in current release it says,

     For ‘type="normal"’, shrinkage cannot be applied to coefficients
     in a model with interaction terms.

So for >= v1.18 with apeglm or ashr shrinkage estimators, you can perform this. We haven't written up a full explanation of these in the vignette, it has a section that I'm looking to expand, but haven't had the time yet. Here is some demo code though for an interaction term:

dds <- makeExampleDESeqDataSet()
dds$x <- factor(rep(1:2,6))
design(dds) <- ~x + condition + x:condition
dds <- DESeq(dds, quiet=TRUE)
[1] "Intercept"        "x_2_vs_1"         "condition_B_vs_A" "x2.conditionB"

​res1 <- lfcShrink(dds, coef=4, type="apeglm")
res2 <- lfcShrink(dds, coef=4, type="ashr")
ADD COMMENTlink written 4 days ago by Michael Love15k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 408 users visited in the last hour