trackViewer
trackViewer copied to clipboard
recommended parameter settings for lollipopPlot with large numbers of mutations
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
Hi Ben, This is a good suggestion. I will put it to my TODO list.
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?
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)
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).
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?
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.
Thank you for the prompt response! It works like a charm. :)