How to plot the batch corrected values in DESeq2
1
0
Entering edit mode
@dhwanidholakia-7550
Last seen 2.1 years ago
INDIA

Hello, I have used DESeq2 for differential analysis of small RNA data. I wanted to plot jitter plot of top most differentialy expressed gene using the plotCounts function. When i plot them i can still see the batch effect in the image generated.I then refereed to your post https://support.bioconductor.org/p/76099/. There it is mentioned that it will model the batch effect in linear regression not remove them also in the following threads it is mentioned that we can use limma package removebatcheffect to visualize the batch effect removal. Based on this i have my question as follows:-

Will the batch effect modeled by limma will be same as that by DESeq2 and can that be used as exact proxy or is there any way to extract and plot batch effect removed modeled values

deseq2 normalization • 1.3k views
ADD COMMENT
0
Entering edit mode

Hello, Iam trying to remove batch effect from my data anad i am recieving strange error which when I googled it I could not find the answer.

dds <- DESeqDataSetFromMatrix( countData= DFall,
                               colData= SampleSheet,
                               design= ~group + Batch)

the above ie my experimental design and it is work well with no error until I come to remove batch effect.

> assay(vsd) <- limma::removeBatchEffect(assay(vsd), vsd$Batch, design=~ group)
Error in lmFit(x, cbind(design, X.batch), ...) : 
  design must be a numeric matrix
De plus : Warning message:
In cbind(design, X.batch) :
  number of rows of result is not a multiple of vector length (arg 1)

Thanks for answering

ADD REPLY
0
Entering edit mode

Wrap ~group in model.matrix().

When stuck you can check the help pages for functions and see if you are providing the right class of object.

ADD REPLY
4
Entering edit mode
@mikelove
Last seen 13 hours ago
United States

The removeBatchEffect() function removes the shifts in mean values. This is not numerically identical to what happens when you include batch in the design of a GLM, but it’s very close, and close enough to be useful for visualization of the counts. You could plot VST data with removeBatchEffect applied and this would represent log2-scale normalized counts with shifts from batch effects removed.

ADD COMMENT
0
Entering edit mode

Sorry to revive this old question. If you wanted to plot batch-corrected expression values not on the log2 scale but on a similar scale to the values produced by the counts(dds, normalized = TRUE) function could you take the log2 inverse of the values produced by the rlog + removeBatchEffect transformation? A similar question was asked regarding edgeR and Aaron Lun provided a handy answer - anything similar for DESeq2?

ADD REPLY
0
Entering edit mode

If you want to convert back to count scale from VST or rlog scale, you can use f(x) = 2^x.

ADD REPLY

Login before adding your answer.

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