then call it chrapply or chromapply... nobody will ever remember sblapply,
I don't think

I wrote a function called byChr in regulatoR that splits up a
SummarizedExperiment by chromosome arm, applies a function to it (hadn't
got around to doing a nice job with pvec, so I just called mclapply()
across the names of the split list), and then puts it back together.  The
appeal of doing it by arm is that you don't have some nodes hanging around
waiting for chrX and chr1 after finishing chrY in a few seconds :-)


On Mon, Sep 24, 2012 at 11:30 AM, Michael Lawrence <
lawrence.michael@gene.com> wrote:

> Sorry, I didn't mean to indicate that I was talking just about
> parallelization. The need is for a general apply function that uses [
> instead [[. This usually comes up in Vectors that are not Lists, like
> GRanges or Seqinfo. For GRangesList, lapply works as intended, and as
> Martin says, it's usually best not to apply at all. Sometimes, however, it
> is easiest to just apply. For example, if I wanted to apply over the
> chromosomes, and performing some operation based on the range of the entire
> chromosome, then for some Seqinfo of interest, I could do:
>
> sblapply(si, fun) or sblapply(as(si, "GenomicRanges"), fun)
>
> The primary use case really is something like applying over chromosomes,
> which is why I suggested the high-level glapply for traversing the whole
> genome.  Of course, we want this to support parallel computing, so the
> region-size feature was to get around the uneven lengths of chromosomes,
> which make it difficult to make effective use of resources.
>
> Michael
>
>
> On Mon, Sep 24, 2012 at 7:16 AM, Tim Triche, Jr. <tim.triche@gmail.com>wrote:
>
>> Did you see Malcolm Cook's post recently about fixing pvec() to
>> automatically do this?
>>
>> It seems like a sensible approach to me
>>
>> --t
>>
>> On Sep 24, 2012, at 6:53 AM, Michael Lawrence <lawrence.michael@gene.com>
>> wrote:
>>
>> > Florian's post about mclapply got me thinking about how it is kind of a
>> > pain to iterate over GRanges objects (since they are not Lists, there
>> is no
>> > lapply). Could we instead have an apply function for vectors that
>> subsets,
>> > i.e., uses [, instead of [[? Maybe sblapply for single bracket? I was
>> also
>> > thinking it would be nice to have an apply function for Seqinfo objects
>> > that would apply over the subranges of all of the sequences, where the
>> size
>> > of the subregion is specified by the user. Maybe call it glapply, where
>> 'g'
>> > is for 'genome'?
>> >
>> > Michael
>> >
>> >    [[alternative HTML version deleted]]
>> >
>> > _______________________________________________
>> > Bioc-devel@r-project.org mailing list
>> > https://stat.ethz.ch/mailman/listinfo/bioc-devel
>>
>
>


-- 
*A model is a lie that helps you see the truth.*
*
*
Howard Skipper<http://cancerres.aacrjournals.org/content/31/9/1173.full.pdf>

	[[alternative HTML version deleted]]

