[BioC] base-specific read counts

Martin Morgan mtmorgan at fhcrc.org
Thu Jun 7 15:00:42 CEST 2012


On 06/06/2012 10:43 PM, Yu Chuan Tai wrote:
> Hi,
>
> Is there any way to calculate base-specific read counts for a given
> genomic interval (including 1-base interval), for paired-end data
> aligned by Bowtie2 in BAM format?

Thanks for posting to the Boic mailing list! Functions like 
readGappedAlignments, scanBam, etc. take an argument ScanBamParam that 
in turn has an argument 'which' to specify, using GRanges, the regions 
of a bam file you want to query

   gwhich <- GRanges("chr1", IRanges(c(1000, 2000, 3000), width=100)),
       c("+", "+", "-"))
   param <- ScanBamParam(which=gwhich)
   scanBam("my.bam", param=param)

Base-level coverage is also available with ?applyPileups, see 
example(applyPileups).

Martin

> Thanks!
>
> Best,
> Yu Chuan
>
> _______________________________________________
> 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