Description Objects from the Class Slots Methods Author(s) References Examples
bamHeader represents data contained in the header Section of BAM-files.
Objects can be created by calls of the form header<-new("bamHeader")
.
header
:Object of class "externalptr"
.
Points to samtools bam_header_t struct.
signature(x = "bamHeader")
:
Returns textual representation of data stored in this class as
desrcribed in SAM Format Specification.
Wolfgang Kaisers
The SAM Format Specification (v1.4-r985).
The SAM Format Specification Working Group. September 7, 2011.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | bam<-system.file("extdata","accepted_hits.bam",package="rbamtools")
# Open bam file
reader<-bamReader(bam)
# Extract binary header structure
header<-getHeader(reader)
header
# Extract textual representation
htxt<-getHeaderText(header)
# Extract header line segment
hl<-headerLine(htxt)
# Get header program
hp<-headerProgram(htxt)
hp
# Re-create binary header structure
header2<-bamHeader(htxt)
# Use created structure for new BAM-file
writer<-bamWriter(header2,"test.bam")
bamClose(reader)
bamClose(writer)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.