View source: R/preprocess-utils.R
binnedCounts | R Documentation |
Utilizes the countBam()
function in the Rsamtools
package to
count number of reads mapped to ranges determined by
a ScanBamParams()
object.
binnedCounts(object, scan_param)
object |
A |
scan_param |
An optional |
An integer-vector of counts corresponding to each interval in the BamViews
object.
library(Rsamtools)
library(svbams)
library(svfilters.hg19)
data(bins1kb)
extdir <- system.file("extdata", package="svbams", mustWork=TRUE)
bamfile <- file.path(extdir, "cgov10t.bam")
bins <- keepSeqlevels(bins1kb, "chr3", pruning.mode = "coarse")
bins <- subsetByOverlaps(bins, GRanges("chr3", IRanges(59600000, 61000000)))
bviews <- BamViews(bamRanges=bins, bamPaths=bamfile)
counts <- binnedCounts(bviews)
head(counts)
length(bamRanges(bviews)) == length(counts) #TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.