Learn R Programming

Repitools (version 1.18.0)

BAM2GenomicRanges: Read in a (list of) BAM file(s) into a GRanges(List) object.

Description

A wrapper script for coverting the contents of BAM files for use with GenomicRanges classes.

Usage

"BAM2GRanges"(path, what = character(), flag = scanBamFlag(isUnmappedQuery = FALSE, isDuplicate = FALSE), verbose = TRUE) "BAM2GRangesList"(paths, what = character(), flag = scanBamFlag(isUnmappedQuery = FALSE, isDuplicate = FALSE), verbose = TRUE)

Arguments

path
A character vector of length 1. The path of the BAM file.
paths
A character vector of possibly any length. The paths of the BAM files.
what
What optional attributes of a read to retain. See scanBam and the value section.
flag
What kinds of reads to retain. See ScanBamParam and the flag argument.
verbose
Whether to print the progess of processing.

Value

For the single pathname method; a GRanges object. For the multiple pathnames method; a GRangesList object.

Examples

Run this code
  tiny.BAM <- system.file("extdata", "ex1.bam", package = "Rsamtools")
  if(length(tiny.BAM) > 0)
    print(BAM2GRanges(tiny.BAM))

Run the code above in your browser using DataLab