Sets-class: Sets Class

Description Usage Arguments Value Slots Author(s) See Also Examples

Description

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

Usage

1
2
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).

Author(s)

Kevin Rue-Albrecht

See Also

Sets-methods.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# 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

# Coercing ----

# to list (gene sets)
ls1 <- as(bs, "list")
ls1
# to matrix (logical membership)
m1 <- as(bs, "matrix")
m1

# Accessors ----

relations(bs)
elementInfo(bs)
setInfo(bs)

# Dimensions ----

length(bs)
nElements(bs)
nSets(bs)

setLengths(bs)
elementLengths(bs)

kevinrue/unisets documentation built on May 15, 2020, 10:48 p.m.