The IdVector
class extends the Vector
class to implement a container that hold a vector of character identifiers.
Subclasses of IdVector
may be defined to enable method dispatch according to the nature of the identifiers (e.g., ENTREZ gene, Gene Ontology term).
IdVector(ids = character(0)) EntrezIdVector(ids) EnsemblIdVector(ids) GOIdVector(ids)
ids | character. Identifiers. |
---|
An IdVector
object.
ids
character. Identifiers.
Vector
,
EntrezIdVector
,
EnsemblIdVector
,
GOIdVector
# Constructor ---- iv <- IdVector(ids=head(LETTERS, 6)) mcols(iv) <- DataFrame(row.names = ids(iv), field1=runif(length(iv))) iv#> IdVector of length 6 with 6 unique identifiers #> Ids: A, B, C, D, ... #> Metadata: field1 (1 column)# Subsetting ---- iv[1:5]#> IdVector of length 5 with 5 unique identifiers #> Ids: A, B, C, D, ... #> Metadata: field1 (1 column)# Identifiers/Names ---- ids(iv)#> [1] "A" "B" "C" "D" "E" "F"names(iv)#> [1] "A" "B" "C" "D" "E" "F"# EntrezIdVector ---- library(org.Hs.eg.db) eiv <- EntrezIdVector(keys(org.Hs.eg.db, keytype="ENTREZID")) eiv#> EntrezIdVector of length 61217 with 61217 unique identifiers #> Ids: 1, 2, 3, 9, ...# EnsemblIdVector ---- library(org.Hs.eg.db) eiv <- EnsemblIdVector(keys(org.Hs.eg.db, keytype="ENSEMBL")) eiv#> EnsemblIdVector of length 29048 with 29048 unique identifiers #> Ids: ENSG00000121410, ENSG00000175899, ENSG00000256069, ENSG00000171428, ...#> GOIdVector of length 18177 with 18177 unique identifiers #> Ids: GO:0002576, GO:0003674, GO:0005576, GO:0005615, ...