AnnotatedIDs-class: AnnotatedIDs

Description Usage Arguments Details Value Accessors Subsetting Concatenation Comparing & Ordering Author(s) See Also Examples

Description

The AnnotatedIDs class is a simple container that wraps an ordinary vector in a Vector object. This allows attaching metadata columns to it.

Usage

1
2
## Constructor function
AnnotatedIDs(IDs=integer(0), ...)

Arguments

IDs

An ordinary vector.

...

Optional metadata columns to attach to the returned AnnotatedIDs object.

Details

TODO

Value

An AnnotatedIDs object.

Accessors

Because AnnotatedIDs objects are Vector derivatives (i.e. AnnotatedIDs is a subclass of the Vector class defined in the S4Vectors package), they support the same set of accessors as Vector objects e.g. the length(), names(), and mcols() getters, or the names() and mcols() setters.

Subsetting

An AnnotatedIDs object can be subsetted with [, like any vector-like object.

Concatenation

Two or more AnnotatedIDs objects can be concatenated with c(). Note that this returns an AnnotatedIDs object of length the sum of the objects to concatenate.

Comparing & Ordering

Comparison operations between AnnotatedIDs objects (e.g. with ==, !=, <=, <, match()) behave consistently with comparison of the ID objects that are wrapped in the AnnotatedIDs objects to compare (and that can be obtained with ID()). More precisely, comparing AnnotatedIDs objects x and y is equivalent to comparing ID(x) and ID(y).

order()), sort()), and rank() do the same thing.

Author(s)

Hervé Pagès

See Also

Examples

1
2
3
4
5
6
7
8
9
showClass("AnnotatedIDs")  # AnnotatedIDs extends Vector

aids <- AnnotatedIDs(IDs=letters, score=runif(26))
aids

length(aids)
mcols(aids)

ID(aids)

hpages/graph2 documentation built on March 14, 2021, 4:47 p.m.