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

BAM2GenomicRangesR Documentation

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

  ## S4 method for signature 'character'
BAM2GRanges(path, what = character(),
      flag = scanBamFlag(isUnmappedQuery = FALSE, isDuplicate = FALSE),
      verbose = TRUE)
  ## S4 method for signature 'character'
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.

Author(s)

Dario Strbenac

Examples

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

markrobinsonuzh/Repitools documentation built on March 20, 2024, 6:04 a.m.