[Bioc-sig-seq] Rsamtools: Select reads on a chromosome

Steve Lianoglou mailinglist.honeypot at gmail.com
Wed Jan 6 22:58:19 CET 2010


Not a pressing issue, but I feel like I'm doing this wrong.

Currently in order to get all the reads on a chromosome using
Rsamtools (to extract from a BAM file), I'm making an IRanges object
that's "as long" as the chromosome I want the reads for.

For instance, for chr1:

which <- RangesList(chr1=IRanges(start=1, end=247249719))
params <- ScanBamParams(which=which)
reads <- scanBam(my.bam.file, param=params)[[1]]

Is there are "better" way to do it, eg. w/o making the IRanges object
that's stretches over the chromosome?

Just curious, thanks.

Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

More information about the Bioc-sig-sequencing mailing list