Hi all,

Does somebody know which package can be used for plots like this?

<a href="http://www.freeimagehosting.net/commercial-photography/"><img src="https://i.imgur.com/JQhsuJ6.png" alt="Commercial Photography"></a>

> The dot plots illustrates the number of detected fusion transcripts per megabase per sample normalized by the sequencing coverage. Tumor types were sorted according to the fraction of samples with fusions. 

I am trying to recreate this plot from the gene fusions paper.
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4468049/

The data is present here:
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4468049/bin/NIHMS632238-supplement-2.xlsx
(Table S1) and using only columns "Cancer, FileName,FusionPair"

I have tried a couple of options from ggplot package but these are different plots.
http://www.sthda.com/english/wiki/ggplot2-dot-plot-quick-start-guide-r-software-and-data-visualization


Thanks

Ron


  
Here is the start:

    library(ggplot2)
    
    #dummy data
    mydat <- mtcars[ , c("cyl", "mpg")]
    mydat$Cancer <- paste0("cancer_", mydat$cyl)
    
    #Order by cancer and mpg (number of fusions per megabase)
    mydat <- mydat[ order(mydat$Cancer, mydat$mpg), ]
    mydat$x <- seq(nrow(mydat))
    
    # make pretty x labels one per cancer
    mydat$xlabel <- c(1, diff(as.numeric(as.factor(mydat$Cancer))))
    mydat$xlabel <- ifelse(mydat$xlabel == 1, mydat$Cancer, NA)
    
    # plot
    ggplot(mydat, aes(x, mpg, col = Cancer)) +
      geom_point() +
      scale_x_continuous(breaks = which(!is.na(mydat$xlabel)), 
                         labels = mydat$xlabel[ !is.na(mydat$xlabel)])

<a href="https://imgur.com/CXqVLO2"><img src="https://i.imgur.com/CXqVLO2.jpg" title="source: imgur.com" /></a>
