[BioC] Converting single GRanges object as per chromosome GRangeList

Steve Lianoglou lianoglou.steve at gene.com
Tue Dec 3 15:47:11 CET 2013


Hi,

On Tue, Dec 3, 2013 at 6:35 AM, Prashantha Hebbar
<prashantha.hebbar at yahoo.com> wrote:
[snip]
> If I have my geneRange information as per chromosome in GRangeList form, my script becomes more efficient. because, I can retrive genotypes from each chromosomes in one go.
> So, May I know a way to convert geneRange GRange object to GRangeList Object as per chromosome number?
[/snip]

To answer your direct question: you can split a GRanges object into a
GRangesList by its chromosome name like so (assume that your GRanges
object is named `gr`):

R> grl <- split(gr, seqnames(gr))

HTH,

-steve

-- 
Steve Lianoglou
Computational Biologist
Genentech



More information about the Bioconductor mailing list