BAM12AUXMERGE(1)
π BAM12AUXMERGE(1) π
okay bestie, gather round, because this is the bam12auxmerge manual page from the Biobambam family and it's literally the glue that squishes two BAM files into one π«Ά
β¨ NAME β¨
bam12auxmerge β merge two BAM files π
πΈ SYNOPSIS πΈ
bam12auxmerge [options] <input.bam>
π¦ DESCRIPTION π¦
So bam12auxmerge takes the contents of two BAM files that hold the same set of reads and merges them together into one BAM file. Cute, right? It reads one of those BAM files from standard input, and the other one you hand over by its file name. Two files, one output, main character energy π
It is assumed that the file (A) β the one you give by file name β was obtained by processing another BAM file through this sequence:
bamcollate2 collate=1 | bamcollate2 collate=2
where the first run of bamcollate2 makes sure that the ends of pairs appear adjacently, and the second run attaches rank pairs to the read names. no cap, that's just the pipeline π
The other file (B), which bam12auxmerge reads via standard input, is assumed to be a (re)aligned version of file (A), and it's processed by
bamsort SO=queryname
right before being passed to bam12auxmerge. iconic.
This preprocessing is what ensures bam12auxmerge observes the reads in the same order, with the possibility of file (B) containing multiple lines for each read (i.e. secondary alignments). lowkey essential.
Now, the merging itself: bam12auxmerge merges the SAM headers of (A) and (B) by starting with the header for (B) and prepending the PG type lines from (A), thus restoring the full history of the file to (B). Alignments get merged by inserting the auxiliary tags from lines in (A) into the corresponding lines in (B). And priority here goes to (B) β so if a tag appears in both, the version in (B) will be retained. (B) said "mine" and we respect it π
The following key=value pairs can be given:
level=<-1|0|1|9|11>β set the compression level of the output BAM file. Valid values are:-1: zlib/gzip default compression level0: uncompressed1: zlib/gzip level 1 (fast) compression9: zlib/gzip level 9 (best) compression
And if libmaus has been compiled with support for igzip (see <https://software.intel.com/en-us/articles/igzip-a-high-performance-deflate-compressor-with-optimizations-for-genomic-data>), then an additional valid value is:
11: igzip compression
verbose=<1>β valid values are:1: print progress report on standard error (default)0: do not print progress report
mod=<1048576>β print progress report after processing eachmod'th alignment, ifverboseis active. πranksplit=<1>β split rank pairs into single ranks per read/alignment. This acts like preprocessing the file withbam12splitbefore handing it tobam12auxmerge.rankstrip=<1>β strip ranks from reads/alignments. This acts like postprocessing the file withbam12stripafter handing it tobam12auxmerge.clipreinsert=<1>β reinsert clipped sequence and quality string parts while marking them as soft clipped. This acts like postprocessing the file withbamclipreinsertafter handing it tobam12auxmerge.zztoname=<1>β insert the rank stored in thezzauxiliary field to the name as a prefix, and remove thezzauxiliary field. This acts like postprocessing the file withbamzztonameafter handing it tobam12auxmerge.tmpfile=<filename>β prefix for temporary files. By default the temporary files are created in the current directory.md5=<0|1>β md5 checksum creation for the output file. Valid values are:0: do not compute checksum. This is the default.1: compute checksum. If themd5filenamekey is set, then the checksum is written to the given file. Ifmd5filenameis unset, then no checksum will be computed.
md5filenameβ file name for md5 checksum ifmd5=1.index=<0|1>β compute BAM index for the output file. Valid values are:0: do not compute BAM index. This is the default.1: compute BAM index. If theindexfilenamekey is set, then the BAM index is written to the given file. Ifindexfilenameis unset, then no BAM index will be computed.
indexfilenameβ file name for BAM index ifindex=1.
π AUTHOR π
Written by German Tischler. π«Ά
π REPORTING BUGS π
Report bugs to <germant@miltenyibiotec.de> β please be nice, they're doing their best π
π COPYRIGHT π
Copyright Β© 2009-2013 German Tischler, Β© 2011-2013 Genome Research Limited.
License GPLv3+: GNU GPL version 3 <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. π (fr fr, no warranty, read it and weep)
and that's the whole page bestie, you ate that π β¨ this one's from the BIOBAMBAM collection, dated July 2013 β vintage but still slaying ππ¦
π¦ where this page comes from
- debian bookworm: biobambam2 2.0.185+ds-1 Β· GPL-3.0-or-later
- debian trixie: biobambam2 2.0.185+ds-2 Β· GPL-3.0-or-later
- ubuntu jammy: biobambam2 2.0.183+ds-1 Β· GPL-3.0-or-later
- ubuntu noble: biobambam2 2.0.185+ds-1 Β· GPL-3.0-or-later
- ubuntu questing: biobambam2 2.0.185+ds-2
- ubuntu resolute: biobambam2 2.0.185+ds-2build1 Β· GPL-3.0-or-later
- ubuntu stonking: biobambam2 2.0.185+ds-2build1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms