Get annotation database or environment

get_anno_db(
  x,
  revmap_suffix = c("2EG", "2ENTREZID", "2NAME"),
  ignore.case = FALSE,
  verbose = FALSE,
  ...
)

Arguments

x

character name of an annotation object, or an annotation object itself.

revmap_suffix

character string indicting the expected suffix that can be used to create reverse-mapped annotation data, for example the suffix "2EG" is used to indicate that annotation returns Entrez gene. When annotation does not contain this suffix, the annotation is reverse-mapped using AnnotationDbi::revmap().

ignore.case

logical indicating whether to return an environment after converting all keys to lowercase, which is one implementation choice to provide case-insensitive output while using standard mget(). This option may not be ideal, see description for defailts. In order to fulfill the potential, the subsequent mget() must also use tolower(x) on the input character vector. Note that this option is currently fairly slow, and uses more memory while the environment is loaded.

verbose

logical indicating whetheer to print verbose output.

...

additional arguments are ignored.

Details

This function is a simple wrapper function that takes either an annotation data name, for example from the AnnotationDbi package, or an annotation object, and returns the annotation object.

In the event the annotation object must be derived using AnnotationDbi::revmap(), then that process is performed, and the reverse mapped annotation object is returned.

When invoking with argument ignore.case=TRUE, this function returns keys that have been converted to lowercase. The process can be fairly slow (~5 seconds per human genome annotation), but results in an annotation that can be used directly and may be faster for repeated use than calling imget().

The alternative to ignore.case=TRUE is to call imget() for direct query of an annotation, or call freshenGenes(..., ignore.case=TRUE) which will call imget() internally. In our benchmark tests, using imget() appears to add roughly 0.1 seconds per query, regardless of the number of input entries. This appears to be the time it takes to spool the list of annotation keys stored in the SQLite database, and may therefore be dependent upon the size of the annotation file.

See also