Bimap-keymethods {AnnotationDbi}R Documentation

Methods for manipulating the keys of a Bimap object

Description

These methods are part of the Bimap interface.

They are devided in 3 groups: directed Bimap methods, undirected Bimap methods and subsetting Bimap methods. Unlike for undirected methods, the result of a directed method depends on the direction of the Bimap object (left-to-right or right-to-left, see direction for more details). The subsetting methods allow to extract a submap from a Bimap object by restricting the mapping to a subset of keys.

Usage

  ## Directed Bimap methods
  keys(x)
  #length(x)
  isNA(x)
  mappedkeys(x)
  count.mappedkeys(x)

  ## Undirected Bimap methods
  Lkeys(x)
  Rkeys(x)
  Llength(x)
  Rlength(x)
  mappedLkeys(x)
  mappedRkeys(x)
  count.mappedLkeys(x)
  count.mappedRkeys(x)

  ## Subsetting Bimap methods
  keys(x) <- value
  #x[i]
  Lkeys(x) <- value
  Rkeys(x) <- value
  subset(x, ...)

Arguments

x A Bimap object.
value A character vector containing the new keys (must be a subset of the current keys).
i Index specifying map elements to extract.
... Extra arguments can be:
Lkeys
The new Lkeys (must be a subset of the current Lkeys).
Rkeys
The new Rkeys (must be a subset of the current Rkeys).
objName
The name to give to the submap (only supported if x is an AnnDbBimap object).

Value

Author(s)

H. Pages

See Also

Bimap, BimapFormatting, AnnDbBimap-envirAPI

Examples

  library(hgu95av2.db)
  x <- hgu95av2GO
  x
  length(x)
  count.mappedkeys(x)
  x[1:3]
  links(x[1:3])

  ## Keep only mapped keys
  keys(x) <- mappedkeys(x)
  length(x)
  count.mappedkeys(x)
  x # now it is a submap

  ## The above can be achieved with
  x <- hgu95av2GO[mappedkeys(hgu95av2GO)]

  ## mappedkeys() and count.mappedkeys() also work with an environment
  ## or a list
  z <- list(k1=NA, k2=letters[1:4], k3="x")
  mappedkeys(z)
  count.mappedkeys(z)

[Package AnnotationDbi version 1.0.6 Index]