Git Product home page Git Product logo

Comments (6)

krassowski avatar krassowski commented on May 29, 2024

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:

Screenshot from 2020-06-26 01-34-25

What you see on the plot bars is essentially the count(intersection) as in the frame below:
Screenshot from 2020-06-26 01-35-04

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:

image

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.

krassowski avatar krassowski commented on May 29, 2024

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.

jarekbryk avatar jarekbryk commented on May 29, 2024

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.

MTR164 avatar MTR164 commented on May 29, 2024

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.

krassowski avatar krassowski commented on May 29, 2024

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.

krassowski avatar krassowski commented on May 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.