samtools cat [-b list] [-h header.sam] [-o out.bam] in1.bam in2.bam [ ... ]
Concatenate BAMs or CRAMs. Although this works on either BAM or CRAM, all input files must be the same format as each other. The sequence dictionary of each input file must be identical, although this command does not check this. This command uses a similar trick to reheader which enables fast BAM concatenation.
Read the list of input BAM or CRAM files from FOFN. These are concatenated prior to any files specified on the command line. Multiple -b FOFN options may be specified to concatenate multiple lists of BAM/CRAM files.
Uses the SAM header from FILE. By default the header is taken from the first file to be concatenated.
Write the concatenated output to FILE. By default this is sent to stdout.
Do not add a @PG line to the header of the output file.
Number of input/output compression threads to use in addition to main thread .
Written by Heng Li from the Sanger Institute.
Samtools website: <http://www.htslib.org/>
Copyright © 2021 Genome Research Limited (reg no. 2742969) is a charity registered in England with number 1021457. Terms and conditions.