| OrganismDb-class {OrganismDbi} | R Documentation |
The OrganismDb class is a container for storing knowledge about existing Annotation packages and the relationships between these resources. The purpose of this object and it's associated methods is to provide a means by which users can conveniently query for data from several different annotation resources at the same time using a familiar interface.
The supporting methods select, columns and keys are
used together to extract data from an OrganismDb
object in a manner that should be consistent with how these are used
on the supporting annotation resources.
The family of seqinfo style getters (seqinfo,
seqlevels, seqlengths, isCircular, genome,
and seqnameStyle) is also supported for OrganismDb objects
provided that the object in question has an embedded TxDb
object.
In the code snippets below, x is a OrganismDb object. For the
metadata and show methods, there is also support for FeatureDb objects.
keytypes(x):
allows the user to discover which keytypes can be passed in to
select or keys and the keytype argument.
keys(x, keytype, pattern, column, fuzzy): Return keys for
the database contained in the TxDb object .
The keytype argument specifies the kind of keys that will
be returned and is always required.
If keys is used with pattern, it will pattern match
on the keytype.
But if the column argument is also provided along with the
pattern argument, then pattern will be matched
against the values in column instead.
If keys is called with column and no pattern
argument, then it will return all keys that have corresponding
values in the column argument.
Thus, the behavior of keys all depends on how many arguments are
specified.
Use of the fuzzy argument will toggle fuzzy matching to
TRUE or FALSE. If pattern is not used, fuzzy is ignored.
columns(x):
shows which kinds of data can be returned for the
OrganismDb object.
select(x, keys, columns, keytype):
When all the appropriate arguments are specifiedm select
will retrieve the matching data as a data.frame based on
parameters for selected keys and columns and
keytype arguments.
Marc Carlson
AnnotationDb-class for more descriptsion
of methods select,keytypes,keys and columns.
makeOrganismPackage for functions
used to generate an OrganismDb based package.
rangeBasedAccessors for the range based methods
used in extracting data from a OrganismDb object.
genome .
## load a package that creates an OrganismDb library(Homo.sapiens) ls(2) ## then the methods can be used on this object. columns <- columns(Homo.sapiens)[c(7,10,11,12)] keys <- head(keys(org.Hs.eg.db, "ENTREZID")) keytype <- "ENTREZID" res <- select(Homo.sapiens, keys, columns, keytype) head(res) ## Get the DB connections or DB file paths associated with those for ## each. dbconn(Homo.sapiens) dbfile(Homo.sapiens)