Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

range-squeezers

Squeeze the ranges out of a range-based object


Description

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

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

Usage

ranges(x, use.names=TRUE, use.mcols=FALSE, ...)
rglist(x, use.names=TRUE, use.mcols=FALSE, ...)

Arguments

x

An object containing ranges e.g. a IntegerRanges, GenomicRanges, RangedSummarizedExperiment, GAlignments, GAlignmentPairs, or GAlignmentsList object, or a Pairs object containing ranges.

use.names

TRUE (the default) or FALSE. Whether or not the names on x (accessible with names(x)) should be propagated to the returned object.

use.mcols

TRUE or FALSE (the default). Whether or not the metadata columns on x (accessible with mcols(x)) should be propagated to the returned object.

...

Additional arguments, for use in specific methods.

Details

Various packages (e.g. IRanges, GenomicRanges, SummarizedExperiment, GenomicAlignments, etc...) define and document various range squeezing methods for various types of objects.

Note that these functions can be seen as object getters or as functions performing coercion.

For some objects (e.g. GAlignments and GAlignmentPairs objects defined in the GenomicAlignments package), as(x, "IRanges") and as(x, "IRangesList"), are equivalent to ranges(x, use.names=TRUE, use.mcols=TRUE) and rglist(x, use.names=TRUE, use.mcols=TRUE), respectively.

Value

An IRanges object for ranges.

An IRangesList object for rglist.

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

Examples

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

IRanges

Foundation of integer range manipulation in Bioconductor

v2.24.1
Artistic-2.0
Authors
H. Pagès, P. Aboyoun and M. Lawrence
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.