getRefData: Retrieve reference sequence from a BAM file as data.frame

Description Usage Arguments Details Author(s) Examples

Description

The four functions: getRefCoords, getRefCount, getRefData and getRefId provide reading access to data about the present reference sequences in bamReader or bamWriter.

Usage

1
getRefData(object)

Arguments

object

bamReader. The reader must be opened (otherwise an error is thrown).

Details

getRefData returns a data.frame with three columns (ID, SN, LN). ID is the (0-based index which must be given when a bamRange is extracted. SN is the name of the sequence (e.g. chr1 for UCSC). LN is the length of the reference sequence. getRefCount returns the number of reference sequences. getRefCoords returns a vector of coordinates which can be used to extract all stored aligns for this sequence from the bamReader into a bamRange object.

Author(s)

Wolfgang Kaisers

Examples

1
2
3
4
5
6
7
8
bam<-system.file("extdata","accepted_hits.bam",package="rbamtools")
reader<-bamReader(bam,idx=TRUE)
getRefData(reader)
getRefCount(reader)
getRefId(reader, "chr1")
coords<-getRefCoords(reader, "chr1")
rg<-bamRange(reader,coords)
bamClose(reader)


Search within the rbamtools package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.