AnnDbObj-objects {AnnotationDbi}R Documentation

AnnDbObj objects

Description

The AnnDbObj class is the most general container for storing any kind of SQLite-based annotation data.

Details

Many classes in AnnotationDbi inherit directly or indirectly from the AnnDbObj class. One important particular case is the AnnDbBimap class which is the lowest class in the AnnDbObj hierarchy to also inherit the Bimap interface.

Accessor-like methods

In the code snippets below, x is an AnnDbObj object.

dbconn(x): Return a connection object to the SQLite DB containing x's data.
dbfile(x): Return the path (character string) to the SQLite DB (file) containing x's data.
dbmeta(x, name): Print the value of metadata whose name is 'name'. Also works if x is a DBIConnection object.
dbschema(x, file="", show.indices=FALSE): Print the schema definition of the SQLite DB. Also works if x is a DBIConnection object.

The file argument must be a connection, or a character string naming the file to print to (see the file argument of the cat function for the details).

The CREATE INDEX statements are not shown by default. Use show.indices=TRUE to get them.

dbInfo(x): Prints other information about the SQLite DB. Also works if x is a DBIConnection object.

See Also

dbConnect, dbListTables, dbListFields, dbGetQuery, Bimap

Examples

  library(hgu95av2.db)

  dbconn(hgu95av2ENTREZID)              # same as hgu95av2_dbconn()
  dbfile(hgu95av2ENTREZID)              # same as hgu95av2_dbfile()

  dbmeta(hgu95av2_dbconn(), "ORGANISM")
  dbmeta(hgu95av2_dbconn(), "DBSCHEMA")
  dbmeta(hgu95av2_dbconn(), "DBSCHEMAVERSION")

  dbListTables(hgu95av2_dbconn())
  dbListFields(hgu95av2_dbconn(), "probes")
  dbListFields(hgu95av2_dbconn(), "genes")
  dbschema(hgu95av2ENTREZID)            # same as hgu95av2_dbschema()
  ## According to the schema, the probes.id column references the genes.id
  ## column. Note that in all tables, the "id" column is an internal id with
  ## no biological meaning (provided for allowing efficient joins between
  ## tables).
  ## To retrieve the mapping between manufacturer IDs and Entrez Gene IDs:
  dbGetQuery(hgu95av2_dbconn(), "SELECT * FROM probes INNER JOIN genes USING (id) LIMIT 10")
  ## This mapping is in fact the ENTREZID map:
  toTable(hgu95av2ENTREZID)[1:10, ] # only relevant columns are retrieved

  dbInfo(hgu95av2GO)                    # same as hgu95av2_dbInfo()

[Package AnnotationDbi version 1.0.6 Index]