From Genome Analysis Wiki
= Overview of the <code>recab</code> function of <code>[[bamUtil]]</code> =
The <code>recab</code> option of [[bamUtil]] recalibrates a SAM/BAM file.
==Handling Recalibration/Implementation Notes==
Reads Not Recalibrated:
* Mapping Quality = 0
* Mapping Quality = 255
Recalibration is a 2-step process that loops through the file twice:
# Apply Recalibration Table
is done by grouping bases based on a set of covariates:
* Read Group
* 1st/2nd read in pair
* Previous Cycle's Base* This Cycle's Base
For Reverse Strands, the reverse complement of the SAM/BAM is used for the cycle, previous cycle's base, and current cycle's base.
Not all bases are used for building the Recalibration table. Only bases meeting the following criteria are used: * Base is a q Match/Mismatch * Previous base is a CIGAR Match/Mismatch or it is the first cycle * Base position is not a dbSNP position * Previous base position is not a dbSNP position (if not first cycle) * Base quality > 5 (or the configurable minimum)
Recalibration Table is applied on all bases in the read sequence (ignoring the alignment/CIGAR) unless the base quality is < 5 (or the configurable minimum)
This recalibration logic was designed for recalibrating ILLUMINA data.
== How to use it ==