Visualizing gene counts and variance stabilization
1
0
Entering edit mode
ysdel ▴ 40
@ysdel-8147
Last seen 7.7 years ago
United States

I am trying to visualise gene counts for a few interesting genes from an RNA-seq study. DESeq2's plotCounts gives me the counts against the conditions. For example,

plotcounts

I have 3 replicates, and there is a pronounced batch effect, as can be seen above. Firstly, is there a way to "cancel out" the batch effect in the plot. For the purpose of differential expression p-values, I have used a design matrix of ~ replicate + condition.

 

Secondly, should I instead plot the variance stabilized transformed counts? I don't think this has anything to do with batch effects, but if I am plotting a number of genes together, will it show them in the correct scale according to variance? Is there a way to plot the data from rlog(dds) for a gene?

deseq2 rnaseq variancestabilizingtransformation visualization • 2.2k views
ADD COMMENT
1
Entering edit mode
@mikelove
Last seen 17 hours ago
United States

"is there a way to "cancel out" the batch effect in the plot"?

I have a plan to add this option in a new version, but not yet.

"should I instead plot the variance stabilized transformed counts"

This is up to you. For simplicity I wrote plotCounts() around log2(normalized counts), but it is easy to use rlog instead. Just use ggplot2 on a data.frame which has one column of rlog.counts=assay(rld)[gene.idx,], and the other columns from colData(dds).

ADD COMMENT
0
Entering edit mode

Thank you! Just a small correction. Currently, plotCounts plots the normalized counts, rather than the log2(normalized counts) unless I am missing something.

To do the batch correction, I ended up using removeBatchEffect(assay(rld), batch= replicate_vector) from limma. The plots look pretty similar before and after batch correction to me. Perhaps this is because these genes were identified as differentially expressed across conditions. I should look at genes d.e. w.r.t. replicates. They should look different before and after removing batch effects.

ADD REPLY
0
Entering edit mode

sorry, yes, you're right, it plots the normalized counts with a log-scale axis.

ADD REPLY

Login before adding your answer.

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