| IRangesList-class {IRanges} | R Documentation |
List of IRanges and NormalIRanges
Description
IRangesList and
NormalIRangesList objects for storing
IRanges and NormalIRanges objects
respectively.
Constructor
IRangesList(..., compress=TRUE):-
The
...argument accepts either a comma-separated list ofIRangesobjects, or a singleLogicalList/ logicalRleListobject, or 2 elements namedstartandendeach of them being either a list of integer vectors or an IntegerList object. WhenIRangesobjects are supplied, each of them becomes an element in the newIRangesList, in the same order, which is analogous to thelistconstructor. Ifcompress, the internal storage of the data is compressed.
Coercion
In the code snippets below, from is a list-like object.
as(from, "SimpleIRangesList"):Coerces
from, to aSimpleIRangesList, requiring that allIntegerRangeselements are coerced to internalIRangeselements. This is a convenient way to ensure that allIntegerRangeshave been imported into R (and that there is no unwanted overhead when accessing them).as(from, "CompressedIRangesList"):Coerces
from, to aCompressedIRangesList, requiring that allIntegerRangeselements are coerced to internalIRangeselements. This is a convenient way to ensure that allIntegerRangeshave been imported into R (and that there is no unwanted overhead when accessing them).as(from, "SimpleNormalIRangesList"):Coerces
from, to aSimpleNormalIRangesList, requiring that allIntegerRangeselements are coerced to internalNormalIRangeselements.as(from, "CompressedNormalIRangesList"):Coerces
from, to aCompressedNormalIRangesList, requiring that allIntegerRangeselements are coerced to internalNormalIRangeselements.
In the code snippet below, x is an IRangesList object.
unlist(x):Unlists
x, anIRangesList, by concatenating all of the ranges into a singleIRangesinstance. If the length ofxis zero, an emptyIRangesis returned.
Methods for NormalIRangesList objects
max(x):-
An integer vector containing the maximum values of each of the elements of
x. min(x):-
An integer vector containing the minimum values of each of the elements of
x.
Author(s)
Michael Lawrence and Hervé Pagès
See Also
-
IntegerRangesList, the parent of this class, for more functionality. -
intra-range-methods and inter-range-methods for intra range and inter range transformations.
-
setops-methods for set operations on IRangesList objects.
Examples
range1 <- IRanges(start=c(1,2,3), end=c(5,2,8))
range2 <- IRanges(start=c(15,45,20,1), end=c(15,100,80,5))
named <- IRangesList(one = range1, two = range2)
length(named) # 2
names(named) # "one" and "two"
named[[1]] # range1
unnamed <- IRangesList(range1, range2)
names(unnamed) # NULL
x <- IRangesList(start=list(c(1,2,3), c(15,45,20,1)),
end=list(c(5,2,8), c(15,100,80,5)))
as.list(x)