bamSave: Creation of a sorted copy of a BAM file.

Share:

Description

The methods for bamSave write BAM alignment data (either single alignments as bamAlign objects or lists of alignments as bamRange objects) out to a bamWriter.

Usage

1
bamSave(object, value, refid, ...)

Arguments

object

bamWriter. The writer must be opened.

value

Object of type bamAlign or bamRange.

refid

(Optional) Defines sequence association (ID) in Reference sequence dictionary of output BAM file. May be given as numeric, or character. When missing, ID is determined from reference name (only for bamRange).

...

Currently unused.

Details

The different methods specialize on different methods for determining the Reference sequence ID in the output file.

Author(s)

Wolfgang Kaisers

Examples

1
2
3
4
5
6
7
8
9
bam<-system.file("extdata","accepted_hits.bam",package="rbamtools")
reader<-bamReader(bam, idx=TRUE)
rg <- bamRange(reader, getRefCoords(reader,"chr1"))
## Not run: 
writer <- bamWriter(bamReader, "out.BAM")
bamSave(writer, rg)
bamClose(writer)

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.