Learn R Programming

rbamtools (version 2.4.0)

bamAlign-class: Class "bamAlign"

Description

The bamAlign class represents the content of a single alignment stored in a BAM-file. An instance of this class can be created by reading an Alignment from an object of class bamReader or bamRange. Accessor functions allow reading and writing of object contents. The alignment can be rewritten to a BAM-file via a bamWriter object or stored in a bamRange object.

Arguments

Objects from the Class

Objects can be created by calls of the form new("bamAlign", alignment).

References

The SAM Format Specification (v1.4-r985). The SAM Format Specification Working Group. September 7, 2011. http://www.samtools.sourceforge.net/SAM1.pdf

Examples

Run this code
library(rbamtools)
# retrieve align from file
bam<-system.file("extdata", "accepted_hits.bam", package="rbamtools")
reader<-bamReader(bam)
align<-getNextAlign(reader)
bamClose(reader)
# use some accessors
name(align)
refID(align)
position(align)
nCigar(align)
cigarData(align)
alignSeq(align)
alignQual(align)
reverseStrand(align)
reverseStrand(align)<-TRUE
reverseStrand(align)

Run the code above in your browser using DataLab