All Projects → krassowski → Complex Upset

krassowski / Complex Upset

Licence: mit
A library for creating complex UpSet plots with ggplot2 geoms

Programming Languages

python
139335 projects - #7 most used programming language
r
7636 projects

Projects that are alternatives of or similar to Complex Upset

Ggthemr
Themes for ggplot2.
Stars: ✭ 697 (+374.15%)
Mutual labels:  ggplot2, rstats
Ggrepel
📍 Repel overlapping text labels away from each other.
Stars: ✭ 853 (+480.27%)
Mutual labels:  ggplot2, rstats
Hrbrthemes
🔏 Opinionated, typographic-centric ggplot2 themes and theme components
Stars: ✭ 899 (+511.56%)
Mutual labels:  ggplot2, rstats
Tidyexplain
🤹‍♀ Animations of tidyverse verbs using R, the tidyverse, and gganimate
Stars: ✭ 558 (+279.59%)
Mutual labels:  ggplot2, rstats
Ggeconodist
📉 Create Diminutive Distribution Charts
Stars: ✭ 53 (-63.95%)
Mutual labels:  ggplot2, rstats
Waffle
🍁 Make waffle (square pie) charts in R
Stars: ✭ 614 (+317.69%)
Mutual labels:  ggplot2, rstats
Geowaffle
Combining waffle plot with geofacet
Stars: ✭ 26 (-82.31%)
Mutual labels:  ggplot2, rstats
Moderndive book
Statistical Inference via Data Science: A ModernDive into R and the Tidyverse
Stars: ✭ 527 (+258.5%)
Mutual labels:  ggplot2, rstats
Soccergraphr
Soccer Analytics in R using OPTA data
Stars: ✭ 42 (-71.43%)
Mutual labels:  ggplot2, rstats
Ggplot Courses
👨‍🏫 ggplot2 Teaching Material
Stars: ✭ 40 (-72.79%)
Mutual labels:  ggplot2, rstats
Gganimate
A Grammar of Animated Graphics
Stars: ✭ 1,744 (+1086.39%)
Mutual labels:  ggplot2, rstats
Ggbernie
A ggplot2 geom for adding Bernie Sanders to ggplot2
Stars: ✭ 96 (-34.69%)
Mutual labels:  ggplot2, rstats
Ggalt
🌎 Extra Coordinate Systems, Geoms, Statistical Transformations & Scales for 'ggplot2'
Stars: ✭ 561 (+281.63%)
Mutual labels:  ggplot2, rstats
Ggforce
Accelerating ggplot2
Stars: ✭ 640 (+335.37%)
Mutual labels:  ggplot2, rstats
Upsetr
An R implementation of the UpSet set visualization technique published by Lex, Gehlenborg, et al..
Stars: ✭ 531 (+261.22%)
Mutual labels:  ggplot2, rstats
Tidymv
Tidy Model Visualisation for Generalised Additive Models
Stars: ✭ 25 (-82.99%)
Mutual labels:  ggplot2, rstats
Tidytuesday
📊 My contributions to the #TidyTuesday challenge
Stars: ✭ 410 (+178.91%)
Mutual labels:  ggplot2, rstats
Hexsticker
✨ Hexagon sticker in R
Stars: ✭ 464 (+215.65%)
Mutual labels:  ggplot2, rstats
Ggcats
The geom you always wished for adding cats to ggplot2
Stars: ✭ 34 (-76.87%)
Mutual labels:  ggplot2, rstats
Colormap
R package to generate colors from a list of 44 pre-defined palettes
Stars: ✭ 55 (-62.59%)
Mutual labels:  ggplot2, rstats

ComplexUpset

test codecov CRAN_Status DOI

Quick links: Documentation | Installation | R examples | Python examples

Showcase

Get all the goodies of UpSetR, but with full extensibility of ggplot2.

Example UpSet plot

Click here to display the source code
library(ggplot2)
library(ComplexUpset)

if(!require(ggplot2movies)) install.packages('ggplot2movies')
movies = ggplot2movies::movies
genres = c('Action', 'Animation', 'Comedy', 'Drama', 'Documentary', 'Romance')

upset(
    movies,
    genres,
    annotations = list(
        'Length'=ggplot(mapping=aes(x=intersection, y=length)) + geom_boxplot(),
        'Rating'=ggplot(mapping=aes(x=intersection, y=rating))
            # if you do not want to install ggbeeswarm, you can use geom_jitter
            + ggbeeswarm::geom_quasirandom(aes(color=log10(votes)))
            + geom_violin(width=1.1, alpha=0.5)
    ),
    queries=list(
        upset_query(
            intersect=c('Drama', 'Comedy'),
            color='red',
            fill='red',
            only_components=c('intersections_matrix', 'Intersection size')
        ),
        upset_query(
            set='Drama',
            fill='blue'
        ),
        upset_query(
            intersect=c('Romance', 'Drama'),
            fill='yellow',
            only_components=c('Length')
        )
    ),
    min_size=10,
    width_ratio=0.1
)

The full list of examples is available in the documentation; it also contains instructions for the use from Python.

Install

To get the most recent version, open R and run:

if(!require(devtools)) install.packages("devtools")
devtools::install_github("krassowski/complex-upset")

Alternatively, to get a stable CRAN release (which may be one version behind at times):

install.packages('ComplexUpset')

How it compares to other packages?

  • UpSetR is a powerful tool and the pioneer in the UpSet visualisations; it was not designed to be extended with ggplot components. Unfortunately, the repository is no longer active (for two years now).
  • ggupset uses scales to convert a single plot to upsets plots, e.g. with scale_x_upset - a really nice approach, recommended for simple ggplot.
  • a cowplot-based upset was demonstrated in an online publication, however cowplot (a great tool at the time) got superseded by even greater tool: patchwork, which is what is used by ComplexUpset.
  • ComplexHeatmap also offers a way to generate UpSet plots with annotations; while not ggplot2-centered, it provides extensive customization options, with a clear API. It may be the best choice if you already use it for heatmaps.

Use whichever tool you find the most useful for your particular use. The rational of making this repository public is not only to share the code, but also to demonstrate how simple it is now to create complex visualisations with patchwork (without the need to learn the ggplot internals).

For the interactive use, check out the VCG/upset. Regardless of the tool chosen, you may want to cite (Lex et al, 2014) when using UpSet plots, especially in fields still dominated by Venn diagrams.

Get inspired

Here are example publications and preprints including figures generated with this library:

The list is not meant to be exhaustive, but representative of applications to different fields, and of different usage ideas. You are welcome to add your own publication by suggesting an edit.

Testing

The unit tests are run with testhat, and the visual "doppelganger" tests use vdiffr.

The test cases for visual tests are auto-generated from the examples in the documentation; after changing or adding an example, please run:

  • scripts/prepare_for_tests.sh to generate updated test cases, and
  • scripts/manage_visual_tests.sh to validate the generated images.

Acknowledgments

Originally developed in course of a DPhil programme in Women's & Reproductive Health at OxfordNuffieldWRH.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].