Learn R Programming

rbamtools (version 2.16.17)

extractBamRegions: 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.

Value

No return value given

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.

Examples

Run this code
# NOT RUN {
bam<-system.file("extdata","accepted_hits.bam",package="rbamtools")
gene_pos <- data.frame(seqid="chr1", start=15e3, end=20e3)
# }
# NOT RUN {
extractBamRegions(bam, gene_pos)
# }

Run the code above in your browser using DataLab