1
### =========================================================================
2
### RangedData/RangesList implementation of the GenomicRanges API
3
### -------------------------------------------------------------------------
6
### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
10
setMethod("seqinfo", "List", function(x) {
11
si <- metadata(x)$seqinfo
15
sn <- as.character(seq(length(x)))
16
si <- Seqinfo(unique(sn))
21
setMethod("seqinfo", "RangesList", function(x) {
22
si <- callNextMethod()
23
if (!is.null(universe(x)))
24
genome(si) <- universe(x)
28
### FIXME: needs sanity checks
29
setReplaceMethod("seqinfo", "List",
31
metadata(x)$seqinfo <- value
35
setMethod("seqinfo", "RangedData", function(x) seqinfo(ranges(x)))
36
setReplaceMethod("seqinfo", "RangedData",
38
seqinfo(ranges(x)) <- value
42
### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
46
setMethod("seqnames", "RangesList", function(x) {
47
if (is.null(names(x)))
49
else seqsplit(Rle(space(x)), rep(names(x), elementLengths(x)))
52
setMethod("seqnames", "RangedData", function(x) space(x))