Learn R Programming

rbamtools (version 2.0.1)

getRefData: getRefData: Returns an unparsed character string containing the header information of a BAM-file.

Description

The header section contains various data fields which provides metadata about the stored alignment results.

Usage

getRefData(object)

Arguments

object
An object of class bamReader.

Value

  • data.frame The returned data.frame contains three columns: For each reference sequence, the corresponding row contains the Reference-ID (1st column, refID), the Reference name (2nd column, refName) and the length of the Reference sequence (3rd column, refLength).

References

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

See Also

getHeaderText

Examples

Run this code
bam_file <- system.file("extdata", "accepted_hits.bam", package="rbamtools")
reader<-bamReader(bam_file)
if(isOpen(reader))
{
ref<-getRefData(reader)
}
bamClose(reader)

Run the code above in your browser using DataLab