RangedSelection-class {IRanges} | R Documentation

## Selection of ranges and columns

### Description

A `RangedSelection` represents a query against a table of interval data in terms of ranges and column names. The ranges select any table row with an overlapping interval. Note that the intervals are always returned, even if no columns are selected.

### Details

Traditionally, tabular data structures have supported the `subset` function, which allows one to select a subset of the rows and columns from the table. In that case, the rows and columns are specified by two separate arguments. As querying interval data sources, especially those external to R, such as binary indexed files and databases, is increasingly common, there is a need to encapsulate the row and column specifications into a single data structure, mostly for the sake of interface cleanliness. The `RangedSelection` class fills that role.

### Constructor

  `RangedSelection(ranges=IRangesList(), colnames = character())`: Constructors a `RangedSelection` with the given `ranges` and `colnames`.

### Coercion

  `as(from, "RangedSelection")`: Coerces `from` to a `RangedSelection` object. Typically, `from` is a `IntegerRangesList`, the ranges of which become the ranges in the new `RangedSelection`.

### Accessors

In the code snippets below, `x` is always a `RangedSelection`.

  `ranges(x), ranges(x) <- value`: Gets or sets the ranges, a `IntegerRangesList`, that select rows with overlapping intervals.

  `colnames(x), colnames(x) <- value`: Gets the names, a `character` vector, indicating the columns.

### Author(s)

Michael Lawrence

### Examples

      rl <- IRangesList(chr1 = IRanges(c(1, 5), c(3, 6)))

      RangedSelection(rl)
      as(rl, "RangedSelection") # same as above

      RangedSelection(rl, "score")

[Package IRanges version 2.26.0 Index]