Let's assume that I only have the ragexp object to explore. Therefore, I want to get a GRange list of containing sample1 and sample2 ranges. Thus, my intended output is:
The RaggedExperiment class is designed to facilitate matrix-like representation of ragged ranges
from a GRangesList such as:
> assay(ragexp)
sample1 sample2
A 3 NA
B 4 NA
C 5 NA
D NA 1
E NA 2
Because the class is based of a GRangesList representation, you can access the ranged data using:
> rowRanges(ragexp)
GRanges object with 5 ranges and 0 metadata columns:
seqnames ranges strand
<Rle> <IRanges> <Rle>
A chr1 1-10 -
B chr1 8-14 +
C chr2 15-18 +
D chr1 1-10 -
E chr2 11-18 +
-------
seqinfo: 2 sequences from an unspecified genome; no seqlengths
If you are only interested in the original GRangesList, you can use our
coercion function:
> as(ragexp, "GRangesList")
GRangesList object of length 2:
$sample1
GRanges object with 3 ranges and 1 metadata column:
seqnames ranges strand | score
<Rle> <IRanges> <Rle> | <integer>
A chr1 1-10 - | 3
B chr1 8-14 + | 4
C chr2 15-18 + | 5
$sample2
GRanges object with 2 ranges and 1 metadata column:
seqnames ranges strand | score
D chr1 1-10 - | 1
E chr2 11-18 + | 2
-------
seqinfo: 2 sequences from an unspecified genome; no seqlengths