## 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