Question: edgeR and batch effect correction for differential analysis
gravatar for madhu93
6 months ago by
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.

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)

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 • 298 views
ADD COMMENTlink modified 6 months ago by James W. MacDonald52k • written 6 months ago by madhu930

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 6 months ago • written 6 months ago by mikhael.manurung200

Yes I understand now. Thanks a lot Mikhael.

ADD REPLYlink written 6 months ago by madhu930
Answer: edgeR and batch effect correction for differential analysis
gravatar for James W. MacDonald
6 months ago by
United States
James W. MacDonald52k wrote:

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

ADD COMMENTlink written 6 months ago by James W. MacDonald52k

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 6 months ago by madhu930
Please log in to add an answer.


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