Question: edgeR and batch effect correction for differential analysis
0
gravatar for madhu93
10 days ago by
madhu930
madhu930 wrote:

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

rnaseq batcheffect limma edger R • 62 views
ADD COMMENTlink modified 10 days ago by James W. MacDonald50k • written 10 days ago by madhu930
1

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 REPLYlink modified 10 days ago • written 10 days ago by mikhael.manurung50

Yes I understand now. Thanks a lot Mikhael.

ADD REPLYlink written 10 days ago by madhu930
Answer: edgeR and batch effect correction for differential analysis
1
gravatar for James W. MacDonald
10 days ago by
United States
James W. MacDonald50k wrote:

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

ADD COMMENTlink written 10 days ago by James W. MacDonald50k

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

ADD REPLYlink written 10 days ago by madhu930
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 132 users visited in the last hour