[BioC] multicore and GRangesList [Resurrected]
Cook, Malcolm
MEC at stowers.org
Wed Sep 19 18:30:51 CEST 2012
The question of approaches to parallelizing operations on a GRangesList was raised in this thread: http://thread.gmane.org/gmane.science.biology.informatics.conductor/32799
I find the issue still relevant when using the new `parallel` package.
I have adopted the following practice, for which I seek your criticism or accolades. Your choice.
The approach is to use parallel::pvec over the indices of the GRangesList, with a little sugar in the form of...
pvec_along <-function(x,FUN,...) {
### PURPOSE: extension to parallel::pvec for non-vectors which is
### vectorized over the indices of x.
###
### Example: pvec_along(myGRangesList,width)
###
### Requires: `library(functional)` `library(parallel)`
indices<-seq_along(x)
FUN<-match.fun(FUN)
pvec(indices,Compose(Curry(`[`,x),FUN),...)
}
Discuss?
Best,
~ Malcolm Cook
More information about the Bioconductor
mailing list