trackViewer icon indicating copy to clipboard operation
trackViewer copied to clipboard

recommended parameter settings for lollipopPlot with large numbers of mutations

Open bkinnersley opened this issue 3 years ago • 6 comments

Hello,

Thank you for such a useful package! I have generally found lollipopPlots produced using this package to look fantastic, however there are a number of genes where I want to plot a very large number of mutations (e.g. hundreds to 1000). I was wondering if there were any parameter settings I could alter (I've checked the vignette https://www.bioconductor.org/packages/devel/bioc/vignettes/trackViewer/inst/doc/lollipopPlot.html) that could help with this? For example:

  • If I wanted to plot circles for all mutations but only add text labels (and dashed lines) for specific mutations, is there an alternative way to do this other than set names for mutations to not label to "" and sample.gr$dashline.col <- "white"?

Thanks very much

Best wishes

Ben

bkinnersley avatar Oct 04 '21 18:10 bkinnersley

Hi Ben, This is a good suggestion. I will put it to my TODO list.

jianhong avatar Nov 18 '21 13:11 jianhong

Hi I am also facing this issue. Is there any update regarding additional parameters that can be used for rendering a select subset of mutations?

MUppal avatar Jan 27 '23 20:01 MUppal

Sorry to update the documentation. try following code in the section of control the labels:

sample.gr.rot <- sample.gr
sample.gr.rot$label.parameter.rot <- 45
lolliplot(sample.gr.rot, features, legend=legend)
sample.gr.rot$label.parameter.rot <- 60
sample.gr.rot$label.parameter.col <- "brown"
lolliplot(sample.gr.rot, features, legend=legend)
## try different colors
sample.gr.rot$label.parameter.col <- sample.int(7,
                                                length(sample.gr),
                                                replace = TRUE)
sample.gr.rot$label.parameter.col[[1]] <- gpar(col=NA) ## remove the first label
sample.gr.rot$dashline.col <- "grey80"
sample.gr.rot$dashline.col[1] <- NA ## remove the dashline for first label
lolliplot(sample.gr.rot, features, legend=legend)

jianhong avatar Jan 27 '23 22:01 jianhong

Hi @jianhong,

I am interested in the same feature. I also ended up setting the names to "" and the dashline.col to NA for those elements in the sample.gr object that I wanted to exclude. However, the problem even if those labels are not visible, they are still drawn. This means that they are jittered in the same way as if you have all labels present, even though there is much more space for drawing available. This is what I mean (top picture, dash lines are represented; bottom picture, dash lines are set to NA).

image image

In this example, V465fs could be plotted right on top of its corresponding node, rather than far away to the right. Same goes for the rest of the positions.

Would it be possible to have a built-in setting to only draw the labels that are wanted and position them correctly? Or is there currently a way to achieve this?

Rmulet avatar Feb 01 '23 11:02 Rmulet

I got what you mean. I just updated the function to handle label.parameter.draw. Please try to install the dev version via

BiocManager::install("jianhong/trackViewer")

Here is the documentation for that:

sample.gr.rot <- sample.gr
sample.gr.rot$label.parameter.rot <- 45
lolliplot(sample.gr.rot, features, legend=legend)
sample.gr.rot$label.parameter.rot <- 60
sample.gr.rot$label.parameter.col <- "brown"
lolliplot(sample.gr.rot, features, legend=legend)
## try different colors
sample.gr.rot$label.parameter.col <- sample.int(7,
                                                length(sample.gr),
                                                replace = TRUE)
sample.gr.rot$label.parameter.draw <- TRUE
sample.gr.rot$label.parameter.draw[[1]] <- FALSE ## remove the first label
lolliplot(sample.gr.rot, features, legend=legend)

Let me know if it does not work.

jianhong avatar Feb 01 '23 15:02 jianhong

Thank you for the prompt response! It works like a charm. :)

Rmulet avatar Feb 02 '23 09:02 Rmulet