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).
biocann_object(to, from = NULL, optional = FALSE)
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."hgu133a.db"
.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
.a ProbeAnnDbBimap
if annotation is not
missing, a ProbeAnnDb
object otherwise.
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.
# db package object
biocann_object('hgu133a.db')
## ChipDb object:
## | DBSCHEMAVERSION: 2.1
## | Db type: ChipDb
## | Supporting package: AnnotationDbi
## | DBSCHEMA: HUMANCHIP_DB
## | ORGANISM: Homo sapiens
## | SPECIES: Human
## | MANUFACTURER: Affymetrix
## | CHIPNAME: Human Genome U133 Set
## | MANUFACTURERURL: http://www.affymetrix.com/support/technical/byproduct.affx?product=hgu133
## | EGSOURCEDATE: 2013-Mar5
## | EGSOURCENAME: Entrez Gene
## | EGSOURCEURL: ftp://ftp.ncbi.nlm.nih.gov/gene/DATA
## | CENTRALID: ENTREZID
## | TAXID: 9606
## | GOSOURCENAME: Gene Ontology
## | GOSOURCEURL: ftp://ftp.geneontology.org/pub/go/godatabase/archive/latest-lite/
## | GOSOURCEDATE: 20130302
## | GOEGSOURCEDATE: 2013-Mar5
## | GOEGSOURCENAME: Entrez Gene
## | GOEGSOURCEURL: ftp://ftp.ncbi.nlm.nih.gov/gene/DATA
## | KEGGSOURCENAME: KEGG GENOME
## | KEGGSOURCEURL: ftp://ftp.genome.jp/pub/kegg/genomes
## | KEGGSOURCEDATE: 2011-Mar15
## | GPSOURCENAME: UCSC Genome Bioinformatics (Homo sapiens)
## | GPSOURCEURL: ftp://hgdownload.cse.ucsc.edu/goldenPath/hg19
## | GPSOURCEDATE: 2010-Mar22
## | ENSOURCEDATE: 2013-Jan16
## | ENSOURCENAME: Ensembl
## | ENSOURCEURL: ftp://ftp.ensembl.org/pub/current_fasta
## | UPSOURCENAME: Uniprot
## | UPSOURCEURL: http://www.UniProt.org/
## | UPSOURCEDATE: Thu Mar 7 17:01:43 2013
# bimap from hgu133a probe id to ENTREZID
biocann_object('ENTREZID', 'hgu133a.db')
## ENTREZID map for chip hgu133a (object of class "ProbeAnnDbBimap")
# reversed bimap from UNIGENE to hgu133a probe id
biocann_object('hgu133a.db', 'UNIGENE')
## revmap(UNIGENE) map for chip hgu133a (object of class "ProbeAnnDbBimap")
# 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(hgu133a.db, 'UNIGENE')
## revmap(UNIGENE) map for chip hgu133a (object of class "ProbeAnnDbBimap")