Just split(gr, rep(names(grl), elementLengths(grl))).

On Fri, Jan 13, 2012 at 1:10 PM, Tarca, Adi <atarca@med.wayne.edu> wrote:

> ** **
>
> Thank you Michael,****
>
> I almost got it except that it is not obvious to me how once I have the
> Granges object how to relist it and split on the names.****
>
> Thanks,****
>
> Adi****
>
> ** **
>
> ** **
>
> ** **
>
> *From:* Michael Lawrence [mailto:lawrence.michael@gene.com]
> *Sent:* Friday, January 13, 2012 1:58 PM
> *To:* Tarca, Adi
> *Cc:* bioconductor@stat.math.ethz.ch
> *Subject:* Re: [BioC] about reduce function in GenomicRanges****
>
> ** **
>
> The general idiom is to coerce the GappedAlignments to a GRangesList, then
> flatten it to a GRanges, and relist it, splitting on the names. The
> resulting GRangesList will yield the appropriate counts.
>
> A little bit convoluted, but unfortunately support for paired end data
> remains a gap in the infrastructure.
>
> Michael****
>
> On Fri, Jan 13, 2012 at 10:50 AM, Tarca, Adi <atarca@med.wayne.edu> wrote:
> ****
>
> Dear list,
> I was wondering if is there is a way to apply the reduce function on a
>  GappedAlignments object according to the levels of a factor (such as the
> read ID from paired end data). I am basically trying to deal with the
> instance when the GappedAlignments object was obtained by reading a bam
> file obtained from a bowtie2 alignment on Illumina paired end data. Since
> both ends of the read get an entry in the bam file, I do not want to count
> twice the read when using later the function countOverlaps.
> Thank you,
> Adi Tarca
>
>        [[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]]

