Skip to contents

`from_upset_df_to_intersections()` transforms an upset compliant data frame into a data frame that details the intersections shared by the samples in the upset data frame. It produces a data frame with a column named `intersection`. If the intersection is shared between a set of samples, their column names occur in the character string in the `intersection` column. The other sample column names appear as 0s. The identity of the intersection is recorded in the row names.

Usage

from_upset_df_to_intersections(upset_df)

Arguments

upset_df

An upset compliant data frame.

Value

A data frame.

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)
from_upset_df_to_intersections(upset_df)
#>      intersection
#> a       sample1_0
#> b sample1_sample2
#> c sample1_sample2
#> d       0_sample2