genomic-range-squeezers {GenomicRanges} | R Documentation

## Squeeze the genomic ranges out of a range-based object

### Description

S4 generic functions for squeezing the genomic ranges out of a range-based object.

These are analog to range squeezers `ranges` and `rglist` defined in the IRanges package, except that `granges` returns the ranges in a GRanges object (instead of an IRanges object for `ranges`), and `grglist` returns them in a GRangesList object (instead of an IRangesList object for `rglist`).

### Usage

    granges(x, use.names=TRUE, use.mcols=FALSE, ...)
    grglist(x, use.names=TRUE, use.mcols=FALSE, ...)

### Arguments

`x` | An object containing genomic ranges e.g. a GenomicRanges, RangedSummarizedExperiment, GAlignments, GAlignmentPairs, or GAlignmentsList object, or a Pairs object containing genomic ranges.
`use.names, use.mcols, ...` | See `ranges` in the IRanges package for a description of these arguments.

### Details

See `ranges` in the IRanges package for some details.

For some objects (e.g. GAlignments and GAlignmentPairs objects defined in the GenomicAlignments package), `as(x, "GRanges")` and `as(x, "GRangesList")`, are equivalent to `granges(x, use.names=TRUE, use.mcols=TRUE)` and `grglist(x, use.names=TRUE, use.mcols=TRUE)`, respectively.

### Value

A GRanges object for `granges`.

A GRangesList object for `grglist`.

If `x` is a vector-like object (e.g. GAlignments), the returned object is expected to be parallel to `x`, that is, the i-th element in the output corresponds to the i-th element in the input.

If `use.names` is TRUE, then the names on `x` (if any) are propagated to the returned object. If `use.mcols` is TRUE, then the metadata columns on `x` (if any) are propagated to the returned object.

### Author(s)

H. Pagès

### See Also

- GRanges and GRangesList objects.

- RangedSummarizedExperiment objects in the SummarizedExperiment packages.

- GAlignments, GAlignmentPairs, and GAlignmentsList objects in the GenomicAlignments package.

### Examples

    ## See ?GAlignments in the GenomicAlignments package for examples of
    ## "ranges" and "rglist" methods.

[Package GenomicRanges version 1.32.7 Index]