File: methods-VRangesList-class.R

package info (click to toggle)
r-bioc-variantannotation 1.52.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,372 kB
  • sloc: ansic: 1,357; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 703 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
### =========================================================================
### VRangesList: Where there is an IntegerRanges, there must be a List
### -------------------------------------------------------------------------
###

VRangesList <- function(...) {
  new("SimpleVRangesList", GRangesList(..., compress=FALSE),
                           elementType="VRanges")
}

setMethod("stackSamples", "VRangesList", function(x) {
  stacked <- unlist(x, use.names=FALSE)
  if (!is.null(names(x)))
    sampleNames(stacked) <- Rle(names(x), elementNROWS(x))
  stacked
})

setMethod("ref", "VRangesList", function(x) List(lapply(x, ref)))
setMethod("alt", "VRangesList", function(x) List(lapply(x, alt)))