Question regarding lfcShrink types in DiffBind
1
1
Entering edit mode
@aaed3153
Last seen 15 months ago
United States

Hello,

Rory Stark I have a question regarding the 3 scenarios in which lfcShrink is applied in DiffBind package. The source code looks like this

 if(shrink) {
if(contrast$contrastType=="byname") {
  res$de <- suppressMessages(DESeq2::lfcShrink(pv$DESeq2$DEdata,
                                               coef=contrast$contrast,
                                               lfcThreshold=lfc,
                                               res=res$de,type="apeglm"))
} else  if(contrast$contrastType=="results1") {
  res$de <- suppressMessages(DESeq2::lfcShrink(pv$DESeq2$DEdata,
                                               coef=contrast$contrast[[1]],
                                               lfcThreshold=lfc,
                                               res=res$de,type="apeglm"))
} else {
  res$de <- suppressMessages(DESeq2::lfcShrink(pv$DESeq2$DEdata,
                                               contrast=contrast$contrast,
                                               lfcThreshold=lfc,
                                               res=res$de,type="ashr"))
}

In the above code, what do contrast$contrastType=="byname" and contrast$contrastType=="results1" mean? Could you explain what these three scenarios are?

Further, can the lfcShrink function be turned off so that fold values are calculated as condition1 - condition2 for DESeq2? Is there a scenario where that is possible in DiffBind? I deeply appreciate your help and suggestions. Thank you so much!

Priyanka

FoldChange DiffBind lfcShrink • 3.8k views
ADD COMMENT
0
Entering edit mode
Rory Stark ★ 5.2k
@rory-stark-5741
Last seen 11 days ago
Cambridge, UK

You are looking at some fairly deep DiffBind internals here. The contrastType has to do with how the contrast was specified when calling 'dba.contrast()' (by coefficient, by factor values, etc) See the help page where it discussed the contrast parameter; if you really want to dive in, these values are set by the DiffBind:::pv.checkContrast() function.

DiffBind uses shrunken fold change calculations as this is considered best practice. You can however easily compute your own fold changes. For example:

data(tamoxifen_analysis)
dbreport <- dba.report(tamoxifen)
names(mcols(dbreport))
dbreport$Fold <- dbreport$Conc_Resistant - dbreport$Conc_Responsive
dbreport

Note that even though these are not "shrunken", they may still be of small magnitude.

ADD COMMENT

Login before adding your answer.

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