jianhong / trackViewer

A bioconductor package with minimalist design for drawing elegant tracks or lollipop plot
https://jianhong.github.io/trackViewer/
66 stars 16 forks source link

how can i modify and/or remove the lower legend? or overwrite? #28

Closed storySG closed 2 months ago

storySG commented 1 year ago
Screen Shot 2023-07-03 at 19 19 38

I wanted to plot all the exons of a gene. But I don't want them to be labeled below as exon1, exon2, etc... I just want to have one orange bar with the label "TP53".

EDIT: to clarify, i have the features as a simple GRanges object where i subset the exons of choice but it uses the names of each range as the legend (and GRanges requires unique names)

storySG commented 1 year ago

maybe this is already implemented but if there was a similar meta data column like: $label.parameter.draw <- FALSE that could be applied to the features GRanges object that would be ideal!

jianhong commented 1 year ago

Hi,

Thank you for trying trackViewer to plot your data. I update the development trackViewer to meet your request.

You can try:

BiocManager::install("jianhong/trackViewer")
lolliplot(sample.gr, unname(features)) ## to remove the feature legends
names(features) <- rep("TP53", length(features))
lolliplot(sample.gr, features) ## only show the legends label as "TP53"

FYI, by removing the feature names, the feature legends will be removed.