readBamFileAsGRanges: Import BAM file into GRanges

Description Usage Arguments Value Author(s) Examples

View source: R/importReads.R

Description

Import aligned reads from a BAM file into a GRanges object.

Usage

1
2
3
readBamFileAsGRanges(file, bamindex = file, chromosomes = NULL,
  pairedEndReads = FALSE, min.mapq = 10,
  remove.duplicate.reads = TRUE, pair2frgm = FALSE, filtAlt = FALSE)

Arguments

file

Bamfile with aligned reads.

bamindex

Bam-index file with or without the .bai ending. If this file does not exist it will be created and a warning is issued.

chromosomes

If only a subset of the chromosomes should be binned, specify them here.

pairedEndReads

Set to TRUE if you have paired-end reads in your file.

min.mapq

Minimum mapping quality when importing from BAM files.

remove.duplicate.reads

A logical indicating whether or not duplicate reads should be kept.

pair2frgm

Set to TRUE if every paired-end read should be merged into a single fragment.

filtAlt

Set to TRUE if you want to filter out alternative alignments defined in 'XA' tag.

Value

A GRanges object.

Author(s)

David Porubsky, Aaron Taudt, Ashley Sanders

Examples

1
2
3
4
5
## Get an example file 
exampleFolder <- system.file("extdata", "example_bams", package="strandseqExampleData")
exampleFile <- list.files(exampleFolder, full.names=TRUE)[1]
## Load the file
gr <- readBamFileAsGRanges(exampleFile, pairedEndReads=FALSE)

daewoooo/SaaRclust documentation built on May 28, 2019, 7:50 p.m.