Hi all,
is there a way to transform an RleList
(or a list of Rle
's) into a RleArray
/ RleMatrix
?
My use case is that I have a loop / lapply that returns a list of Rle
objects that I would like to store as a RleMatrix
(each column as an Rle
).
Minimal example:
x <- Rle(10:1, 1:10)
rl <- RleList(x, x)
Ideally, something like
rm <- RleArray(rl, dim=c(length(x), length(r1))
or
rm <- as(rl, "RleArray")
The more realistic (but not reproducible at this moment example):
idx <- c(50, 100)
rleBinCovList <- lapply(idx, function(win) {
runsum(chrCovRle, k=win, endrule="constant")
})
Or perhaps is there a way to create directly a RleArray
?
Thanks! Davide
Thanks Pete!
I knew you could help! I almost just wrote directly to you ;)
Will try to write a PR to add this to DelayedArray over the next few days
Thanks for the PR Pete. I just merged it. H.