UpSetR icon indicating copy to clipboard operation
UpSetR copied to clipboard

combine two UpsetR plots into 1

Open berge2015 opened this issue 8 years ago • 11 comments

Thank you for creating this great, one of the most useful packages that I have come across in R.

I did not see anyone asking this (sorry if it was answered somewhere within the threads), but I was wondering if there is an easy way to combine two plots - created one at a time using the 'upset' function - into a single plot (two plots side by side or arranged top-bottom)? I have tried almost everything from basic R commands to ggplot functions but I haven't been able to accomplish it. I can indeed combine them outside of R but the image quality drops significantly.

berge2015 avatar Jan 22 '17 18:01 berge2015

Hello JakeConway,

I agree with Berge2015, I'd love to generate side-by-side plots. However, I kind of want to see that taken a step further kind of like the following from geom_bar's help page :

image

The reason this is great is because it allows you to easily compare things from the same class. In upset, this means we could easily compare set occupancies from different datasets.

For example, I am using UpSet to plot data from Cytometry experiments. Cytometry experiments tell you whether or not a cell has a protein. 100s of proteins and 10,000s of cells are measured in a single experiment. The data from these experiments are difficult to visualize in a conceptually meaningful way, but UpSet provides a great solution.

However, I really want to compare experiments: control versus disease, for example. If UpSet gains the functionality to compare multiple Cytometry experiments, I think a lot of immunologists will want to try it out on their data!

radlinsky avatar Feb 17 '17 16:02 radlinsky

Hello radlinsky,

Thanks for the suggestion of the dodged bar plot. I will try to implement it within the next week.

JakeConway avatar Feb 18 '17 23:02 JakeConway

Hey Jake,

Any progress on the dodging feature? I'd love to use it in some of my figures!

-R

radlinsky avatar Apr 01 '17 13:04 radlinsky

Hey Jake,

Any news?

Thanks!

-R

radlinsky avatar Jun 01 '17 19:06 radlinsky

You can merge 2 upSet figures together using the following:

upset(...) grid.edit('arrange',name='arrange2') vp = grid.grab() grid.arrange(vp,vp)

Ideally, these gtree objects would be named in the R code to avoid the grid.edit step -- also this would allow the use of grid.grabExpr() rather than grid.grab()

emmesgit avatar Jun 06 '17 20:06 emmesgit

Thanks emmesgit! That's a neat trick.

However, your grid.arrange() solution doesn't scale quite as well as dodged barplots would...

radlinsky avatar Jun 08 '17 16:06 radlinsky

Agree w/ Radlinksy - would be a great feature! SUPER helpful!

psudmant avatar Oct 11 '17 16:10 psudmant

bump

radlinsky avatar Jan 09 '18 21:01 radlinsky

Annual bump lol

radlinsky avatar Mar 21 '19 13:03 radlinsky

+1

BrunildaBalliu avatar Sep 09 '22 00:09 BrunildaBalliu