agiFromBam: Create AlignedGenomeIntervals objects from BAM files.

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/input.R

Description

Function to create AlignedGenomeIntervals objects from BAM (binary alignment map format) files. Uses functions from package Rsamtools to parse BAM files.

Usage

1
agiFromBam(bamfile, ...)

Arguments

bamfile

File path of BAM file. BAM file should be sorted and have an index in the same directory (see Details below).

...

further arguments passed on to function scanBam

Details

Note: the BAM files must be sorted and must also have an index file (*.bai) in the same directory. These should be done when creating the BAM. However, the functions sortBam and indexBam can be used for the same purpose, as can the respective modules of the “samtools” library (‘samtools sort’ and ‘samtools index’).

The BAM files are parsed chromosome by chromosome to limit the memory footprint of the function. Thus, this function aims to be a less-memory-consuming alternative to first reading in the BAM file using the readAligned function and then converting the AlignedRead object into an AlignedGenomeIntervals object.

Value

An object of class AlignedGenomeIntervals.

Author(s)

J Toedling

References

http://samtools.sourceforge.net

See Also

scanBam, AlignedGenomeIntervals-class

Examples

1
2
3
  fl <- system.file("extdata", "ex1.bam", package="Rsamtools")
  ExGi <- agiFromBam(fl)
  head(detail(ExGi))

girafe documentation built on Nov. 8, 2020, 4:56 p.m.