BAMSORMADUP(1)

πŸ’– BAMSORMADUP πŸ’–

okay bestie, welcome to bamsormadup from the BIOBAMBAM collection, a General Commands Manual page that has been waiting its whole life for you to read it. she sorts SAM/BAM files by coordinate and marks duplicates, OR sorts them by query name. two moods. one icon. let's go πŸ¦‹


✨ SYNOPSIS ✨

bamsormadup [options]

like, that's it. that's the whole summoning ritual. no positional args, no drama, just vibes and options.


🌸 DESCRIPTION 🌸

okay so bamsormadup has two modes of operation depending on the value of the SO parameter, and which one you get is literally the whole personality of your run.

Mode one, the main character mode: if SO=coordinate, or if the SO key is just… not given at all (no thoughts, head empty, default behaviour), then bamsormadup reads a name collated BAM or SAM file from standard input, runs a fix mate process, sorts the contained alignments by coordinate, marks duplicate alignments, and writes the sorted alignments to standard output in BAM format. and bestie, an alignment file is "name collated" if all the alignments for one read name appear consecutively in the file. that's the whole definition, no cap.

Mode two, the plot twist: if SO=queryname, then the program reads a BAM or SAM file from standard input, sorts it by queryname, and writes the sorted file on standard output in BAM format. no name-collation assumption, just pure sorting energy.

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 (raw, feral, zero bytes squeezed)
    • 1: zlib/gzip level 1 (fast) compression
    • 9: zlib/gzip level 9 (best) compression

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
  • inputformat=<bam> β€” set the input file format. This can be either bam or sam (see http://samtools.sourceforge.net/SAM1.pdf).
  • threads=<[1]> β€” number of threads used. yes queen, go parallel.
  • M=<stderr> β€” name of the metrics file for duplicate marking. metrics are written to standard error if this is not set.
  • tmpfile=<bamsormadup_hostname_pid_starttime> β€” prefix for temporary files. by default the temporary files are created in the current directory. Set tmpfile=mem:tmp_ to store temporary files in RAM instead of on disk.
⚠️ note that this may require very large amounts of RAM depending on the input. like, terrifying amounts. proceed with caution bestie 😭
  • SO=<coordinate|queryname> β€” set the sort order. valid values are:
    • coordinate β€” sort alignments by coordinate. input is assumed to be name collated.
    • queryname β€” sort alignments by query name. no assumption is made on the order of the input. free spirit behaviour.
  • reference=<> β€” name of reference FastA file when writing CRAM. This file will be used for filling missing UR and M5 fields of SQ header lines. It may refer to a local file or a file stored on an http or ftp server. The file is uncompressed on the fly if the file name ends on .gz. If the REF_CACHE environment variable is set to the name of an existing directory, then normalised cache files will be written to this directory for each reference sequence. The file names are constructed from the directory name and the MD5 checksum of each reference sequence. This writing of cached files is omitted however, if a previously existing file is found in the list of read only cache locations given by the REF_PATH environment variable. 🧚 (yes, that's two env vars and a whole caching policy, we love a lore drop)
  • optminpixeldif=<100> β€” distance (x and y inside same tile) inside which reads are considered as optical duplicates. it's giving "how close is too close" πŸ’…
  • rcsupport==<0> β€” if 1 then create rc aux field (unclipped coordinate) for mapped reads when sorting from query to coordinate order.
  • numerical==<> β€” store numerical index in the given file. By default numerical index is not stored.
  • numericalindexmod=1024 β€” use this block size for producing numerical index.
  • fragmergepar=1 β€” number of threads used for merging fragment lists in duplicate marking. The run-time will generally benefit from an increased number here, but parallel merging requires a large number of simultaneously open files, which will cause problems on some systems.
🫢 real talk: crank it up for speed, but watch your file descriptor limits, because your OS will simply say no.
  • crammode= β€” CRAM encoding profile. See the documentation for the scramble program for possible options.

πŸ‘‘ AUTHOR πŸ‘‘

Written by German Tischler.


πŸ› REPORTING BUGS πŸ›

Report bugs to <germant@miltenyibiotec.de>

like, be nice about it, but also please do report them πŸ’œ


Copyright Β© 2009-2015 German Tischler, Β© 2011-2015 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.


and that's the whole page, bestie!! ✨ this was BAMSORMADUP(1) from the BIOBAMBAM set, dated April 2015. go sort something gorgeous πŸŽ€πŸ’–