R: 'getNextAlign': Retrieving next align from bamReader or...

getNextAlign-methods {rbamtools} | R Documentation

## `getNextAlign`: Retrieving next align from bamReader or bamRange

### Description

Returns an object of class bamAlign from bamReader or bamRange.

### 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

### Author(s)

Wolfgang Kaisers

### Examples

    #
    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)

[Package rbamtools version 2.16.17 Index]