biocann_object: Retrieving Bioconductor Annotation Maps

Description Usage Arguments Details Value Examples

View source: R/db-packages.R

Description

The function biocann_object retrieves annotation objects, like bimaps, from Bioconductor annotation packages. It is similar to the function getAnnMap from the annotate package, except that it also accepts annotation – bimap – objects, and will try to install missing packages if not found (see section Details).

Usage

1
biocann_object(to, from = NULL, optional = FALSE)

Arguments

to

target annotation field as a character string, e.g., “ENTREZID”, “ENSEMBL”, or an annotation package or db which means that one wants to retrieve a mapping to its corresponding primary identifier. If from is missing, to must be the name of an annotation package, i.e. ends with “db”), in which case it tries loading the package and return the whole annotation db object; or any annotation package db or map object such as AnnDbBimap, ChipDb or OrgDb objects, which are returned unchanged.

from

source annotation package as a character string e.g. "hgu133a.db".

optional

logical that indicates if the function should return NULL if the mapping cannot be found (TRUE), or throw an error. Note that this does not apply to the installation part: if a required annotation package is missing, an error is thrown even if optional=TRUE.

Details

If an annotation package is specified as a character string, and is not found in the search path, and if R runs in interactive mode, then the user is asked whether one should try install the missing package. Default response is 'yes' so that simply hitting return will install the package via install.packages and load it. An error is thrown if this eventually fails.

Value

a ProbeAnnDbBimap if annotation is not missing, a ProbeAnnDb object otherwise.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# db package object
biocann_object('hgu133plus2.db')

# bimap from hgu133plus2 probe id to ENTREZID 
biocann_object('ENTREZID', 'hgu133plus2.db')

# reversed bimap from UNIGENE to hgu133plus2 probe id
biocann_object('hgu133plus2.db', 'UNIGENE')
# this is equivalent to using the annotation package object (no quotes),
# when the package is already loaded (=> helpful in interactive session with auto-completion)
biocann_object(hgu133plus2.db, 'UNIGENE')

renozao/xbioc documentation built on Sept. 3, 2020, 1:13 a.m.