hi Francesco,

i think that instead of going through variants annotating at each 
everything you need and trying to parallelize the iterating through 
variants, it will be more efficient to annotate one kind of information 
at a time over all variants vector-wise.

if this vector-wise operation is too big (dealing with thousands, or 
hundreds of thousands, of variants) then parallelize that annotation 
vector-wise operation spliting the variants by chromosome, or via 
BiocParallel::bpvec().

this is what i try to do in the VariantFiltering package, although i 
still have to exploit parallelism for a number of annotations, which is 
in my TODO list.

cheers,
robert.


On 6/19/14 10:37 AM, Francesco Lescai wrote:
> Hi guys,
> I've seen this issue addressed previously, but I couldn't understand if it's been implemented in some ways.
>
> I'd like to go through a GRanges object by row - or interval - (let's say variants, or genes) and perform a function (ex. to annotate with additional metadata).
> I can do that with
>
> for (i in 1:length(variants)){
>    #do something with variants[i,] data
> }
>
> but it's quite slow.
> as someone else asked in the past, something like
> apply(variants, 1, myFunction) or
> lapply(variants, myFunction)
> would be great.
> is there something like grapply? :)
>
> Any advice?
>
> thanks,
> Francesco
>
>
> 	[[alternative HTML version deleted]]
>
>
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor


	[[alternative HTML version deleted]]

