# NOT RUN {
# Open (indexed) BAM file
bam<-system.file("extdata", "accepted_hits.bam", package="rbamtools")
reader<-bamReader(bam,idx=TRUE)
coords<-getRefCoords(reader,"chr1")
sl<-siteList(reader,coords)
size(sl)
nAligns(sl)
nAlignGaps(sl)
sl
refID(sl)
df<-as.data.frame(sl)
head(df)
# Create from bamRange:
br <- bamRange(reader, coords)
sl <- siteList(br)
#
bamClose(reader)
# Create empty list
sl <- siteList()
# }
Run the code above in your browser using DataLab