Question: Acceptability of R dropping zeros from logged RNAseq RPKM data
gravatar for ad
5.3 years ago by
United States
ad30 wrote:

I have several groups of RNAseq data that I'm trying to compare to each other through ggplot in R. It consists of several columns of RPKM data each column a different group of samples. ie column 1: gene1 RPKMs in normal. Column 2:gene 1  RPKMs in tumor etc. 

For example using a small excerpt of data


   df = read.table(text="G1 G1.1 G1.2 G1.3 G2 G2.1 G2.2 G2.3
        1    0   3    4    3   2    3    1
        2    'NA'   5    5    5   2    1    2
        2     'NA'   2    1    2   1    2    5", header=TRUE)




     ggplot(dfmelt, aes(variable, value, fill=variable)) +
     geom_boxplot() +
     stat_summary(fun.y = median, geom = "point", position =     position_dodge(width = .9))+




The problem occurs when I attempt to do boxplots of the data in ggplot2 and have it on a log10 y scale. Necessary due to the data distribution. Ggplot appears to simply drop zero values with the message

    Removed x rows containing non-finite values (stat_boxplot)
    Removed x rows containing missing values (stat_summary)

from what I've read ggplot attempts to take the log of 0 and comes up with -Inf so it drops it. Is this of concern in RNAseq expression analysis? If so how do I best handle it to get what I want without distorting the data? 




rna-seq expression R • 1.8k views
ADD COMMENTlink modified 5.3 years ago by JC12k • written 5.3 years ago by ad30

just add a small number to all. Like 1

ADD REPLYlink written 5.3 years ago by Zhilong Jia1.6k

just add a small number to all. Like 1

ADD REPLYlink written 5.3 years ago by Zhilong Jia1.6k
gravatar for JC
5.3 years ago by
JC12k wrote:

RPKM generally produces a lot of zero-values, IMO it's better to use other metric such as CPM or CPK.


Rpkm Calculation For Genes

ADD COMMENTlink written 5.3 years ago by JC12k
Please log in to add an answer.


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