Learn R Programming

rbamtools (version 2.4.0)

gapList-class: Class "gapList"

Description

The gapList class represents a list of Alignment gaps (i.e. N-items in Cigar-data). For each gap, the type of left and right adjacent Cigar items is reported plus size of each. The list can be converted into a data.frame which then contains the columns: refid, position (which identify the align), left_cigar_len,left_cigar_type, left_stop (characterize the left boundary) and right_start, right_cigar_len, right_cigar_type (characterize the right boundary). The adjacent cigar-types should be 0 (i.e. M=match). left_stop is the 0-based position of last exon nucleotide, right_start is the 0-based position of the first exon nucleotide.

Arguments

Objects from the Class

Objects can be created by calls of the form gapList(reader,coords)).

Examples

Run this code
library(rbamtools)
bam<-system.file("extdata", "accepted_hits.bam", package="rbamtools")
idx<-paste(bam,"bai",sep=".")
# Open BAM file
reader<-bamReader(bam)
# Load BAM index file
load.index(reader,idx)
coords<-as.integer(c(0,0,249250621))
gl<-gapList(reader,coords)
size(gl)
nAligns(gl)
nGapAligns(gl)
gl
df<-as.data.frame(gl)
head(df)
bamClose(reader)

Run the code above in your browser using DataLab