tabulateReads {leeBamViews}R Documentation

tabulate counts of alignments occurring in specified genomic regions

Description

tabulate counts of alignments occurring in specified genomic regions

Usage

tabulateReads(bv, strandmarker=NULL, as.GRanges=FALSE, applier=lapply)

Arguments

bv

BamViews-class instance

strandmarker

character atom: ‘+’ or ‘-’; if missing, ignore strand

as.GRanges

logical directive to return a GRanges instance instead of a matrix

applier

lapply-like function; if unspecified and multicore is attached will use mclapply

Details

readBamGappedAlignments is the basic engine for this task

Value

annotated matrix with start, end, and samples as rows, regions as columns, and read counts as cell entries

Author(s)

VJ Carey <stvjc@channing.harvard.edu>

Examples

example(bs1)
#
# counts in a partition
#
myrn = GRanges(IRanges(start=seq(861250, 862750, 100), width=100),
    seqnames="Scchr13", strand="+")

values(myrn)$name = paste("til", 1:length(myrn), sep=".")
bamRanges(bs1) = myrn
tabulateReads(bs1, "+")
#
# a related computation based on countBam
lapply(bamPaths(bs1)[1:2], function(x) 
    countBam(x,  param=ScanBamParam(which=bamRanges(bs1))))

[Package leeBamViews version 0.99.13 Index]