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 level
    • 0: uncompressed
    • 1: zlib/gzip level 1 (fast) compression
    • 9: 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 each mod'th alignment, if verbose is active. πŸ“
  • ranksplit=<1> β€” split rank pairs into single ranks per read/alignment. This acts like preprocessing the file with bam12split before handing it to bam12auxmerge.
  • rankstrip=<1> β€” strip ranks from reads/alignments. This acts like postprocessing the file with bam12strip after handing it to bam12auxmerge.
  • clipreinsert=<1> β€” reinsert clipped sequence and quality string parts while marking them as soft clipped. This acts like postprocessing the file with bamclipreinsert after handing it to bam12auxmerge.
  • zztoname=<1> β€” insert the rank stored in the zz auxiliary field to the name as a prefix, and remove the zz auxiliary field. This acts like postprocessing the file with bamzztoname after handing it to bam12auxmerge.
  • 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 the md5filename key is set, then the checksum is written to the given file. If md5filename is unset, then no checksum will be computed.
  • md5filename β€” file name for md5 checksum if md5=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 the indexfilename key is set, then the BAM index is written to the given file. If indexfilename is unset, then no BAM index will be computed.
  • indexfilename β€” file name for BAM index if index=1.

πŸ‘‘ AUTHOR πŸ‘‘

Written by German Tischler. 🫢


😭 REPORTING BUGS 😭

Report bugs to <germant@miltenyibiotec.de> β€” please be nice, they're doing their best πŸ™ˆ


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 πŸŽ€πŸ¦‹