readSortedBam: Load a sorted BAM file

Description Usage Arguments Value Note Author(s) References Examples

View source: R/readSortedBam.R

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

1
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 or IntegerRangesList 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

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

wavClusteR documentation built on Nov. 8, 2020, 6:54 p.m.