BAMSEQCHKSUM(1)

πŸ’– BAMSEQCHKSUM πŸ’–

okay bestie, welcome to bamseqchksum(1) β€” she's a checksum girlie and she's about to eat πŸ’…


✨ NAME ✨

bamseqchksum β€” produce checksums for primary data in BAM files 🧬


🌸 SYNOPSIS 🌸

bamseqchksum [options]

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the vibe: bamseqchksum reads a BAM file from stdin, and for every single record it calculates hash digest checksums over these four things:

  1. [1] β€” flags and sequence
  2. [2] β€” queryname, flags and sequence
  3. [3] β€” flags, sequence and qualities
  4. [4] β€” flags, sequence and source data related aux tags

and when we say "the flags" we mean the least significant byte of the BAM FLAGS, containing only the bits for multiple segments, first segment and last segment. No extras, she's picky. 🌟

Also important, no cap: the sequence gets reverse complemented, and the quality string gets reversed, before checksumming β€” but only if the reverse complemented bit is set. iykyk.

Depending on which hash digest function you picked, either the sum modulo some power of 2 or the product modulo a prime number of these checksums is taken over all non-supplementary and non-secondary BAM alignment records. And you get separate sums or products reported for combinations of all and QC pass records, and for each readgroup. Yes ma'am, organised. πŸŽ€

The following key=value pairs can be given:

  • verbose=<0> β€” valid values are:
    • 1 β€” print progress report on standard error
    • 0 β€” do not print progress report
  • inputformat=<bam> β€” the input file format. All versions of bamseqchksum come with support for the BAM input format. But if the program is in addition linked to the io_lib package, then the following options are valid:
  • reference= β€” file name of the reference for CRAM input files. If this key is unset, then the CRAM file header will be scanned for obtaining a reference file name. πŸ”
  • hash=<crc32prod> β€” the hash digest used to compute checksums. All versions of biobambam support the following functions:
    • crc32prod β€” checksums are computed via crc32 and combined over multiple records by multiplication modulo the prime number 2^31-1. This is the default and only option for biobambam versions up to 0.0.174. πŸ‘‘
    • crc32 β€” checksums are computed via crc32 and combined by summing up modulo 2^32.
    • md5 β€” checksums are computed via md5 and combined by summing up modulo 2^128.
    • crc32prime32 β€” identical with crc32prod (alternate implementation for testing purposes)
    • crc32prime64 β€” checksums are computed via crc32 and combined over multiple records by multiplication modulo the prime number 2^64-59.
    • md5prime64 β€” checksums are computed via md5 and combined over multiple records by multiplication modulo the prime number 2^64-59.
    • crc32prime96 β€” checksums are computed via crc32 and combined over multiple records by multiplication modulo the prime number 2^96-17.
    • md5prime96 β€” checksums are computed via md5 and combined over multiple records by multiplication modulo the prime number 2^96-17.
    • crc32prime128 β€” checksums are computed via crc32 and combined over multiple records by multiplication modulo the prime number 2^128-159.
    • md5prime128 β€” checksums are computed via md5 and combined over multiple records by multiplication modulo the prime number 2^128-159.
    • crc32prime160 β€” checksums are computed via crc32 and combined over multiple records by multiplication modulo the prime number 2^160-47.
    • md5prime160 β€” checksums are computed via md5 and combined over multiple records by multiplication modulo the prime number 2^160-47.
    • crc32prime192 β€” checksums are computed via crc32 and combined over multiple records by multiplication modulo the prime number 2^192-237.
    • md5prime192 β€” checksums are computed via md5 and combined over multiple records by multiplication modulo the prime number 2^192-237.
    • crc32prime224 β€” checksums are computed via crc32 and combined over multiple records by multiplication modulo the prime number 2^224-63.
    • md5prime224 β€” checksums are computed via md5 and combined over multiple records by multiplication modulo the prime number 2^224-63.
    • crc32prime256 β€” checksums are computed via crc32 and combined over multiple records by multiplication modulo the prime number 2^256-189.
    • md5prime256 β€” checksums are computed via md5 and combined over multiple records by multiplication modulo the prime number 2^256-189.
    • null β€” no checksums are computed and all checksums in the program's output are 0. This option is for performance testing only. Do not use this for real, bestie, I'm begging. 😭

