I used the simple example in "An Introduction to Genomic Ranges Classes" I this example, but I didn't understand the results of the coverage function as shown below:
> gr <-GRanges(seqnames =
+ Rle(c("chr1", "chr2", "chr1", "chr3"), c(1, 3, 2, 4)),
+ ranges =IRanges(1:10, end = 7:16, ),
+ strand =Rle(strand(c("-", "+", "*", "+", "-")),c(1, 2, 2, 3, 2)))
> gr
GRanges object with 10 ranges and 0 metadata columns:
seqnames ranges strand
<Rle> <IRanges> <Rle>
[1] chr1 [ 1, 7] -
[2] chr2 [ 2, 8] +
[3] chr2 [ 3, 9] +
[4] chr2 [ 4, 10] *
[5] chr1 [ 5, 11] *
[6] chr1 [ 6, 12] +
[7] chr3 [ 7, 13] +
[8] chr3 [ 8, 14] +
[9] chr3 [ 9, 15] -
[10] chr3 [10, 16] -
-------
seqinfo: 3 sequences from an unspecified genome; no seqlengths
> co= coverage(gr)
This is the part I don't understand:
> co
RleList of length 3
$chr1
integer-Rle of length 12 with 5 runs
Lengths: 4 1 2 4 1
Values : 1 2 3 2 1
$chr2
integer-Rle of length 10 with 6 runs
Lengths: 1 1 1 5 1 1
Values : 0 1 2 3 2 1
$chr3
integer-Rle of length 16 with 8 runs
Lengths: 6 1 1 1 4 1 1 1
Values : 0 1 2 3 4 3 2 1
I mean what is the interpretation of
Lengths: 4 1 2 4 1
Values : 1 2 3 2 1