R/RangedData-methods.R

### =========================================================================
### RangedData/IntegerRangesList implementation of the GenomicRanges API
### -------------------------------------------------------------------------
###

### - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
### seqinfo
###

### April 2020: Do we still need these 2 methods? Looks like their main
### purpose was to support seqinfo() on RangedData objects.
setMethod("seqinfo", "List", function(x) {
  si <- metadata(x)$seqinfo
  if (is.null(si)) {
    sn <- names(x)
    if (is.null(sn))
      sn <- as.character(seq_len(length(x)))
    si <- Seqinfo(unique(sn))
  }
  si  
})

### FIXME: needs sanity checks
setReplaceMethod("seqinfo", "List",
                 function(x, value) {
                   metadata(x)$seqinfo <- value
                   x
                 })

Try the GenomicRanges package in your browser

Any scripts or data that you put into this service are public.

GenomicRanges documentation built on Nov. 8, 2020, 5:46 p.m.