AnnotationDb objects and their progeny, methods etc.

AnnotationDb is the virtual base class for all annotation packages. It contain a database connection and is meant to be the parent for a set of classes in the Bioconductor annotation packages. These classes will provide a means of dispatch for a widely available set of select methods and thus allow the easy extraction of data from the annotation packages.

select, columns and keys are used together to extract data from an AnnotationDb object (or any object derived from the parent class). Examples of classes derived from the AnnotationDb object include (but are not limited to): ChipDb, OrgDb GODb, InparanoidDb and ReactomeDb.

columns shows which kinds of data can be returned for the AnnotationDb object. keytypes allows the user to discover which keytypes can be passed in to select or keys and the keytype argument. keys returns keys for the database contained in the AnnotationDb object . This method is already documented in the keys manual page but is mentioned again here because it's usage with select is so intimate. By default it will return the primary keys for the database, but if used with the keytype argument, it will return the keys from that keytype. select will retrieve the data as a data.frame based on parameters for selected keys and columns and keytype arguments.

saveDb will take an AnnotationDb object and save the database to the file specified by the path passed in to the file argument. loadDb takes a .sqlite database file as an argument and uses data in the metadata table of that file to return an AnnotationDb style object of the appropriate type.

species shows the genus and species label currently attached to the AnnotationDb objects database.

classes, methods
columns(x) keytypes(x) keys(x, keytype, ...) select(x, keys, columns, keytype, ...) saveDb(x, file) loadDb(file, dbType, dbPackage, ...)
the AnnotationDb object. But in practice this will mean an object derived from an AnnotationDb object such as a OrgDb or ChipDb object.
the keys to select records for from the database. All possible keys are returned by using the keys method.
the columns or kinds of things that can be retrieved from the database. As with keys, all possible columns are returned by using the columns method.
the keytype that matches the keys used. For the select methods, this is used to indicate the kind of ID being used with the keys argument. For the keys method this is used to indicate which kind of keys are desired from keys
an sqlite file path. A string the represents the full name you want for your sqlite database and also where to put it.
dbType - not required
dbPackage - not required
other arguments. These include:
the pattern to match (used by keys)

the column to search on. This is used by keys and is for when the thing you want to pattern match is different from the keytype, or when you want to simply want to get keys that have a value for the thing specified by the column argument.

TRUE or FALSE value. Use fuzzy matching? (this is used with pattern by the keys method)


keys,columns and keytypes each return a character vector or possible values. select returns a data.frame.

See Also

keys, dbConnect, dbListTables, dbListFields, dbGetQuery, Bimap

  • AnnotationDb
  • class:AnnotationDb
  • AnnotationDb-class
  • ChipDb-class
  • GODb-class
  • InparanoidDb-class
  • OrgDb-class
  • ReactomeDb-class
  • loadDb
  • loadDb,character,character,character-method
  • loadDb,character,missing,missing-method
  • dbConn,AnnotationDb-method
  • saveDb
  • saveDb,AnnotationDb-method
  • show,AnnotationDb-method
  • metadata,AnnotationDb-method
  • names,AnnotationDb-method
  • species
  • species,AnnotationDb-method
  • cols
  • columns
  • columns,AnnotationDb-method
  • columns,OrgDb-method
  • columns,ChipDb-method
  • columns,GODb-method
  • columns,InparanoidDb-method
  • columns,Inparanoid8Db-method
  • columns,ReactomeDb-method
  • keytypes
  • keytypes,OrgDb-method
  • keytypes,ChipDb-method
  • keytypes,GODb-method
  • keytypes,InparanoidDb-method
  • keytypes,Inparanoid8Db-method
  • keytypes,ReactomeDb-method
  • keys
  • keys,OrgDb-method
  • keys,ChipDb-method
  • keys,GODb-method
  • keys,InparanoidDb-method
  • keys,Inparanoid8Db-method
  • keys,ReactomeDb-method
  • select
  • select,OrgDb-method
  • select,ChipDb-method
  • select,GODb-method
  • select,InparanoidDb-method
  • select,Inparanoid8Db-method
  • select,ReactomeDb-method
## display the columns
## get the 1st 6 possible keys
keys <- head( keys(hgu95av2.db) )
## lookup gene symbol and unigene ID for the 1st 6 keys
select(hgu95av2.db, keys=keys, columns = c("SYMBOL","UNIGENE"))

## get keys based on unigene
keyunis <- head( keys(hgu95av2.db, keytype="UNIGENE") )
## list supported key types
## lookup gene symbol and unigene ID based on unigene IDs by setting
## the keytype to "UNIGENE" and passing in unigene keys:
select(hgu95av2.db, keys=keyunis, columns = c("SYMBOL","UNIGENE"),

Documentation reproduced from package AnnotationDbi, version 1.28.2, License: Artistic-2.0

Community examples

Looks like there are no examples yet.