Learn R Programming

wavClusteR (version 2.6.2)

readSortedBam: Load a sorted BAM file

Description

Load a sorted BAM file. Optionally, only reads mapping to a specific set of genomics coordinates are loaded. Only fields strictly necessary to run a wavClusteR analysis are loaded.

Usage

readSortedBam(filename, which)

Arguments

filename
Name of the sorted BAM file, including full path to file if it is located outside the current working directory.
which
a GRanges, RangesList or RangedData specifying the regions on the reference sequence for which matches are desired. See the documentation of the Rsamtools package for details.

Value

  • a GRanges object containing aligned reads, including read sequence (qseq) and MD tag (MD)

References

Martin Morgan and Herve Pages, Rsamtools: Binary alignment (BAM), variant call (BCF), or tabix file import, http://bioconductor.org/packages/release/bioc/html/Rsamtools.html

Examples

Run this code
library(Rsamtools)
filename <- system.file( "extdata", "example.bam", package = "wavClusteR" )
sortedBam <- readSortedBam( filename = filename )

Run the code above in your browser using DataLab