bamCountAll: bamCountAll

Description Usage Arguments Details Examples

Description

The bamCountAll function takes a bamReader object and returns a data.frame. The data.frame contains the counts for all contained reference sequences. Because align numbers are counted for all reference sequences separately, the function needs to load a BAM index file.

Usage

1
bamCountAll(object,verbose=FALSE)

Arguments

object

An instance of bamReader. Must be opened and contain initialized index.

verbose

Logical. Determines the amount of textual output during runtime.

Details

The method returns a data.frame. Each row contains count data for one reference sequence. Each column contains the counts for one CIGAR-OP type ("M", "I","N","S","H","P","=","X"). Columns with the total number of aligns, the refid (ID) and the length of the reference sequence (LN), as retrieved by 'getRefData' are added.

Examples

1
2
3
4
5
6
library(rbamtools)
bam <- system.file("extdata", "accepted_hits.bam", package="rbamtools")
reader<-bamReader(bam,idx=TRUE)
count<-bamCountAll(reader,verbose=TRUE)
count
bamClose(reader)

rbamtools documentation built on Nov. 11, 2019, 5:09 p.m.