Search
Question: Visualizing gene counts and variance stabilization
0
gravatar for ysdel
2.4 years ago by
ysdel30
United States
ysdel30 wrote:

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?

ADD COMMENTlink modified 2.4 years ago by Michael Love14k • written 2.4 years ago by ysdel30
1
gravatar for Michael Love
2.4 years ago by
Michael Love14k
United States
Michael Love14k wrote:

"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 COMMENTlink written 2.4 years ago by Michael Love14k

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 REPLYlink written 2.4 years ago by ysdel30

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

ADD REPLYlink written 2.4 years ago by Michael Love14k
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 2.2.0
Traffic: 153 users visited in the last hour