edgeR and batch effect correction for differential analysis
1
0
Entering edit mode
m93 • 0
@m93-20797
Last seen 3.2 years ago

I have seen many posts about batch effect correction on RNA-seq data. But I'm little confused in using the code for differential analysis. So, asking it here.

I have been using 8 rna-seq samples, 4 NOTCH silenced samples and 4 Controls. The setup is like this

Samples   type      days
1        Control    day1
2        Control    day1
3        Control    day2
4        Control    day2
5        shNotch    day2
6        shNotch    day2
7        shNotch    day1
8        shNotch    day1

For my data I did the batch correction and then used the data for an MDS plot to look how they clustered.

library(edgeR)
group <- factor(paste0(columndata$type))
dge <- DGEList(counts=countdata, group=group)

keep <- rowSums(cpm(dge) > 1) >= 3
dge <- dge[keep, , keep.lib.sizes=FALSE]

dge <- calcNormFactors(dge, method = "TMM")

logCPM <- cpm(dge, log=TRUE, prior.count=2)
logCPM_bc <- removeBatchEffect(logCPM, batch=columndata$days)
plotMDS(logCPM_bc)

For differential analysis first I created design matrix like following:

design <- model.matrix(~ 0 + group + columndata$days)
colnames(design) <- c("Control","shNotch", "Days")
contrast.matrix <- makeContrasts(shNotch-Control, levels=design)

And now I was wondering whether to use DGElist object dge or logCPM_bc (Batch corrected logCPM) for estimating dispersion estimateDisp, for glmQLFit.

Any help? thanks a lot

edger limma r rnaseq batcheffect • 4.9k views
ADD COMMENT
1
Entering edit mode

removeBatchEffect should not be used for DE analysis but for other downstream analysis, such as PCA. For adjustment of DE analysis, indeed you should include columndata$days in design matrix. Therefore, your dge object should be used. This is important because the linear modeling steps should know that it uses one degree of freedom for the adjustment.

ADD REPLY
0
Entering edit mode

Yes I understand now. Thanks a lot Mikhael.

ADD REPLY
1
Entering edit mode
@james-w-macdonald-5106
Last seen 4 hours ago
United States

Use the DGEList object and include the batch effect in your model.

ADD COMMENT
0
Entering edit mode

Sure. So I guess the design matrix I gave above is the right one where I included batch effect. Thanks a lot James

ADD REPLY

Login before adding your answer.

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