Learn R Programming

GenomicFeatures (version 1.24.2)

select-methods: Using the "select" interface on TxDb objects

Description

select, columns and keys can be used together to extract data from a TxDb object.

Arguments

Details

In the code snippets below, x is a TxDb object.

[object Object],[object Object],[object Object],[object Object]

See Also

Examples

Run this code
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)

Run the code above in your browser using DataLab