Learn R Programming

IRanges (version 2.6.0)

GappedRanges-class: GappedRanges objects

Description

WARNING: GappedRanges objects are deprecated!

The GappedRanges class is a vector-like container for storing a set of "gapped ranges".

Arguments

Constructor

No constructor function is provided for GappedRanges objects. The coercion methods described below can be used to create GappedRanges objects.

Details

A "gapped range" is conceptually the union of 1 or more non-overlapping (and non-empty) ranges ordered from left to right. More precisely, a "gapped range" can be represented by a normal IRanges object of length >= 1. In particular normality here ensures that the individual ranges are non-empty and are separated by non-empty gaps. The start of a "gapped range" is the start of its first range. The end of a "gapped range" is the end of its last range. If we ignore the gaps, then a GappedRanges object can be seen as a Ranges object.

See Also

Ranges-class, CompressedNormalIRangesList-class

Examples

Run this code
## WARNING: GappedRanges objects are deprecated!

## The 3 following IRanges objects are normal. Each of them will be
  ## stored as a "gapped range" in the GappedRanges object 'gr'.
  ir1 <- IRanges(start=c(11, 21, 23), end=c(15, 21, 30))
  ir2 <- IRanges(start=-2, end=15)
  ir3 <- IRanges(start=c(-2, 21), end=c(10, 22))
  irl <- IRangesList(ir1, ir2, ir3)

  gr <- as(irl, "GappedRanges")
  gr

  length(gr)
  start(gr)
  end(gr)
  width(gr)
  ngap(gr)
  gr[-1]
  gr[ngap(gr) >= 1]
  gr[[1]]
  as.integer(gr[[1]])
  gr[[2]]
  as.integer(gr[[2]])
  as(gr, "RangesList")
  start(as(gr, "RangesList"))  # not the same as 'start(gr)'

Run the code above in your browser using DataLab