Learn R Programming

rbamtools (version 2.16.17)

refSeqDict-class: Class "refSeqDict": Repesentation of data from reference sequence dictionary in BAM file header.

Description

refSeqDict represents Data contained in the header section of BAM-files.

Arguments

Objects from the Class

Objects can be created by calls of the form hl<-new("refSeqDict").

Slots

SN:

character

LN:

numeric

AS:

character

M5:

numeric

SP:

character

UR:

character

Methods

dim

signature(x="refSeqDict"): Returns dimension of data: number of rows and 6 columns.

%
as.data.frame

signature(object="refSeqDict"): Combines data of Slots to data.frame.

%
coerce

signature(from="bamRange", to="data.frame"): Coercion of refSeqDice to data.frame.

%
removeSeqs

signature(object="refSeqDict",rows="numeric"): Removes reference sequence (i.e. one row from data.frame) entry.

%
addSeq

signature(.Object="refSeqDict",SN,LN,AS,M5,SP,UR): Adds reference sequence (i.e. one row in data.frame) entry.

%
head

signature(.Object="refSeqDict",n): Returns head of data.frame representation.

%
tail

signature(.Object="refSeqDict",n): Returns tail of data.frame representation.

%
getHeaderText

signature(.Object="refSeqDict"): Returns textual representation of data stored in this class as desrcribed in SAM Format Specification.

References

The SAM Format Specification (v1.4-r985). The SAM Format Specification Working Group. September 7, 2011.

Examples

Run this code
# NOT RUN {
bam <- system.file("extdata", "accepted_hits.bam", package="rbamtools")
reader<-bamReader(bam)
isOpen(reader)
header<-getHeader(reader)
htxt<-getHeaderText(header)
refSeqs<-refSeqDict(htxt)
dim(refSeqs)
ht<-getHeaderText(refSeqs)
df<-as.data.frame(refSeqs)
addSeq(refSeqs,SN="nextSeqName",LN=1000)
removeSeqs(refSeqs,3)
bamClose(reader)
# }

Run the code above in your browser using DataLab