Learn R Programming

rbamtools (version 2.16.17)

getNextAlign-methods: getNextAlign: Retrieving next align from bamReader or bamRange

Description

Returns an object of class bamAlign from bamReader or bamRange.

Arguments

Value

An object of class bamAlign or NULL.

Methods

signature(object = "bamRange")

An instance of class bamRange.

%
signature(object = "bamReader")

An instance of class bamReader

Examples

Run this code
# NOT RUN {
#
bam<-system.file("extdata","accepted_hits.bam",package="rbamtools")
idx<-system.file("extdata","accepted_hits.bam.bai",package="rbamtools")
#
reader<-bamReader(bam)
isOpen(reader)
#
align<-getNextAlign(reader)
if(is.null(align))
    print("End of File!\n")
#
loadIndex(reader,idx)
indexInitialized(reader)
#
coords<-as.integer(c(0,0,249250621))
range<-bamRange(reader,coords)
align<-getNextAlign(range)
position(align)
#
bamClose(reader)
# }

Run the code above in your browser using DataLab