Inferensys

Glossary

Base Quality Score Recalibration (BQSR)

A machine learning preprocessing step that corrects systematic errors in the per-base quality scores reported by sequencing instruments, improving downstream variant calling accuracy.
Developer building agentic RAG system, retrieval pipeline diagram on laptop, technical workspace with notes.
SEQUENCING PREPROCESSING

What is Base Quality Score Recalibration (BQSR)?

A machine learning preprocessing step that corrects systematic errors in the per-base quality scores assigned by a sequencing instrument, improving the accuracy of downstream variant calling.

Base Quality Score Recalibration (BQSR) is a machine learning preprocessing step that applies a Gaussian mixture model or similar regression technique to correct systematic biases in the per-base quality scores reported by a sequencing instrument. These raw quality scores, which estimate the probability of a sequencing error, are often inflated or deflated by technical artifacts like the sequencing cycle, the preceding dinucleotide context, and the machine tile position. BQSR analyzes the covariation between these empirical error rates and the reported quality scores across the entire dataset, generating a recalibrated score that more accurately reflects the true probability of a base being incorrect.

By adjusting quality scores to be empirically accurate, BQSR directly improves the performance of downstream variant calling algorithms, which rely on these scores to compute diploid genotype likelihoods and distinguish true mutations from sequencing noise. The process requires a set of known polymorphic sites, typically from a resource like dbSNP, to mask true genetic variation so the model can be trained exclusively on observed sequencing errors. The recalibrated BAM file output ensures that subsequent filtering steps, such as Variant Quality Score Recalibration (VQSR), operate on well-calibrated statistical inputs, reducing both false positive and false negative variant calls.

BQSR EXPLAINED

Frequently Asked Questions

Clear, technical answers to the most common questions about Base Quality Score Recalibration, the machine learning preprocessing step that corrects systematic sequencing errors before variant calling.

Base Quality Score Recalibration (BQSR) is a machine learning preprocessing step that corrects systematic errors in the per-base quality scores reported by a sequencing instrument. It works by applying a covariate model that analyzes patterns in the data where errors are known to occur—specifically the raw reported quality score, the machine cycle (position in the read), and the sequence context (the preceding and following dinucleotide). The algorithm uses a Gaussian kernel smoother or similar regression technique to compute the empirical error rate for each covariate bin by comparing observed mismatches against a database of known polymorphic sites, then adjusts the reported quality scores to reflect the true probability of error. This recalibration produces well-calibrated quality scores where a reported Q30 genuinely means a 1-in-1000 chance of error, which is critical for downstream variant callers like DeepVariant and GATK HaplotypeCaller that rely on these scores as input features.

MECHANISM

Key Features of BQSR

Base Quality Score Recalibration (BQSR) is a critical preprocessing step that uses machine learning to model and correct systematic technical errors in sequencing data, ensuring that the confidence assigned to each base call reflects its true empirical error rate.

01

Covariate Modeling

BQSR applies a Gaussian mixture model or table-based recalibration to analyze covariates that correlate with sequencing errors. Key covariates include:

  • Read group identity: Accounts for machine-specific or lane-specific biases.
  • Reported quality score: The raw Phred score assigned by the sequencer.
  • Machine cycle: The position within the read, as error rates often increase toward the 3' end.
  • Dinucleotide context: The preceding and current base, as certain sequence motifs (e.g., AC, GT) are prone to specific substitution errors. By binning bases according to these covariates, the algorithm calculates an empirical mismatch rate against the reference genome, adjusting the final quality score to be globally accurate.
99.9%+
Empirical Accuracy Target
02

Empirical Error Correction

The core function of BQSR is to replace the subjective, vendor-generated quality score with an empirical quality score. The algorithm calculates the actual probability of error for every base in a given covariate bin. For example, if a sequencer reports a quality score of 30 (implying 0.1% error) but the empirical mismatch rate for that specific dinucleotide context and cycle is 1%, BQSR will downgrade the quality score to 20. Conversely, it can upgrade scores that are overly pessimistic. This calibration is essential for downstream variant callers that rely on these scores to compute genotype likelihoods.

Phred 20-60
Recalibrated Score Range
03

Masking Known Variation

To avoid conflating true biological variation with sequencing error, BQSR requires a database of known polymorphic sites (e.g., dbSNP, 1000 Genomes). The algorithm masks these loci during the initial training phase so that genuine single nucleotide polymorphisms (SNPs) are not counted as mismatches. Without this masking step, recalibration would incorrectly penalize high-quality bases at common variant sites, leading to false negative variant calls in downstream analysis. A second pass is often performed after an initial variant call to refine the mask.

~15M
Known Sites in dbSNP 155
05

Impact on Variant Calling

Recalibration directly improves the sensitivity and specificity of variant calling. By correcting inflated quality scores, BQSR reduces the number of false positive variant calls caused by systematic sequencing errors that appear with high confidence. It also improves the accuracy of genotype likelihood calculations, which depend on the Phred-scaled probability of each base being correct. Studies show that applying BQSR can reduce the number of false positive SNPs by over 50% in certain genomic contexts, significantly increasing the precision of the final variant call set.

>50%
Reduction in False Positives
06

Read Group Stratification

A critical prerequisite for BQSR is the correct assignment of read groups in the alignment file. A read group identifies the specific library preparation, flowcell lane, and sample barcode for a set of reads. BQSR treats each read group as an independent source of technical error because different physical runs of a sequencer exhibit distinct error profiles. Failing to properly stratify data by read group will cause the algorithm to average distinct error modes, resulting in suboptimal recalibration and residual systematic bias in the output data.

RECALIBRATION COMPARISON

BQSR vs. Variant Quality Score Recalibration (VQSR)

Comparison of the two primary machine learning-based recalibration methods used in GATK best practices pipelines: Base Quality Score Recalibration applied to raw sequencing reads and Variant Quality Score Recalibration applied to called variants.

FeatureBQSRVQSR

Input data

Per-base quality scores in BAM file

Called variant records in VCF file

Target of recalibration

Base quality scores (Phred scale)

Variant quality scores (QUAL field)

Underlying model

Covariate-based empirical error estimation

Gaussian mixture model

Training truth set

dbSNP and known polymorphic sites

HapMap, 1000 Genomes, Omni chip truth sets

Covariates used

Read group, quality score bin, dinucleotide context, machine cycle

QD, MQ, MQRankSum, ReadPosRankSum, FS, SOR, InbreedingCoeff

Pipeline stage

Preprocessing (before variant calling)

Post-processing (after variant calling)

Output effect

Adjusted base quality scores written to BAM

Recalibrated QUAL scores and VQSLOD annotation in VCF

Applicable to

All sequencing reads

SNPs and indels (separate models)

Handles indels

Requires known truth sites

Corrects systematic instrument bias

Filters low-confidence calls

Emission probability calibration

Per-base error probability

Per-variant probability of being a true positive

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.