Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removal of Legend from TMB plot via theme causes plot to fail #368

Open
RiversPharmD opened this issue Oct 22, 2019 · 2 comments
Open

Removal of Legend from TMB plot via theme causes plot to fail #368

RiversPharmD opened this issue Oct 22, 2019 · 2 comments

Comments

@RiversPharmD
Copy link

When I pass a pre-counted TMB list to the waterfall plot function, it still assigns three colors in the legend, assigning synonymous, non-synonymous, and unidentified, while the entire graph is colored as unidentified.

When I use the mutBurdenLayer argument with an assigned theme of legend.position = "none", it returns an error:

Error in heatmap_grob[["grobs"]][[ind_legend]] :
attempt to select less than one element in get1index

and fails to render the rest of the plot.

Likewise, when I pass this code to the mainLayer, it also fails. Any thoughts?

@zlskidmore
Copy link
Member

zlskidmore commented Oct 28, 2019

appologies for the late response,

with the original waterfall() plot, the number of items in the graphical objects must be the same for alignment purposes. I rebuilt the function to in part remedy this but it's not yet ready for use.

If you're looking for a quick solution, you can remove the entire legend after the plot is created

an example:

library(grid)
tmp <- waterfall(brcaMAF, mutBurden = mutation_rate, mainRecurCutoff = 0.25, out="grob")
tmp$grobs[[3]] <- grid.rect(gp=gpar(col="white"))
grid.draw(tmp)

@RiversPharmD
Copy link
Author

RiversPharmD commented Oct 28, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants