I have a list of genomicRanges that look like the following:
> l3 [[1]] GRanges object with 5000 ranges and 4 metadata columns: seqnames ranges strand | Island <Rle> <IRanges> <Rle> | <integer> [1] chr1 [10050, 10051] * | 0 [2] chr1 [10100, 10101] * | 0 [3] chr1 [10200, 10201] * | 0 [4] chr1 [10250, 10251] * | 0 [5] chr1 [13250, 13251] * | 0 ... ... ... ... ... ... [4996] chr1 [1261250, 1261251] * | 0 [4997] chr1 [1261300, 1261301] * | 1 [4998] chr1 [1261350, 1261351] * | 1 [4999] chr1 [1261400, 1261401] * | 1 [5000] chr1 [1261600, 1261601] * | 1 data.animal.Exp1_12h_PolII.bed data.animal.Exp1_12h_Input.bed <integer> <integer> [1] 0 1 [2] 1 2 [3] 1 1 [4] 1 0 [5] 1 0 ... ... ... [4996] 0 1 [4997] 3 0 [4998] 1 1 [4999] 1 0 [5000] 2 0 data.animal.Exp2_12h_Input.bed <integer> [1] 1 [2] 0 [3] 1 [4] 0 [5] 0 ... ... [4996] 1 [4997] 0 [4998] 0 [4999] 0 [5000] 0 ------- seqinfo: 1 sequence from an unspecified genome; no seqlengths [[2]] GRanges object with 5000 ranges and 5 metadata columns: seqnames ranges strand | Island <Rle> <IRanges> <Rle> | <integer> [1] chr1 [10000, 10001] * | 0 [2] chr1 [10050, 10051] * | 0 [3] chr1 [10100, 10101] * | 0 [4] chr1 [10150, 10151] * | 0 [5] chr1 [10200, 10201] * | 0 ... ... ... ... ... ... [4996] chr1 [1119900, 1119901] * | 0 [4997] chr1 [1120000, 1120001] * | 0 [4998] chr1 [1120100, 1120101] * | 0 [4999] chr1 [1120150, 1120151] * | 0 [5000] chr1 [1120200, 1120201] * | 0 data.animal.Exp1_15h_PolII.bed data.animal.Exp2_15h_PolII.bed <integer> <integer> [1] 1 0 [2] 0 0 [3] 2 0 [4] 1 0 [5] 0 0 ... ... ... [4996] 0 0 [4997] 0 0 [4998] 0 0 [4999] 0 0 [5000] 0 0 data.animal.Exp1_15h_Input.bed data.animal.Exp2_15h_Input.bed <integer> <integer> [1] 0 2 [2] 1 0 [3] 0 1 [4] 0 0 [5] 1 1 ... ... ... [4996] 0 1 [4997] 0 1 [4998] 1 0 [4999] 1 0 [5000] 0 1 ------- seqinfo: 1 sequence from an unspecified genome; no seqlengths
The real list will contain many more granges. Notice that there are several data columns in each file.
What I want is a GRanges object containing the union of all the ranges and the metadata. I could loop over the list, taking the union of each pair of GRanges, but the union loses the metadata.
Is there a way to merge all my GRanges into one giant GRanges, with metadata? (What I ultimately want is a dataframe of counts so that I can input it into limma.)
I am curious as to how you get this list of GRanges. Wouldn't it make sense to create an eSet or SummarizedExperiment for use with limma?
Ah, so if I have multiple granges (with different, somewhat overlapping rows) in a summarizedexperiment, limma can treat it like one matrix? Voom even? (I have very little bioconductor experience, unfortunately.)