The function extractBamRegions
writes aligns or
some part of the stored aligns in a BAM file as reads into a
BAM output file.
extractBamRegions(bamFiles, ranges, idxFiles, outFiles)
character
: Vector of BAM file names.
data.frame
: Must contain three columns
seqid
, start
and end
. The seqid
character
: Vector of BAM index file names.
character
: Vector of output file names.
No return value given
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.
# 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