Merge multiple .bam filesSource:
This function merges .bam files. It first used the combined_header function to generate a combined header for all the files, reheaders the files, and then merges and sorts the .bam files. It is similar to the 'samtools merge' function, but it allows the .bam files to have different headers. It is not intended for direct use.
merge_bam_files( bam_files, destination, head_file = paste(destination, "_header.sam", sep = ""), quiet )
A list of file names for the .bam files to be merged.
A file name and location for the merged .bam file.
A file name and location for the combined header file. Defaults to the destination. For example, 'example.bam' will be written as 'example.bam'.
Turns off most messages. Default is