Description Details Author(s) See Also Examples
select
, columns
and keys
can be used together to
extract data from a TxDb object.
In the code snippets below, x
is a TxDb object.
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. By default keys
will return the "GENEID" keys
for the database.
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.
And 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)
:
Show which kinds of data can be returned for the
TxDb object.
select(x, keys, columns, keytype)
:
When all the appropriate arguments are specified 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
.
transcripts
, transcriptsBy
,
and transcriptsByOverlaps
, for other ways to
extract genomic features from a TxDb object.
The TxDb class.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | txdb_file <- system.file("extdata", "Biomart_Ensembl_sample.sqlite",
package="GenomicFeatures")
txdb <- loadDb(txdb_file)
txdb
## find key types
keytypes(txdb)
## list IDs that can be used to filter
head(keys(txdb, "GENEID"))
head(keys(txdb, "TXID"))
head(keys(txdb, "TXNAME"))
## list columns that can be returned by select
columns(txdb)
## call select
res <- select(txdb, head(keys(txdb, "GENEID")),
columns=c("GENEID","TXNAME"),
keytype="GENEID")
head(res)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.