If libmaus is compiled with support for the nettle library, then the following options are available:

  • sha1 β€” checksums are computed via sha1 and combined by summing up modulo 2^160.
  • sha1prime64 β€” checksums are computed via sha1 and combined over multiple records by multiplication modulo the prime number 2^64-59.
  • sha1prime96 β€” checksums are computed via sha1 and combined over multiple records by multiplication modulo the prime number 2^96-17.
  • sha1prime128 β€” checksums are computed via sha1 and combined over multiple records by multiplication modulo the prime number 2^128-159.
  • sha1prime160 β€” checksums are computed via sha1 and combined over multiple records by multiplication modulo the prime number 2^160-47.
  • sha1prime192 β€” checksums are computed via sha1 and combined over multiple records by multiplication modulo the prime number 2^192-237.
  • sha1prime224 β€” checksums are computed via sha1 and combined over multiple records by multiplication modulo the prime number 2^224-63.
  • sha1prime256 β€” checksums are computed via sha1 and combined over multiple records by multiplication modulo the prime number 2^256-189.
  • sha224 β€” checksums are computed via sha2-224 and combined by summing up modulo 2^224.
  • sha224prime64 β€” checksums are computed via sha2-224 and combined over multiple records by multiplication modulo the prime number 2^64-59.
  • sha224prime96 β€” checksums are computed via sha2-224 and combined over multiple records by multiplication modulo the prime number 2^96-17.
  • sha224prime128 β€” checksums are computed via sha2-224 and combined over multiple records by multiplication modulo the prime number 2^128-159.
  • sha224prime160 β€” checksums are computed via sha2-224 and combined over multiple records by multiplication modulo the prime number 2^160-47.
  • sha224prime192 β€” checksums are computed via sha2-224 and combined over multiple records by multiplication modulo the prime number 2^192-237.
  • sha224prime224 β€” checksums are computed via sha2-224 and combined over multiple records by multiplication modulo the prime number 2^224-63.
  • sha224prime256 β€” checksums are computed via sha2-224 and combined over multiple records by multiplication modulo the prime number 2^256-189.
  • sha256 β€” checksums are computed via sha2-256 and combined by summing up modulo 2^256.
  • sha256prime64 β€” checksums are computed via sha2-256 and combined over multiple records by multiplication modulo the prime number 2^64-59.
  • sha256prime96 β€” checksums are computed via sha2-256 and combined over multiple records by multiplication modulo the prime number 2^96-17.
  • sha256prime128 β€” checksums are computed via sha2-256 and combined over multiple records by multiplication modulo the prime number 2^128-159.
  • sha256prime160 β€” checksums are computed via sha2-256 and combined over multiple records by multiplication modulo the prime number 2^160-47.
  • sha256prime192 β€” checksums are computed via sha2-256 and combined over multiple records by multiplication modulo the prime number 2^192-237.
  • sha256prime224 β€” checksums are computed via sha2-256 and combined over multiple records by multiplication modulo the prime number 2^224-63.
  • sha256prime256 β€” checksums are computed via sha2-256 and combined over multiple records by multiplication modulo the prime number 2^256-189.
  • sha384 β€” checksums are computed via sha2-384 and combined by summing up modulo 2^384.
  • sha384prime64 β€” checksums are computed via sha2-384 and combined over multiple records by multiplication modulo the prime number 2^64-59.
  • sha384prime96 β€” checksums are computed via sha2-384 and combined over multiple records by multiplication modulo the prime number 2^96-17.
  • sha384prime128 β€” checksums are computed via sha2-384 and combined over multiple records by multiplication modulo the prime number 2^128-159.
  • sha384prime160 β€” checksums are computed via sha2-384 and combined over multiple records by multiplication modulo the prime number 2^160-47.
  • sha384prime192 β€” checksums are computed via sha2-384 and combined over multiple records by multiplication modulo the prime number 2^192-237.
  • sha384prime224 β€” checksums are computed via sha2-384 and combined over multiple records by multiplication modulo the prime number 2^224-63.
  • sha384prime256 β€” checksums are computed via sha2-384 and combined over multiple records by multiplication modulo the prime number 2^256-189.
  • sha512 β€” checksums are computed via sha2-512 and combined by summing up modulo 2^512.
  • sha512prime64 β€” checksums are computed via sha2-512 and combined over multiple records by multiplication modulo the prime number 2^64-59.
  • sha512prime96 β€” checksums are computed via sha2-512 and combined over multiple records by multiplication modulo the prime number 2^96-17.
  • sha512prime128 β€” checksums are computed via sha2-512 and combined over multiple records by multiplication modulo the prime number 2^128-159.
  • sha512prime160 β€” checksums are computed via sha2-512 and combined over multiple records by multiplication modulo the prime number 2^160-47.
  • sha512prime192 β€” checksums are computed via sha2-512 and combined over multiple records by multiplication modulo the prime number 2^192-237.
  • sha512prime224 β€” checksums are computed via sha2-512 and combined over multiple records by multiplication modulo the prime number 2^224-63.
  • sha512prime256 β€” checksums are computed via sha2-512 and combined over multiple records by multiplication modulo the prime number 2^256-189.
  • sha512primesums β€” checksums get computed via sha2-512, then combined across multiple records by adding modulo the Mersenne prime number 2^521-1. math girlies rise πŸ’…
  • sha512primesums512 β€” same sha2-512 energy, but the combining-over-multiple-records step adds modulo 2^512-75. lowkey a different vibe, same algorithm ✨
  • murmur3 β€” checksums are computed via MurmurHash3_x64_128 (peep the source: https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp) and combined over multiple records by summing modulo 2^128. it's giving fast and furious fr fr πŸ”₯
  • murmur3primesums128 β€” checksums are computed via MurmurHash3_x64_128 (again, https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp) and combined over multiple records by summing modulo 2^128+51. yes bestie, the +51 matters, no cap πŸ’–

πŸ‘‘ AUTHOR πŸ‘‘

Written by David Jackson (using code by German Tischler as a template). Extended to hash digests beyond crc32prod by German Tischler.

okay so two icons collaborated on this one, we love to see it 🫢


πŸ› REPORTING BUGS πŸ›

Report bugs to <germant@miltenyibiotec.de>

if something's cursed, don't suffer in silence, tell them directly πŸ™ˆ


Copyright Β© 2014-2014 David Jackson, Β© 2014-2014 Genome Research Limited. Copyright Β© 2009-2016 German Tischler, Β© 2011-2014 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.

⚠️ real talk: NO WARRANTY, like at all, to the extent permitted by law. free as in freedom, not as in "someone will fix it for you" πŸ’€

and that's the whole page bestie!! this iconic lil manual comes from BIOBAMBAM and it's dated March 2014 β€” go forth and checksum responsibly, mwah πŸ’–πŸŽ€πŸ¦‹