[BioC] counting BAM reads in a set of genomic regions

Martin Morgan mtmorgan at fhcrc.org
Fri Feb 8 15:05:39 CET 2013


On 02/08/2013 05:49 AM, mattia pelizzola wrote:
> Hi everybody,
> given a BAM file and a set of genomic regions stored in a GRanges object,
> I would like to know your opinion/experience on the fastest (and memory
> parsimonious) way in BioC for counting the number of reads for each region.

Rsamtools::countBam is memory efficient and reasonably fast.

   which = <my GRanges>
   param = ScanBamParam(which=which)
   countBam(<my BAM file, param=param)

For several files

   countBam(BamFileList(<my BAM filess>), param=param)

See also ?summarizeOverlaps in the GenomicRanges pacakge.

Martin

>
> Thanks!
>
> mattia
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>


-- 
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793



More information about the Bioconductor mailing list