bamCount: bamCount: Counting of CIGAR-OP items

Description Usage Arguments Details Examples

Description

The bamCount function takes a bamReader object, a set of reference coordinates and the 'complex' argument and returns an integer vector.

Usage

1
bamCount(object,coords)

Arguments

object

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

coords

Integer vector of length 3: coords=c(refid, start, stop)

Details

The method returns integer vector of length 10. Entries 1 to 9 contain the number of CIGAR-OP items found in the given range. The 10th entry is the total number of aligns in the range. The returned vector is named. The names of the vector are "M", "I","N","S","H","P","=","X" and nAligns. The first 9 names are the abbreviations for CIGAR-OP items which are defined in the SAM file format reference.

Examples

1
2
3
4
5
6
bam <- system.file("extdata", "accepted_hits.bam", package="rbamtools")
reader<-bamReader(bam,idx=TRUE)
coords<-getRefCoords(reader,"chr1")
count<-bamCount(reader,coords)
count
bamClose(reader)

Example output

Loading required package: refGenome
Loading required package: doBy
Loading required package: RSQLite
      M       I       D       N       S       H       P       =       X nAligns 
   4577      18      46    2297       0       0       0       0       0    2216 

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