This function adds a column denoting set number to a matrix generated for an upset plot with fromList.with.names()
Examples
# list of genes
lst <- list(group1 = c(a = "gene1", b = "gene2", c = "gene3", d = "gene4"),
group2 = c(c = "gene3", d = "gene4"))
# binarized matrix with group membership
df <- fromList.with.names(lst)
# matrix with added set column
ldf <- add.set.column(df)