binFragments: Counts the number of read fragments mapped to bins

View source: R/preprocess-utils.R

binFragmentsR Documentation

Counts the number of read fragments mapped to bins

Description

For each bin provided by a GRanges object, binFragments counts the number of fragments, determined by read pairs in a GAlignmentPair object, that overlap that bin

Usage

binFragments(galp, bins)

Arguments

galp

a GAlignmentPairs object

bins

a GRanges object

Value

an integer-vector of counts corresponding to each range in the GRanges object

Examples

## Not run: 
library(Rsamtools)
library(svbams)
library(GenomicAlignments)
bam_path <- system.file("extdata", package="svbams", mustWork=TRUE)
bamfile <- file.path(bam_path, "cgov10t.bam")
data(bins, package='svbams')
param <- ScanBamParam(flag=scanBamFlag(isDuplicate=FALSE,
                                       isSecondaryAlignment=FALSE)) 
galp <- readGAlignmentPairs(bamfile, param=param)
fragmentCounts <- binFragments(galp, bins)

## End(Not run)

cancer-genomics/trellis documentation built on Feb. 2, 2023, 7:04 p.m.