The Sets class implements a container to describe distinct objects that make up sets, along with element metadata and set metadata.

Sets(relations = DataFrame(element = character(0), set = character(0)),
  elementInfo, setInfo)

Arguments

relations

DataFrame. At least two columns that provide mapping relationships between "element" and "set" identifiers. Additional columns are taken as relation metadata.

elementInfo

IdVector. Metadata for each unique identifier in relations$element is provided as mcols(elementInfo).

setInfo

IdVector. Metadata for each unique identifier in relations$set is provided as mcols(setInfo).

Value

A Sets object.

Slots

relations

Hits The left node and right node of each hit stores the index of the element and set in elementInfo and setInfo, respectively. Metadata for each relation is stored as mcols(relations(object)).

elementInfo

IdVector. Metadata for each unique element in relations$element is stored as mcols(elementInfo).

setInfo

IdVector. Metadata for each unique set in relations$set is stored as mcols(setInfo).

See also

Examples

# Constructor ---- # Visually intuitive definition of sets sets <- list( set1=c("A", "B"), set2=c("B", "C", "D"), set3=c("E")) bs <- as(sets, "Sets") bs
#> Sets with 6 relations between 5 elements and 3 sets #> element set #> <character> <character> #> [1] A set1 #> [2] B set1 #> [3] B set2 #> [4] C set2 #> [5] D set2 #> [6] E set3 #> ----------- #> elementInfo: IdVector with 0 metadata #> setInfo: IdVector with 0 metadata
# Coercing ---- # to list (gene sets) ls1 <- as(bs, "list") ls1
#> List of length 3 #> names(3): set1 set2 set3
# to matrix (logical membership) m1 <- as(bs, "matrix") m1
#> set1 set2 set3 #> A TRUE FALSE FALSE #> B TRUE TRUE FALSE #> C FALSE TRUE FALSE #> D FALSE TRUE FALSE #> E FALSE FALSE TRUE
# Accessors ---- relations(bs)
#> Hits object with 6 hits and 0 metadata columns: #> from to #> <integer> <integer> #> [1] 1 1 #> [2] 2 1 #> [3] 2 2 #> [4] 3 2 #> [5] 4 2 #> [6] 5 3 #> ------- #> nLnode: 5 / nRnode: 3
#> IdVector of length 5 with 5 unique identifiers #> Ids: A, B, C, D, ... #> Metadata: (0 columns)
#> IdVector of length 3 with 3 unique identifiers #> Ids: set1, set2, set3 #> Metadata: (0 columns)
# Dimensions ---- length(bs)
#> [1] 6
#> [1] 5
nSets(bs)
#> [1] 3
#> set1 set2 set3 #> 2 3 1
#> A B C D E #> 1 2 1 1 1