hms-dbmi / UpSetR

An R implementation of the UpSet set visualization technique published by Lex, Gehlenborg, et al..
https://cran.rstudio.com/web/packages/UpSetR
Other
763 stars 156 forks source link

upset attributes #231

Open dgcovell opened 2 years ago

dgcovell commented 2 years ago

From the UpSetR issues listed I find that others are seeking to determine the member ids within the numbers listed at the top of each bar of the 'Intersection Size' plot. Further blogging finds that this is both complex and not straight-forward (see https://krassowski.github.io/complex-upset/articles/Examples_R.html#0-2-region-selection-modes).

Failing to find a simple answer, I created tmp_upset <- upset(... and parsed the fields in tmp_upset$New_data (which in my case is 420x7) to build the sets of intersecting row.names(tmp_upset$New_data) for each of the 7 fields. From these results I can tediously reconstruct the members associated with each of the bars in the plot of Intersection Size.

Before I abandon further hope, I would ask the pros whether somewhere buried in attributes(tmp_upset) or names(tmp_upset$Main_bar) I might find an easier solution, Attributes 'Main_bar' and 'heights' or 'name' looked promising, but did not yield results that I could uncover.

Any help would be appreciated.

Regards, David

attributes(tmp_upset) $names [1] "Main_bar" "Matrix" "Sizes" [4] "labels" "mb.ratio" "att.x" [7] "att.y" "New_data" "expression" [10] "att.pos" "first.col" "att.color" [13] "AllQueryData" "attribute.plots" "legend" [16] "query.legend" "BoxPlots" "Set_names" [19] "set.metadata" "set.metadata.plots"

names(tmp_upset$Main_bar) [1] "grobs" "layout" "widths" "heights" [5] "respect" "rownames" "colnames" "name" [9] "gp" "vp" "children" "childrenOrder"