BBNORM.SH(1)

πŸ’– BBNORM.SH β€” bestie edition πŸ’–

okay so this is a page from the User Commands manual, and honestly? it's giving ✨kmer magic✨. welcome to bbnorm.sh, bestie, let's get into it 🫢


🌸 NAME 🌸

bbnorm.sh β€” the kmer-based error-correction and normalization tool πŸ’…


✨ SYNOPSIS ✨

bbnorm.sh in=<input> out=<reads to keep> outt=<reads to toss>
hist=<histogram output>

πŸ¦‹ DESCRIPTION πŸ¦‹

So what does it even do? It normalizes read depth based on kmer counts, periodt. It can also error-correct, bin reads by kmer depth, and generate a kmer depth histogram β€” like, it does a lot πŸ‘‘

BUT. Real talk. Tadpole has superior error-correction to BBNorm 😭 so if you're here specifically for error correction, know that.

Please read bbmap/docs/guides/BBNormGuide.txt for more information β€” it's lowkey required reading, no cap.


πŸŽ€ OPTIONS πŸŽ€

πŸ’œ Input parameters

  • in=null β€” the primary input, your main character. Use in2 for paired reads in a second file.
  • in2=null β€” second input file, for when your paired reads live in two separate files.
  • extra=null β€” extra files that get used for input (building the hash table) but not for output. iykyk.
  • fastareadlen=2^31 β€” breaks up FASTA reads longer than this. super useful when you're processing scaffolded genomes 🧬
  • tablereads=-1 β€” use at most this many reads when building the hashtable (-1 means all of them, go wild).
  • kmersample=1 β€” process every *n*th kmer and skip the rest.
  • readsample=1 β€” process every *n*th read and skip the rest.
  • interleaved=auto β€” may be set to true or false to force the input read file to override autodetection of the input file as paired interleaved.
  • qin=auto β€” ASCII offset for input quality. May be 33 (Sanger), 64 (Illumina), or auto.

πŸ’– Output parameters

  • out=<file> β€” file for normalized or corrected reads. Use out2 for paired reads in a second file.
  • outt=<file> β€” also known as outtoss. File for reads that were excluded from the primary output. bye bestie πŸ‘‹
  • reads=-1 β€” only process this number of reads, then quit (-1 means all).
  • sampleoutput=t β€” use sampling on output as well as input (not used if sample rates are 1).
  • keepall=f β€” set to true to keep all reads (like, if you just want error correction and nothing else).
  • zerobin=f β€” set to true if you want kmers with a count of 0 to go in the 0 bin instead of the 1 bin in histograms.

Default is false, to prevent confusion about how there can be 0-count kmers. The reason is that based on the minq and minprob settings, some kmers may be excluded from the bloom filter. (mystery solved πŸ”)

  • tmpdir= β€” this will specify a directory for temp files (only needed for multipass runs). If null, they will be written to the output directory.
  • usetempdir=t β€” allows enabling/disabling of temporary directory; if disabled, temp files will be written to the output directory.
  • qout=auto β€” ASCII offset for output quality. May be 33 (Sanger), 64 (Illumina), or auto (same as input).
  • rename=f β€” rename reads based on their kmer depth.

πŸ”₯ Hashing parameters

  • k=31 β€” kmer length (values under 32 are most efficient, but arbitrarily high values are supported).
  • bits=32 β€” bits per cell in bloom filter; must be 2, 4, 8, 16, or 32. Maximum kmer depth recorded is 2^cbits. Automatically reduced to 16 in 2-pass.

Large values decrease accuracy for a fixed amount of memory, so use the lowest number you can that will still capture highest-depth kmers. fr fr.

  • hashes=3 β€” number of times each kmer is hashed and stored. Higher is slower.

Higher is MORE accurate if there is enough memory, and LESS accurate if there is not enough memory. the duality of man 😭

  • prefilter=f β€” true is slower, but generally more accurate; filters out low-depth kmers from the main hashtable. The prefilter is more memory-efficient because it uses 2-bit cells.
  • prehashes=2 β€” number of hashes for prefilter.
  • prefilterbits=2 β€” also known as pbits. Bits per cell in prefilter.
  • prefiltersize=0.35 β€” fraction of memory to allocate to prefilter.
  • buildpasses=1 β€” more passes can sometimes increase accuracy by iteratively removing low-depth kmers.
  • minq=6 β€” ignore kmers containing bases with quality below this.
  • minprob=0.5 β€” ignore kmers with overall probability of correctness below this.
  • threads=auto β€” also known as t. Spawn exactly X hashing threads (default is number of logical processors). Total active threads may exceed X due to I/O threads.
  • rdk=t β€” also known as removeduplicatekmers. When true, a kmer's count will only be incremented once per read pair, even if that kmer occurs more than once.

πŸ’… Normalization parameters

  • fixspikes=f β€” also known as fs. Do a slower, high-precision bloom filter lookup of kmers that appear to have an abnormally high depth due to collisions.
  • target=100 β€” also known as tgt. Target normalization depth. NOTE: All depth parameters control kmer depth, not read depth. πŸ‘‘

For kmer depth Dk, read depth Dr, read length R, and kmer size K:

