Make all GRanges object in a list same length by filling with NA

paddingGRangesList(xyzs)

Arguments

xyzs

A list of GRanges.

Value

A list with element 'gr' represent the genomic ranges and 'xyzs' represent the x,y,z positions in a data.frame.

Examples

library(GenomicRanges)
gr <- GRanges('chr1', IRanges(1:10, width=1), x=1:10, y=1:10, z=1:10)
xyzs <- list(gr1=gr[c(1, 3, 5, 7, 9)],
             gr2=gr[c(2, 4, 6, 8, 10)])
paddingGRangesList(xyzs)
#> $gr
#> GRanges object with 10 ranges and 3 metadata columns:
#>        seqnames    ranges strand |         x         y         z
#>           <Rle> <IRanges>  <Rle> | <logical> <logical> <logical>
#>    [1]     chr1         1      * |      <NA>      <NA>      <NA>
#>    [2]     chr1         2      * |      <NA>      <NA>      <NA>
#>    [3]     chr1         3      * |      <NA>      <NA>      <NA>
#>    [4]     chr1         4      * |      <NA>      <NA>      <NA>
#>    [5]     chr1         5      * |      <NA>      <NA>      <NA>
#>    [6]     chr1         6      * |      <NA>      <NA>      <NA>
#>    [7]     chr1         7      * |      <NA>      <NA>      <NA>
#>    [8]     chr1         8      * |      <NA>      <NA>      <NA>
#>    [9]     chr1         9      * |      <NA>      <NA>      <NA>
#>   [10]     chr1        10      * |      <NA>      <NA>      <NA>
#>   -------
#>   seqinfo: 1 sequence from an unspecified genome; no seqlengths
#> 
#> $xyzs
#> $xyzs$gr1
#>     x  y  z
#> 1   1  1  1
#> 2  NA NA NA
#> 3   3  3  3
#> 4  NA NA NA
#> 5   5  5  5
#> 6  NA NA NA
#> 7   7  7  7
#> 8  NA NA NA
#> 9   9  9  9
#> 10 NA NA NA
#> 
#> $xyzs$gr2
#>     x  y  z
#> 1  NA NA NA
#> 2   2  2  2
#> 3  NA NA NA
#> 4   4  4  4
#> 5  NA NA NA
#> 6   6  6  6
#> 7  NA NA NA
#> 8   8  8  8
#> 9  NA NA NA
#> 10 10 10 10
#> 
#>