Skip to contents

`from_upset_df_to_intersection_members()` produces a named list where each item in the list a vector of the items that make up an intersection. The names of each item in the list are concatenations of sample names (built from `colnames(upset_df)`). If the sample name occurs in the name, the members in the vectors were observed in that sample name. Zeroes (`0`) are used as place holders for samples that don't have a given member.

Usage

from_upset_df_to_intersection_members(upset_df)

Arguments

upset_df

An upset compliant data frame.

Value

A list.

Examples

sample1 <- c("a", "b", "c")
sample2 <- c("b", "c", "d")
upset_list <- list(sample1 = sample1, sample2 = sample2)
upset_df <- from_list_to_upset_df(upset_list)
lst <- from_upset_df_to_intersection_members(upset_df)
# to pull out values from the list, index into the list using any of the intersection names.
lst[["sample1_sample2"]] # identity of values shared by sample1 and sample2
#> [1] "b" "c"
lst["sample1_0"] # identity of values that occurred in only sample1
#> $sample1_0
#> [1] "a"
#>