Entering edit mode
5.7 years ago
endrebak
▴
980
library(GenomicRanges)
gr <- GRanges(Rle(c("chr2", "chr2", "chr1", "chr3"), c(1, 3, 2, 4)),
IRanges(1:10, width=10:1, names=head(letters, 10)),
Rle(strand(c("-", "+", "*", "+", "-")), c(1, 2, 2, 3, 2)),
score=1:10, GC=seq(1, 0, length=10))
split(gr, seqnames(gr))
Gives me a list of chromosomes, but how do I get a list split on chromosome and strand?
I am trying to split just by chromosome but this does not work for me.
Will split everything by chromosome but the object for each chromosome will be the same length, which I assume is the number of sequences in chr1.
Please advise :/