Learn R Programming

rbamtools (version 2.0.1)

push_back: Pushing and popping bamAligns on or off a bamRange list.

Description

A bamRange is a (linked-) list of bamAlign objects. The four functions add and remove single bamAlings at the beginning or the end of the list.

Usage

push_back(object, value)
push_front(object, value)
pop_back(object)
pop_front(object)

Arguments

object
A bamRange object.
value
A bamAlign object.

Value

  • None.

Details

push_back adds the given bamAlign as last item in the list. pop_back removes the last item from the bamRange list. push_fron adds the given bamAlign as first item in the list. pop_front removes the first item from the bamRange list. The pop-functions have no effect when the bamRang list is empty.

Examples

Run this code
bam_file <- system.file("extdata", "accepted_hits.bam", package="rbamtools")
idx_file <- system.file("extdata", "accepted_hits.bam.bai", package="rbamtools")
reader<-bamReader(bam_file)
isOpen(reader)
loadIndex(reader,idx_file)
index.initialized(reader)
coords<-as.integer(c(0,0,1874))
range<-bamRange(reader,coords)
align<-getNextAlign(range)
push_back(range,align)
pop_back(range)
push_front(range,align)
pop_front(range)
bamClose(reader)

Run the code above in your browser using DataLab