Question: Advice on correcting for batch effect using DESeq2
gravatar for C T
5 months ago by
C T90
United States
C T90 wrote:


I am analyzing RNA-seq data using DESeq2 I have 5 groups of samples each with 4 replicates.

Below is a PCA plot of the VST transformed value: enter image description here as shown in the PCA plot, replicate 1 (R1) are separate from the others on the upper half of the PCA plot. There are some clustering of the replicate 2 samples as well (triangles) at the bottom.

I ran deseq2 with a design of ~ batch + group

I tried to visualize the PCA plot after batch effect was modeled following this post, using:

log(counts(dds, normalized=TRUE) + 1) - log(t( t(assays(dds)[["mu"]]) / sizeFactors(dds) ) + 1)

enter image description here

I thought some hidden batch effect is still not corrected. So, I decided to run SVA to get two surrogate variables and include that variables into the model as ~ SV1 + SV2 + group

dat  <- counts(dds, normalized = TRUE)
idx  <- rowMeans(dat) > 1
dat  <- dat[idx, ]
# specify full model which include the variable of interest
mod  <- model.matrix(~ group, data=colData(dds))
# null model is the model with only intercept term
mod0 <- model.matrix(~ 1, data=colData(dds))
# coded this way, svseq is the 2 latent variables not associated with group
svseq <- svaseq(dat, mod, mod0, = 2)
SV1 = svseq[,1]
SV2 = svseq[,2]

However, I think there is still no clear separations between the groups and some batch effects are still there. enter image description here

Any advice would be much appreciated. Thank you in advance!

deseq2 • 123 views
ADD COMMENTlink modified 5 months ago by Michael Love25k • written 5 months ago by C T90
Answer: Advice on correcting for batch effect using DESeq2
gravatar for Michael Love
5 months ago by
Michael Love25k
United States
Michael Love25k wrote:

~batch + condition is what I would use.

To visualize the batch corrected PCA, why not use this code:

ADD COMMENTlink written 5 months ago by Michael Love25k
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: 234 users visited in the last hour