Skip to contents

Quickstart

Five steps to your first Venn diagram with vennDiagramLab.

1. Load the package

2. Pick a bundled sample

The package ships five sample datasets (3 biological, 2 mock).

list_samples()
#> [1] "dataset_mock_gene_sets"              "dataset_mock_streaming_platforms"   
#> [3] "dataset_real_cancer_drivers_4"       "dataset_real_msigdb_cancer_pathways"
#> [5] "dataset_real_msigdb_immune_pathways"

3. Load it as a VennDataset

load_sample() returns an S4 VennDataset with deduplicated set members and first-seen item ordering (matching the web tool’s CSV semantics).

ds <- load_sample("dataset_real_cancer_drivers_4")
ds@set_names
#> [1] "Vogelstein" "COSMIC_CGC" "OncoKB"     "IntOGen"
vapply(ds@items, length, integer(1L))   # set sizes
#> Vogelstein COSMIC_CGC     OncoKB    IntOGen 
#>        138        581       1231        633

4. Analyze

analyze() resolves the model, enumerates regions, and returns a RegionResult. With model = "auto" (the default), it picks the canonical SVG model for the dataset’s set count.

result <- analyze(ds)
result@model
#> [1] "venn-4-set"
length(result@regions)   # number of non-empty regions
#> [1] 15

5. Render

svg <- render_venn_svg(result)
nchar(svg)        # SVG length in bytes
#> [1] 6464
substr(svg, 1, 80)
#> [1] "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- Created by Zoltan Dul in 2026 - free"

To save the SVG:

writeLines(svg, "cancer_drivers.svg")

What’s next