Question: About expressionBarplot () in cummeRbund
gravatar for Ginsea Chen
6.0 years ago by
Ginsea Chen130
Chinese Academy of Tropical Agricultural Sciences, Danzhou, China
Ginsea Chen130 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.6k views
ADD COMMENTlink modified 6.0 years ago by Devon Ryan96k • written 6.0 years ago by Ginsea Chen130

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

ADD REPLYlink written 6.0 years ago by Devon Ryan96k
gravatar for Devon Ryan
6.0 years ago by
Devon Ryan96k
Freiburg, Germany
Devon Ryan96k 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 6.0 years ago • written 6.0 years ago by Devon Ryan96k

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 6.0 years ago by Ginsea Chen130

This is very helpful!

ADD REPLYlink written 5.9 years ago by komal.rathi3.6k

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




ADD REPLYlink modified 5.8 years ago • written 5.8 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 5.8 years ago by Devon Ryan96k

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 5.8 years ago by Devon Ryan96k
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: 1688 users visited in the last hour