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]β flags and sequence[2]β queryname, flags and sequence[3]β flags, sequence and qualities[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 error0β do not print progress report
inputformat=<bam>β the input file format. All versions ofbamseqchksumcome with support for the BAM input format. But if the program is in addition linked to theio_libpackage, then the following options are valid:bamβ BAM (seehttp://samtools.sourceforge.net/SAM1.pdf)samβ SAM (seehttp://samtools.sourceforge.net/SAM1.pdf)cramβ CRAM (seehttp://www.ebi.ac.uk/ena/about/cram_toolkit)
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 ofbiobambamsupport the following functions:crc32prodβ checksums are computed viacrc32and combined over multiple records by multiplication modulo the prime number2^31-1. This is the default and only option for biobambam versions up to0.0.174. πcrc32β checksums are computed viacrc32and combined by summing up modulo2^32.md5β checksums are computed viamd5and combined by summing up modulo2^128.crc32prime32β identical withcrc32prod(alternate implementation for testing purposes)crc32prime64β checksums are computed viacrc32and combined over multiple records by multiplication modulo the prime number2^64-59.md5prime64β checksums are computed viamd5and combined over multiple records by multiplication modulo the prime number2^64-59.crc32prime96β checksums are computed viacrc32and combined over multiple records by multiplication modulo the prime number2^96-17.md5prime96β checksums are computed viamd5and combined over multiple records by multiplication modulo the prime number2^96-17.crc32prime128β checksums are computed viacrc32and combined over multiple records by multiplication modulo the prime number2^128-159.md5prime128β checksums are computed viamd5and combined over multiple records by multiplication modulo the prime number2^128-159.crc32prime160β checksums are computed viacrc32and combined over multiple records by multiplication modulo the prime number2^160-47.md5prime160β checksums are computed viamd5and combined over multiple records by multiplication modulo the prime number2^160-47.crc32prime192β checksums are computed viacrc32and combined over multiple records by multiplication modulo the prime number2^192-237.md5prime192β checksums are computed viamd5and combined over multiple records by multiplication modulo the prime number2^192-237.crc32prime224β checksums are computed viacrc32and combined over multiple records by multiplication modulo the prime number2^224-63.md5prime224β checksums are computed viamd5and combined over multiple records by multiplication modulo the prime number2^224-63.crc32prime256β checksums are computed viacrc32and combined over multiple records by multiplication modulo the prime number2^256-189.md5prime256β checksums are computed viamd5and combined over multiple records by multiplication modulo the prime number2^256-189.nullβ no checksums are computed and all checksums in the program's output are0. 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 viasha1and combined by summing up modulo2^160.sha1prime64β checksums are computed viasha1and combined over multiple records by multiplication modulo the prime number2^64-59.sha1prime96β checksums are computed viasha1and combined over multiple records by multiplication modulo the prime number2^96-17.sha1prime128β checksums are computed viasha1and combined over multiple records by multiplication modulo the prime number2^128-159.sha1prime160β checksums are computed viasha1and combined over multiple records by multiplication modulo the prime number2^160-47.sha1prime192β checksums are computed viasha1and combined over multiple records by multiplication modulo the prime number2^192-237.sha1prime224β checksums are computed viasha1and combined over multiple records by multiplication modulo the prime number2^224-63.sha1prime256β checksums are computed viasha1and combined over multiple records by multiplication modulo the prime number2^256-189.sha224β checksums are computed viasha2-224and combined by summing up modulo2^224.sha224prime64β checksums are computed viasha2-224and combined over multiple records by multiplication modulo the prime number2^64-59.sha224prime96β checksums are computed viasha2-224and combined over multiple records by multiplication modulo the prime number2^96-17.sha224prime128β checksums are computed viasha2-224and combined over multiple records by multiplication modulo the prime number2^128-159.sha224prime160β checksums are computed viasha2-224and combined over multiple records by multiplication modulo the prime number2^160-47.sha224prime192β checksums are computed viasha2-224and combined over multiple records by multiplication modulo the prime number2^192-237.sha224prime224β checksums are computed viasha2-224and combined over multiple records by multiplication modulo the prime number2^224-63.sha224prime256β checksums are computed viasha2-224and combined over multiple records by multiplication modulo the prime number2^256-189.sha256β checksums are computed viasha2-256and combined by summing up modulo2^256.sha256prime64β checksums are computed viasha2-256and combined over multiple records by multiplication modulo the prime number2^64-59.sha256prime96β checksums are computed viasha2-256and combined over multiple records by multiplication modulo the prime number2^96-17.sha256prime128β checksums are computed viasha2-256and combined over multiple records by multiplication modulo the prime number2^128-159.sha256prime160β checksums are computed viasha2-256and combined over multiple records by multiplication modulo the prime number2^160-47.sha256prime192β checksums are computed viasha2-256and combined over multiple records by multiplication modulo the prime number2^192-237.sha256prime224β checksums are computed viasha2-256and combined over multiple records by multiplication modulo the prime number2^224-63.sha256prime256β checksums are computed viasha2-256and combined over multiple records by multiplication modulo the prime number2^256-189.sha384β checksums are computed viasha2-384and combined by summing up modulo2^384.sha384prime64β checksums are computed viasha2-384and combined over multiple records by multiplication modulo the prime number2^64-59.sha384prime96β checksums are computed viasha2-384and combined over multiple records by multiplication modulo the prime number2^96-17.sha384prime128β checksums are computed viasha2-384and combined over multiple records by multiplication modulo the prime number2^128-159.sha384prime160β checksums are computed viasha2-384and combined over multiple records by multiplication modulo the prime number2^160-47.sha384prime192β checksums are computed viasha2-384and combined over multiple records by multiplication modulo the prime number2^192-237.sha384prime224β checksums are computed viasha2-384and combined over multiple records by multiplication modulo the prime number2^224-63.sha384prime256β checksums are computed viasha2-384and combined over multiple records by multiplication modulo the prime number2^256-189.sha512β checksums are computed viasha2-512and combined by summing up modulo2^512.sha512prime64β checksums are computed viasha2-512and combined over multiple records by multiplication modulo the prime number2^64-59.sha512prime96β checksums are computed viasha2-512and combined over multiple records by multiplication modulo the prime number2^96-17.sha512prime128β checksums are computed viasha2-512and combined over multiple records by multiplication modulo the prime number2^128-159.sha512prime160β checksums are computed viasha2-512and combined over multiple records by multiplication modulo the prime number2^160-47.sha512prime192β checksums are computed viasha2-512and combined over multiple records by multiplication modulo the prime number2^192-237.sha512prime224β checksums are computed viasha2-512and combined over multiple records by multiplication modulo the prime number2^224-63.sha512prime256β checksums are computed viasha2-512and combined over multiple records by multiplication modulo the prime number2^256-189.
sha512primesumsβ checksums get computed viasha2-512, then combined across multiple records by adding modulo the Mersenne prime number2^521-1. math girlies rise πsha512primesums512β samesha2-512energy, but the combining-over-multiple-records step adds modulo2^512-75. lowkey a different vibe, same algorithm β¨murmur3β checksums are computed viaMurmurHash3_x64_128(peep the source:https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp) and combined over multiple records by summing modulo2^128. it's giving fast and furious fr fr π₯murmur3primesums128β checksums are computed viaMurmurHash3_x64_128(again,https://github.com/aappleby/smhasher/blob/master/src/MurmurHash3.cpp) and combined over multiple records by summing modulo2^128+51. yes bestie, the+51matters, 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 π
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 πππ¦
π¦ 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