Question: About expressionBarplot () in cummeRbund
gravatar for Ginsea Chen
4.9 years ago by
Ginsea Chen120
Chinese Academy of Tropical Agricultural Sciences, Danzhou, China
Ginsea Chen120 wrote:


I tried to use R to analysis the results of cufflinks, but R gave me some errors, I don't know how to solve them. So, I'm pasting the commands below:

> cuff<- readCufflinks('diff_out')
> csDensity(genes(cuff))
Warning messages:
1: Removed 77219 rows containing non-finite values (stat_density). 
2: Removed 34180 rows containing non-finite values (stat_density). 
3: In, x$x, x$y, index) :
  semi-transparency is not supported on this device: reported only once per page
> mygene<- getGene(cuff,'AT3G26280')
> expressionBarplot(mygene)
Error : Mapping a variable to y and also using stat="bin".
  With stat="bin", it will attempt to set the y value to the count of cases in each group.
  This can result in unexpected behavior and will not be allowed in a future version of ggplot2.
  If you want y to represent counts of cases, use stat="bin" and don't map a variable to y.
  If you want y to represent values in the data, use stat="identity".
  See ?geom_bar for examples. (Defunct; last used in version 0.9.2)

Please tell me how to solve this error.

Best regards


rna-seq error expressionbarplot R • 3.3k views
ADD COMMENTlink modified 4.9 years ago by Devon Ryan90k • written 4.9 years ago by Ginsea Chen120

expressionBarplot() is a cummeRbund function. I'll edit your post accordingly.

ADD REPLYlink written 4.9 years ago by Devon Ryan90k
gravatar for Devon Ryan
4.9 years ago by
Devon Ryan90k
Freiburg, Germany
Devon Ryan90k wrote:

It looks like this is just a bug in cummeRbund (rather, it just hasn't been updated to match the current version of ggplot2). You might post this to the bioconductor email list and CC the package maintainer. The fix is actually really simple (it's just changing one line).

For what it's worth, a slightly modified version of that function is below. It'll probably work (but please do notify the package maintainer in any case). Note that I've changed the case of the function name to not mask the original.

        #TODO: Test dat to ensure that there are >0 rows to plot.  If not, trap error and move on...
            dat$fpkm <- dat$fpkm + pseudocount
            dat$conf_hi <- dat$conf_hi + pseudocount
            dat$conf_lo <- dat$conf_lo + pseudocount
                        repDat$fpkm<-repDat$fpkm + pseudocount

        p <- p + geom_bar(stat="identity")
                p <- p + geom_point(aes(x=sample_name,y=fpkm),size=3,shape=18,colour="black",data=repDat)
        if (showErrorbars)
            p <- p +
        if (logMode)
            p <- p + scale_y_log10()
    p <- p + facet_wrap('tracking_id') +
    if (logMode)
        p <- p + ylab(paste("FPKM +",pseudocount))
    } else {
        p <- p + ylab("FPKM")
        if (showStatus){

        p <- p + theme(legend.position="none")
        #Default cummeRbund colorscheme
        p<-p + scale_fill_hue(l=50,h.start=200)
        #Recolor quant flags
        p<- p+ scale_colour_manual(name='quant_status',values=quant_colors)
ADD COMMENTlink modified 4.9 years ago • written 4.9 years ago by Devon Ryan90k

Wow, detailed answer, I am a new user of R, Thanks for your help. Now I will try to solve it as your follows.

ADD REPLYlink written 4.9 years ago by Ginsea Chen120

This is very helpful!

ADD REPLYlink written 4.7 years ago by komal.rathi3.4k

Thanks for the workaround! Three months on and this still isn't fixed in the cummeRbund release.




ADD REPLYlink modified 4.6 years ago • written 4.6 years ago by mdwelch0

I'll have to see if the OP ever reported this issue. If not, I'll do it and provide a link to this thread.

ADD REPLYlink written 4.6 years ago by Devon Ryan90k

This should have been fixed in version 2.7.1, which will be the next release and should be out pretty soon (around the October 14th).

ADD REPLYlink written 4.6 years ago by Devon Ryan90k
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: 1456 users visited in the last hour