If >1 BAM file provided, merges them into a single BAM file using mergeBam.
merge_bam(
bam_files,
destination = tempfile(fileext = ".merged.bam"),
overwrite = TRUE,
verbose = TRUE
)One or more BAM files.
The character(1) file name of the location where
the sorted, filtered, or merged output file will be created. For
asBam asSam, and sortBam this is without the
“.bam” file suffix.
A logical(1) indicating whether the destination can be over-written if it already exists.
Print messages.
Path to merged BAM file.
bam_files <- c(system.file("extdata", "querybins.bam", package="Rsamtools"),
system.file("extdata", "revbins.bam", package="Rsamtools"))
bam_merged <- merge_bam(bam_files = bam_files)
#> Merging 2 BAM files.
#> Merging bam: done in 0 min