Skip to contents

Produce an UpSet plot showing unique values from a given column

Usage

upsetVarByCol(
  gr,
  var,
  alt_col = "ALT",
  mcol = "transcript_id",
  ...,
  intersection_args = list(),
  intersection_lab = "Intersection Size",
  set_geom = geom_bar(width = 0.6),
  set_expand = 0.2,
  set_counts = TRUE,
  hjust_counts = 1.1,
  set_lab = "Set Size",
  title
)

Arguments

gr

GRanges object with ranges representing a key feature such as exons

var

GRanges object with variants in a given column

alt_col

Column within var containing the alternate allele

mcol

The column within gr to summarise results by

...

Passed to ComplexUpset::upset

intersection_args

See ComplexUpset::intersection_size for possible values

intersection_lab

Y-axis label for the intersection panel

set_geom

Passed to ComplexUpset::upset_set_size

set_expand

Expand the set-size axis by this amount

set_counts

logical(1) Show counts on set sizes

hjust_counts

Horizontal adjustment of counts, if being shown

set_lab

X-axis label for the set-sizes panel

title

Summary title to show above the intersection panel. Can be hidden by setting to NULL

Value

An UpSet plot

Details

Take a set of variants, classify them as SNV, Insertion and Deletion, then using a GRanges object, produce an UpSet plot showing impacted values from a given column

Examples

library(rtracklayer)
library(VariantAnnotation)
gtf <- import.gff(
    system.file("extdata/gencode.v44.subset.gtf.gz", package = "transmogR"),
    feature.type = "exon"
)
vcf <- system.file("extdata/1000GP_subset.vcf.gz", package = "transmogR")
var <- rowRanges(readVcf(vcf, param = ScanVcfParam(fixed = "ALT")))
upsetVarByCol(gtf, var)