merge_bam: Merge BAM files

View source: R/merge_bam.R

merge_bamR Documentation

Merge BAM files

Description

If >1 BAM file provided, merges them into a single BAM file using mergeBam.

Usage

merge_bam(
  bam_files,
  destination = tempfile(fileext = ".merged.bam"),
  overwrite = TRUE,
  verbose = TRUE
)

Arguments

bam_files

One or more BAM files.

destination

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.

overwrite

A logical(1) indicating whether the destination can be over-written if it already exists.

verbose

Print messages.

Value

Path to merged BAM file.

Examples

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)

neurogenomics/PeakyFinders documentation built on March 24, 2024, 4:28 p.m.