I'm wondering what you would do with the result of this pvec() call. The
indices would in matchMatrix would not match those in the original "subject"
(actually the query/pattern in the below). I guess a 'c' could rbind things
and add offsets, increase the dimensions, etc, for some virtual set of
ranges. That's actually what happens when when unlist()ing a
RangesMatchingList.

One should be able to do something like this:

rm <- unlist(RangesMatchingList(pvec(..., function(i) findOverlaps(query[i],
subject))))

To get the result you might want. Let me know if that does not work and we
can work to fix it.

Michael

On Mon, Oct 10, 2011 at 12:16 PM, Cook, Malcolm <MEC@stowers.org> wrote:

> I think that defining c for RangesMatching to cbind the matchMatix would be
> a good addiition to IRanges.****
>
> ** **
>
> Having it would allow using pvec from multicore to distribute findOverlaps
> like so:****
>
> ** **
>
> I’d appreciate comments/criticisms from those who know better....****
>
> ** **
>
> setMethod("c",****
>
>           signature(x = "RangesMatching"),****
>
>           function (x, ..., recursive = FALSE) ****
>
>           {****
>
> ### PURPOSE: implement c for RangesMatching so as to yield a single****
>
> ### RangesMatching which refers to the rbind of the component****
>
> ### matchMatrix.****
>
> ### MOTIVATION: Doing this allows using `multicore:pvec` as in:****
>
> ### EXAMPLE:****
>
> ###   rm<-pvec(1:length(subject),function(i)
> {findOverlaps(subject[i],query)})****
>
>             rm <- list(x,...)****
>
>             rm <-****
>
>               ## TODO: understand why ... contains objects of class
> `try-error`****
>
>               rm[which(sapply(rm,class)=='RangesMatching')]****
>
>             mm <- Reduce(rbind,lapply(rm,as.matrix))****
>
>             ## TODO: Is this the best/only/correct way to contrive to
> return a****
>
>             ## new matchMatrix made out of the combined matrix?****
>
>             x@matchMatrix<-mm****
>
>             x****
>
>           }****
>
>           )****
>
> ** **
>
> ** **
>
> Cheers,
> ****
>
> ** **
>
> ~Malcolm****
>
> ** **
>
> *From:* Malcolm Cook [mailto:malcolm.cook@gmail.com]
> *Sent:* Monday, October 10, 2011 9:08 AM
> *To:* Cook, Malcolm
> *Subject:* c,MatchMatrix sought****
>
> ** **
>
>
> Malcolm Cook
> h - 913.642.5257
> c - 913.226.1542
> w - 816.926.4449****
>

	[[alternative HTML version deleted]]

