tavareshugo / tutorial_DESeq2_contrasts

56 stars 14 forks source link

equivalences for coef argument in lfcShrink() #3

Closed imendizabalCIC closed 2 years ago

imendizabalCIC commented 2 years ago

Thank you for this fantastic tutorial Hugo,

I managed to use merged contrast groups (for one factor, 3 levels) with the results() function following your tutorial. DESeq2 authors recommend applying shrinkage on the fold changes, but I am having difficulties passing these merged contrast groups to the lfcShrink function with the coef argument (the recommended type="apeglm" does not work with contrast argument). Any suggestion would be highly appreciated!!

Isabel

tavareshugo commented 2 years ago

That's true, unfortunately the apeglm shrinking method does work with the numeric contrast option (this is mentioned in the help of ?lfcShrink). However, I believe you can use type = "ashr" method of shrinkage, which should give you comparable results. If you really want to use the apeglm method, then unfortunately it would have to be done using the coef option of the function, meaning you need to code your design in such as way that you can use named coefficients instead of the contrast trick we introduce here.