When to Use
- Differential expression overlap: Show genes called significant by multiple methods (DESeq2, edgeR, limma)
- Variant calling concordance: Compare SNPs/indels detected by GATK, FreeBayes, Strelka
- Drug response: Identify compounds effective across multiple cell lines
- Pathway enrichment: Show overlap of enriched pathways across conditions
- Any set intersection: When Venn diagrams become cluttered (>3 sets)
- Set cardinality: When exact counts matter more than spatial overlap
Basic Example
Input Modes
Raw Sets: with_sets
Provide (name, elements) pairs. Intersection counts computed automatically.
Eq + Hash (strings, integers, gene IDs, etc.). Intersection counts follow bitmask semantics: an element in sets A and C but not B is counted under A∩C — not A, not C, not A∩B∩C.
Precomputed: with_data
Provide set names, total sizes, and (mask, count) pairs directly.
i of mask set means set_names[i] participates. Use when intersection counts come from external source (database, enrichment tool).
Key Methods
Sorting
with_sort(sort: UpSetSort)
Set intersection ordering (default ByFrequency).
UpSetSort::ByFrequency(default) — Largest count leftmostUpSetSort::ByDegree— Most complex (most sets) leftmost, ties broken by countUpSetSort::Natural— Preserve supplied order
with_max_visible(max: usize)
Show only top max intersections after sorting.
Styling
without_set_sizes()
Hide horizontal set-size bars on left panel.
with_bar_color(color: impl Into<String>)
Set color for intersection bars and set-size bars (default "#333333").
with_dot_color(color: impl Into<String>)
Set fill color for dots in participating set (default "#333333").
Examples
Differential Expression Overlap
Variant Calling Concordance (Precomputed)
By Degree Sorting
Compact Layout (No Set Sizes)
Visual Components
Intersection Size Bars (Top)
Vertical bars show element count for each intersection. Height encodes count.Dot Matrix (Middle)
Grid of circles where:- Filled dots indicate set participates in intersection
- Empty dots (light gray) indicate set does not participate
- Vertical line connects filled dots in same intersection
Set Size Bars (Left, Optional)
Horizontal bars show total element count per set. Enabled by default; hide withwithout_set_sizes().
Pixel-Space Rendering
UpSet plots render entirely in pixel space — no standard x/y axis system.Layout::auto_from_plots skips axis computation for UpSet plots. Title set on Layout is still rendered.
See Also
- [Venn diagrams] — For 2–3 sets with spatial overlap
- Heatmap — For pairwise set similarity matrices