# NOT RUN {
# Open (indexed) BAM file
bam<-system.file("extdata", "accepted_hits.bam", package="rbamtools")
reader<-bamReader(bam,idx=TRUE)
coords<-getRefCoords(reader,"chr1")
gl<-gapList(reader,coords)
size(gl)
nAligns(gl)
nAlignGaps(gl)
gl
dfr<-as.data.frame(gl)
# coerce
dfr<-as(gl,"data.frame")
head(df)
bamClose(reader)
# }
Run the code above in your browser using DataLab