Comments (6)
Hi Jarek,
Thank you for asking this question - your feedback is greatly appreciated and I will probably link this issue from the readme or frequently asked question section (it was asked elsewhere previously) once I get time to create it.
The short answer is: this is not how the upset plots work; let's say that columns of the input data frame define binary set membership while rows define observations - then the intersection size plotted shows the number of observations which belong to exactly the highlighted sets and no other set. Think of it as always selecting the smallest regions of a Venn diagram (never two regions at a time).
To illustrate this. your input is:
What you see on the plot bars is essentially the count(intersection)
as in the frame below:
which is obviously different from what you may have expected.
There is a previous publication of (Lex et al, 2014) which you may want to read to get more familiar with the concept of UpSet plots (and I recommend to cite it along with any specific implementation you decide to use if upset plots are new in your field to refer readers to more detailed description).
Just to note this, I validated your example with the reference (but currently not maintained) implementation of UpsetR, which gives exactly the same result:
I find it useful to think about it like this: the rows do NOT define sets: they are not elements, they are observations; the plot does not describe sets, the plot describes observations which belong to specific sets.
Please let me know if this helps or not (or if you think that there are better words to explain it)!
from complex-upset.
Also, have a look at the figure in hms-dbmi/UpSetR#72 (comment). The comment says that you could try using ComplexHeatmap package instead if the "intersection" mode (rather than "distinct") is what you want (but I would be afraid that it might confuse the reader if not stated explicitly that you upset plot is departing from the usual convention of counting distinct observations only). Or if you prefer to use this package, I could look into implementing the other modes, but it was not a priority/requested feature up to this point.
from complex-upset.
Hi,
thanks a lot for the explanation. I suspected this is a feature, not a bug ;-) as I also had checked the behaviour of UpSetR::upset and it is was the same. The figure you refer to is brilliant - if you're getting lots of FAQ like this, it may be worthwhile to steal it into the documentation. And if you're really getting many FAQs about this, I think it's time to implement the "union" behaviour :-). I do it the hard way now, by calculating rowSums for all combinations of sets in the matrix and counting how many sums are equal to the number of sets.
sum(rowSums(test2[,c("set1", "set3", "set4")]) == 3)
Thanks a lot again and a great package!
from complex-upset.
Hi;
Is there any way that the "intersaction" mode is included in the upset package? I'm trying to use the complexHeatmap package instead but it's not clear how to select specific combinations. I cannot use the arguement "intersections=" in the complexheatmap package.
from complex-upset.
I have some progress here. The feature of choosing the mode will be available in the next release (hopefully I will polish it over the weekend).
from complex-upset.
FYI, I am also consulting extremely helpful people over at Mathematics.SE to figure out a better terminology - please chime in if you know of a better term/have any ideas.
from complex-upset.
Related Issues (20)
- Incorrect intersection size HOT 8
- Memory issue when passing "intersection=" parameter to large matrix HOT 1
- Add more examples
- add intersection of the union of certain sets within the same intersection upset plot. HOT 2
- Set default color of dots in the matrix plot HOT 1
- Ordering by intersection sizes and degree
- y axis units for the intersection size and stacking plots HOT 7
- Adjusting “Intersection size” to display the percentage of each group when the bars are filled
- Issue with fill colours for set sizes HOT 3
- Changing the y-axis scale for intersection_size from ComplexUpset package HOT 1
- Mapping categorical values to dots in intersection matrix HOT 1
- Deviation
- Possible built-time bug in `upset_themes`
- Coloring multiple *specific* insections
- API seems broken after the latest updates in ggplot2 (>= 3.5.0) HOT 28
- Error "The `axis.text.theta` theme element is not defined in the element hierarchy." HOT 2
- How to color points by variable not in the dataset
- Setting order of intersections with a long list
- Define one or two groups to be compared to all other groups HOT 1
- Error in plot_them(plot)! HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from complex-upset.