R: extractBamRegions: Extraction of alignments from given...

extractBamRegions {rbamtools} | R Documentation

## extractBamRegions: Extraction of alignments from given (genetic) regions and BAM files into a set of output BAM files..

### Description

The function `extractBamRegions` writes aligns or some part of the stored aligns in a BAM file as reads into a BAM output file.

### Usage

    extractBamRegions(bamFiles, ranges, idxFiles, outFiles)

### Arguments

`bamFiles` | `character`: Vector of BAM file names.

`ranges` | `data.frame`: Must contain three columns `seqid`, `start` and `end`. The seqid

`idxFiles` | `character`: Vector of BAM index file names.

`outFiles` | `character`: Vector of output file names.

### Details

bamFiles, idxFiles and outFiles are checked for equal length. bamFiles and idxFiles are checked for existance. There are sensible default values given for idxFiles and outFiles. The default location for writing output files is the current working directory.

### Value

No return value given

### Author(s)

Wolfgang Kaisers

### Examples

    bam<-system.file("extdata","accepted_hits.bam",package="rbamtools")
    gene_pos <- data.frame(seqid="chr1", start=15e3, end=20e3)
    extractBamRegions(bam, gene_pos)

[Package rbamtools version 2.16.17 Index]