I have a SummarizedExperiment (but we can consider it a GRanges). What I want is to reduce the number of intervals, keeping only one row for every identical adjacent
mcol(gr), important is to also keep track of the new extend interval.
if a state pair is present also in non adjacent intervals (this second e.g. 1,1 pair has to be report independely from the first)
Thanks a lot!
gr <- GRanges( seqnames = Rle(c("chr1"), c(12)), ranges = IRanges(1:12*10, end = 1:12*10+5), state1 = c(1,1,1,1,2,3,4,5,5,5,1,1), state2 = c(1,1,1,2,2,2,5,5,6,6,1,1))
gr2 <- GRanges( seqnames = Rle(c("chr1"), c(8)), ranges = IRanges(start = c(10,40,50,60,70,80,90,110), end = c(35,45,55,65,75,85,105,125)), state1 = c(1,1,2,3,4,5,5,1), state2 = c(1,2,2,2,5,5,6,1))