transcriptsByOverlaps {GenomicFeatures} | R Documentation

## Extract genomic features from a TxDb-like object based on their genomic location

### Description

Generic functions to extract genomic features for specified genomic locations. This page documents the methods for TxDb objects only.

### Usage

    transcriptsByOverlaps(x, ranges,
                          maxgap = -1L, minoverlap = 0L,
                          type = c("any", "start", "end"), ...)
    ## S4 method for signature 'TxDb'
    transcriptsByOverlaps(x, ranges,
                          maxgap = -1L, minoverlap = 0L,
                          type = c("any", "start", "end"),
                          columns = c("tx_id", "tx_name"))

    exonsByOverlaps(x, ranges,
                    maxgap = -1L, minoverlap = 0L,
                    type = c("any", "start", "end"), ...)
    ## S4 method for signature 'TxDb'
    exonsByOverlaps(x, ranges,
                    maxgap = -1L, minoverlap = 0L,
                    type = c("any", "start", "end"),
                    columns = "exon_id")

    cdsByOverlaps(x, ranges,
                  maxgap = -1L, minoverlap = 0L,
                  type = c("any", "start", "end"), ...)
    ## S4 method for signature 'TxDb'
    cdsByOverlaps(x, ranges,
                  maxgap = -1L, minoverlap = 0L,
                  type = c("any", "start", "end"),
                  columns = "cds_id")

### Arguments

`x` | A TxDb object.
`ranges` | A GRanges object to restrict the output.
`maxgap,minoverlap,type` | Used in the internal call to `findOverlaps()` to detect overlaps. See `?findOverlaps` in the IRanges package for a description of these arguments.
`...` | Arguments to be passed to or from methods.
`columns` | Columns to include in the output. See `?transcripts` for the possible values.

### Details

These functions subset the results of `transcripts`, `exons`, and `cds` function calls with using the results of `findOverlaps` calls based on the specified `ranges`.

### Value

a GRanges object

### Author(s)

P. Aboyoun

### See Also

- `transcripts` and `transcriptsBy` for more ways to extract genomic features from a TxDb-like object.

- `transcriptLengths` for extracting the transcript lengths (and other metrics) from a TxDb object.

- `exonicParts` and `intronicParts` for extracting non-overlapping exonic or intronic parts from a TxDb-like object.

- `extractTranscriptSeqs` for extracting transcript (or CDS) sequences from chromosome sequences.

- `coverageByTranscript` for computing coverage by transcript (or CDS) of a set of ranges.

- select-methods for how to use the simple "select" interface to extract information from a TxDb object.

- `id2name` for mapping TxDb internal ids to external names for a given feature type.

- The TxDb class.

### Examples

    txdb <- loadDb(system.file("extdata", "hg19_knownGene_sample.sqlite",
                               package="GenomicFeatures"))
    gr <- GRanges(Rle("chr1", 2),
                  IRanges(c(500,10500), c(10000,30000)),
                  strand = Rle("-", 2))
    transcriptsByOverlaps(txdb, gr)

[Package GenomicFeatures version 1.40.1 Index]