Dr=Dk*(R/(R-K+1))
  • maxdepth=-1 β€” also known as max. Reads will not be downsampled when below this depth, even if they are above the target depth.
  • mindepth=5 β€” also known as min. Kmers with depth below this number will not be included when calculating the depth of a read.
  • minkmers=15 β€” also known as mgkpr. Reads must have at least this many kmers over min depth to be retained. Aka mingoodkmersperread.
  • percentile=54.0 β€” also known as dp. Read depth is by default inferred from the 54th percentile of kmer depth, but this may be changed to any number 1-100.
  • uselowerdepth=t β€” also known as uld. For pairs, use the depth of the lower read as the depth proxy.
  • deterministic=t β€” also known as dr. Generate random numbers deterministically to ensure identical output between multiple runs. May decrease speed with a huge number of threads.
  • passes=2 β€” also known as p. 1 pass is the basic mode. 2 passes (default) allows greater accuracy, error detection, better contol of output depth. (yes, "contol" β€” that's the original spelling, we keep it verbatim bestie πŸ’€)

πŸ“ Error detection parameters

  • hdp=90.0 β€” also known as highdepthpercentile. Position in sorted kmer depth array used as proxy of a read's high kmer depth.
  • ldp=25.0 β€” also known as lowdepthpercentile. Position in sorted kmer depth array used as proxy of a read's low kmer depth.
  • tossbadreads=f β€” also known as tbr. Throw away reads detected as containing errors.
  • requirebothbad=f β€” also known as rbb. Only toss bad pairs if both reads are bad.
  • errordetectratio=125 β€” also known as edr. Reads with a ratio of at least this much between their high and low depth kmers will be classified as error reads.
  • highthresh=12 β€” also known as ht. Threshold for high kmer. A high kmer at this or above are considered non-error.
  • lowthresh=3 β€” also known as lt. Threshold for low kmer. Kmers at this and below are always considered errors.

🌈 Error correction parameters

  • ecc=f β€” set to true to correct errors. NOTE: Tadpole is now preferred for ecc as it does a better job. just saying πŸ‘€
  • ecclimit=3 β€” correct up to this many errors per read. If more are detected, the read will remain unchanged.
  • errorcorrectratio=140 β€” also known as ecr. Adjacent kmers with a depth ratio of at least this much between will be classified as an error.
  • echighthresh=22 β€” also known as echt. Threshold for high kmer. A kmer at this or above may be considered non-error.
  • eclowthresh=2 β€” also known as eclt. Threshold for low kmer. Kmers at this and below are considered errors.
  • eccmaxqual=127 β€” do not correct bases with quality above this value.
  • aec=f β€” also known as aggressiveErrorCorrection. Sets more aggressive values of ecr=100, ecclimit=7, echt=16, eclt=3.
  • cec=f β€” also known as conservativeErrorCorrection. Sets more conservative values of ecr=180, ecclimit=2, echt=30, eclt=1, sl=4, pl=4.
  • meo=f β€” also known as markErrorsOnly. Marks errors by reducing quality value of suspected errors; does not correct anything.
  • mue=t β€” also known as markUncorrectableErrors. Marks errors only on uncorrectable reads; requires ecc=t.
  • overlap=f β€” also known as ecco. Error correct by read overlap.

🧚 Depth binning parameters

  • lowbindepth=10 β€” also known as lbd. Cutoff for low depth bin.
  • highbindepth=80 β€” also known as hbd. Cutoff for high depth bin.
  • outlow=<file> β€” pairs in which both reads have a median below lbd go into this file.
  • outhigh=<file> β€” pairs in which both reads have a median above hbd go into this file.
  • outmid=<file> β€” all other pairs go into this file.

⭐ Histogram parameters

  • hist=<file> β€” specify a file to write the input kmer depth histogram.
  • histout=<file> β€” specify a file to write the output kmer depth histogram.
  • histcol=3 β€” also known as histogramcolumns. Number of histogram columns, 2 or 3.
  • pzc=f β€” also known as printzerocoverage. Print lines in the histogram with zero coverage.
  • histlen=1048576 β€” max kmer depth displayed in histogram. Also affects statistics displayed, but does not affect normalization.

πŸ‘‘ Peak calling parameters

  • peaks=<file> β€” write the peaks to this file. Default is stdout.
  • minHeight=2 β€” also known as h. Ignore peaks shorter than this.
  • minVolume=5 β€” also known as v. Ignore peaks with less area than this.
  • minWidth=3 β€” also known as w. Ignore peaks narrower than this.
  • minPeak=2 β€” also known as minp. Ignore peaks with an X-value below this.
  • maxPeak=BIG β€” also known as maxp. Ignore peaks with an X-value above this.
  • maxPeakCount=8 β€” also known as maxpc. Print up to this many peaks (prioritizing height).

β˜• Java Parameters:

  • -Xmx β€” this will set Java's memory usage, overriding autodetection.

-Xmx20g will specify 20 gigs of RAM, and -Xmx200m will specify 200 megs. The max is typically 85% of physical memory.

  • -eoom β€” this flag will cause the process to exit if an out-of-memory exception occurs. Requires Java 8u92+.
  • -da β€” disable assertions.

πŸ’Œ AUTHOR πŸ’Œ

Written by Brian Bushnell (Last modified October 19, 2017) 🫢

Please contact Brian Bushnell at bbushnell@lbl.gov if you encounter any problems, or post at: http://seqanswers.com/forums/showthread.php?t=41057

This manpage was written by Andreas Tille for the Debian distribution and can be used for any other usage of the program.


and that's the whole page, bestie πŸ’– this was bbnorm.sh version 38.43, from April 2019 β€” slay, periodt, go normalize something βœ¨πŸŒΈπŸ¦‹