Skip to contents

Display an UpSet chart of labels in the specified column of an annotation_source.

Usage

annotation_upset_chart(
  factor_name,
  group_column = NULL,
  width_ratio = 0.2,
  xlabel = "group",
  sort_intersections = "descending",
  intersections = "observed",
  n_intersections = NULL,
  min_size = 0,
  queries = list(),
  keep_empty_groups = FALSE,
  ...
)

Arguments

factor_name

(character) The name of the column(s) in the annotation_source(s) to generate an UpSet chart from.

group_column

(character, NULL) The name of the column in the annotation_source to create groups from in the Venn diagram. This parameter is ignored if there are multiple input tables, as each table is considered to be a group. This parameter is also ignored if more than one factor_name is provided, as each column is considered a group. The default is NULL.

width_ratio

(numeric) Proportion of plot given to set size bar chart. The default is 0.2.

xlabel

(character) The label used for the x-axis. The default is "group".

sort_intersections

(character) Sort intersections. Allowed values are limited to the following:

  • "ascending": Groups are sorted by increasing size.

  • "descending": Groups are sorted by decreasing size.

  • "none": Groups are not sorted.

The default is "descending".

intersections

(character, list) The intersections to include in the plot. The default is "observed".

n_intersections

(numeric, integer, NULL) The number of intersections to include in the plot. The default is NULL.

min_size

(numeric, integer) The minimum size of an intersection for it to be included in the plot. The default is 0.

queries

(list) A list of upset queries. The default is list().

keep_empty_groups

(logical) Whether empty sets should be kept (including sets which are only empty after filtering by size). The default is FALSE.

...

Additional slots and values passed to struct_class.

Value

A annotation_upset_chart object. This object has no output slots. See chart_plot in the struct package to plot this chart object.

Details

This object makes use of functionality from the following packages:

  • ComplexUpset

Inheritance

A annotation_upset_chart object inherits the following struct classes:

[annotation_upset_chart] -> [chart] -> [struct_class]

References

Krassowski M (2020). "ComplexUpset." doi:10.5281/zenodo.3700590 https://doi.org/10.5281/zenodo.3700590, https://doi.org/10.5281/zenodo.3700590.

Lex A, Gehlenborg N, Strobelt H, Vuillemot R, Pfister H (2014). "UpSet: Visualization of Intersecting Sets,." IEEE Transactions on Visualization and Computer Graphics, 20(12), 1983–1992. doi:10.1109/TVCG.2014.2346248 https://doi.org/10.1109/TVCG.2014.2346248, https://doi.org/10.1109/TVCG.2014.2346248.

Examples

M <- annotation_upset_chart(
        factor_name = "V1",
        group_column = NULL,
        width_ratio = 0.2,
        xlabel = "group",
        sort_intersections = "descending",
        intersections = "observed",
        n_intersections = NULL,
        min_size = 0,
        queries = list(),
        keep_empty_groups = FALSE)