MeSHDb: MeSHDb objects

Description Usage Arguments Value Author(s) See Also Examples

View source: R/AllClasses.R

Description

MeSHDb is the simple class for providing the relationship between Entrez gene IDs and MeSH IDs. It provides the database connection and easily accessible with columns, keytypes, keys and select. Some users may use additional functions such as dbconn, dbfile, dbschema, dbInfo, and species for much complex data acquisition.

columns shows which kinds of data can be returned for the MeSHDb 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 MeSHDb 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, columns, and keytype arguments.

dbconn returns the connection with database in the package.

dbfile returns the absolute path sqlite file is saved.

dbschema returns the database schema.

dbInfo returns the many meta information about the package.

species returns the species name.

Usage

1
2
3
4
5
6
7
8
9
  columns(x)
  keytypes(x)
  keys(x, keytype, ...)
  select(x, keys, columns, keytype, ...)
  dbconn(x)
  dbfile(x)
  dbschema(x, file = "", show.indices = FALSE)
  dbInfo(x)
  species(object)

Arguments

x

the MeSHDb object. But in practice this will mean an object derived from an MeSHDb object such as a MeSH.Hsa.eg.db, MeSH.Mmu.eg.db or many other MeSH.XXX.eg.db (XXX means abbreviation of species name).

object

same as x

keys

the keys to select records for from the database. All possible keys are returned by using the keys method.

columns

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.

keytype

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

...

other arguments.

file

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).

show.indices

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

Value

keys, columns, keytypes, dbfile, dbInfo, and species each return a character vector or possible values. select and dbschema each return a data.frame. dbconn returns database connection.

Author(s)

Koki Tsuyuzaki

See Also

dbConnect

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# # load a package that creates an MeSHDb object
# library(MeSH.Mmu.eg.db)
# MeSH.Mmu.eg.db

# ## then the methods can be used on this object.
# cls <- columns(MeSH.Mmu.eg.db)
# cls
# kts <- keytypes(MeSH.Mmu.eg.db)
# kt <- kts[2]
# kts
# ks <- head(keys(MeSH.Mmu.eg.db, keytype=kts[2]))
# ks
# res <- select(MeSH.Mmu.eg.db, keys=ks, columns=cls, keytype=kt)
# head(res)

# dbconn(MeSH.Mmu.eg.db)
# dbfile(MeSH.Mmu.eg.db)
# dbschema(MeSH.Mmu.eg.db)
# dbInfo(MeSH.Mmu.eg.db)
# species(MeSH.Mmu.eg.db)

MeSHDbi documentation built on Nov. 8, 2020, 5:05 p.m.