mapRangesToIds {GenomicFeatures} | R Documentation

## Map Genomic Ranges to IDs

### Description

Map Genomic Ranges to IDs

### Usage

    mapRangesToIds(x, ...)

    ## S4 method for signature 'TxDb'
    mapRangesToIds(x, ranges, type = c("cds", "exon", "tx",
      "gene"), columns = NULL, ...)

### Arguments

`x` | Database to use for mapping
`ranges` | range object used to subset
`type` | of feature to return
`columns` | additional metadata columns to include in the output.
`...` | Additional arguments passed to `findOverlaps`

### Value

`DataFrame` of mcols from the database.

### Methods (by class)

- `TxDb`: TxDb method

### Examples

    fl <- system.file(package = "GenomicFeatures", "extdata", "sample_ranges.rds")
    txdb <- makeTxDbFromGRanges(readRDS(fl))

    keys <- list(tx_name = c("ENST00000371582", "ENST00000371588",
        "ENST00000494752", "ENST00000614008", "ENST00000496771"))
    res <- mapIdsToRanges(txdb, keys = keys, type = "tx")
    mapRangesToIds(txdb, res, "tx")

[Package GenomicFeatures version 1.46.5 Index]