lcdb / lcdb-wf

Robust, tested workflows for RNA-seq, ChIP-seq and other high-throughput sequencing analysis
https://lcdb.github.io/lcdb-wf
20 stars 16 forks source link

use the apeglm shrinkage estimator, and work out model details #273

Open daler opened 4 years ago

daler commented 4 years ago

According to the extended shrinkage estimator section in the DESeq2 vignette, apeglm has better performance especially with lower-count genes where the default "normal" mode shrinks to aggressively.

However, as they describe there, this prevents us from using the contrast=c('factorame', 'treat', 'control') syntax for generating results. It's still possible to generate results, it just takes some rearrangement of the model to get it to work.

mitraak commented 4 years ago

Alternative shrinkage methods, apeglm and ashr:

The options for type are:

  • apeglm is the adaptive t prior shrinkage estimator from the apeglm package (Zhu, Ibrahim, and Love 2018). As of version 1.28.0, it is the default estimator.
  • ashr is the adaptive shrinkage estimator from the ashr package (Stephens 2016). Here DESeq2 uses the ashr option to fit a mixture of Normal distributions to form the prior, with method="shrinkage".
  • normal is the the original DESeq2 shrinkage estimator, an adaptive Normal distribution as prior.
mitraak commented 4 years ago

Notes on apeglm:

NOTE: Most of the following is based on DESeq2 docs linked above.

One-factor design w/ three groups

Two factor-design: 3 groups, 2 conditions

Here the third term grp:cnd is the interaction term. There are three condition effects:

  1. grp1, cndB vs cndA
  2. grp2, cndB vs cndA
  3. grp3, cndB vs cndA

and consequently, three interaction contrasts: 2 vs 1, 3 vs 1 and 3 vs 2.

The normal model matrix will have resultsNames(dds):

## [1]  grp2  grp3  cndB  grp2:cndB  grp3:cndB