readSortedBam {wavClusteR} | R Documentation

## 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)

### Note

The input BAM file must be sorted and indexed. Alignment with bowtie or bowtie2, conversion from SAM to BAM output, sorting and indexing using SAMtools is recommended.

### Author(s)

Federico Comoglio

### 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

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

[Package wavClusteR version 2.12.1 Index]