lfc Shrinkage with multiple comparison groups
1
0
Entering edit mode
@c4bc7ef3
Last seen 23 months ago
United Kingdom

I would like to know how to apply lfcShrink to different contrasts where I have 4 groups in my model (LOCHYcontrol, LARUcontrol, LOCHYpolyIC and LARU polyIC).

The contrasts I am interested in are;

  1. LOCHYcontrol vs LARUcontrol
  2. LOCHYpolyIC vs LARUpolyIC
  3. LOCHYcontrol vs LOCHYpolyIC
  4. LARUcontrol vs LARUpolyIC

When I run the model and look at the resultsNames, I am not sure how to then apply lfcShrink to the contrasts I am interested in as only one of these appears in the resultsNames (site_treat_LOCHYpolyIC_vs_LOCHYcontrol).

Is there a way to access all possible contrasts with lfcSkrink?

### create agglomerated variable ###
coldata$site_treat <- as.factor(paste(coldata$site, coldata$treatment, sep=""))
coldata$site_treat <- relevel(coldata$site_treat, "LOCHYcontrol","LARUcontrol","LOCHYpolyIC","LARUpolyIC")
coldata

### using agglomerated variable to model counts, so 4 levels ###
dds_new <- DESeqDataSetFromMatrix(countData = counts,
                                  colData = coldata,
                                  design = ~ site_treat)

dds_new

### run DESeq analysis ###
dds_new <- DESeq(dds_new)

resultsNames(dds_new)

## [1] "Intercept"        
## [2] "site_treat_LARUcontrol_vs_LOCHYcontrol"
## [3] "site_treat_LARUpolyIC_vs_LOCHYcontrol"  
## [4] "site_treat_LOCHYpolyIC_vs_LOCHYcontrol"

### to run lfc shrinkage after the fact ###
resLFC <- lfcShrink(dds_new, coef=4, type="apeglm")
resLFC
RNAseq lfcShrinkage DESeq2 • 657 views
ADD COMMENT
0
Entering edit mode
ATpoint ★ 4.1k
@atpoint-13662
Last seen 3 hours ago
Germany

You have to relevel the group and then rerun the Wald test in order to shrink all contrasts, here is a code suggestion: https://www.biostars.org/p/448959/#484944

Or just use ashr which takes contrasts out of the box.

ADD COMMENT

Login before adding your answer.

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