Entering edit mode
I have a GRanges with a factor in mcols
gr <- GRanges(seqnames = c("1", "2"), IRanges(start=c(1000, 2000), width=100), strand = c("+", "+"), category = c("A", "B"))
I would like to split gr
based on category
, in order to have a GRangesList
that would be similar to:
grl <- GRangesList(A=gr[1], B=gr[2])
Is there a simple/best way to do it?
Thank you very much to everyone!