Definitionintro
Phred quality score
Also called Phred score, base quality score.
The error probability p of a base call written as Q = -10 log10 p, so Q20 means a 1 in 100 chance of error. The same scale is used for mapping and variant qualities.
A Phred quality score is an error probability written on a logarithmic scale: a call with error probability has quality . Each step of 10 in is a factor of 10 in , so Q20 is a 1 in 100 chance that the call is wrong and Q30 a 1 in 1000 chance. The scale comes from the phred base caller of Ewing and Green (1998), which gave each base of a sequencing trace such a value. Today the same scale is used for the base qualities of reads, for the mapping quality of an alignment, and for the QUAL and GQ fields of a VCF record.
Definition
Let be the probability that a claim is wrong, for example the claim that the base at one position of a read is the base the sequencer reported. Its Phred quality is
So , means the claim is certainly wrong, and grows without bound as . In files the value is rounded to an integer. The scale says nothing about how was found: the phred program looked up in tables calibrated against known sequence, a modern base caller uses its own model, and an aligner or a variant caller computes from a likelihood. A quality is calibrated when, among all calls with quality , the share of wrong calls is close to .
Encoding in FASTQ and SAM. A base quality is stored as one printable ASCII character, with code . This is the Sanger or Phred+33 encoding, used by FASTQ files today and by the QUAL field of SAM. The SAM specification also uses the Phred scale for the MAPQ field, with 255 meaning that the mapping quality is not available. Some older Illumina pipelines (versions 1.3 to 1.7) wrote instead, and the oldest Solexa files used a different scale,
with offset 64. The two scales agree for small and differ for large ; the conversion is .
Expected number of errors. For a read with qualities , the expected number of wrong bases is , by linearity of expectation. Read filters that drop reads with more than a set number of expected errors use this sum.
Examples and non-examples
The common values. Each step of 10 is one more correct digit.
| accuracy | ||
|---|---|---|
| 10 | 0.1 | 90% |
| 20 | 0.01 | 99% |
| 30 | 0.001 | 99.9% |
| 40 | 0.0001 | 99.99% |
Values in between follow the formula: gives , which a file stores as 13.
A FASTQ quality string. The string IIII?55+ has the codes 73, 73, 73, 73, 63, 53, 53, 43, so the qualities are 40, 40, 40, 40, 30, 20, 20, 10. The expected number of errors in these eight bases is . Almost all of it comes from the last base, which is typical: the tail of a short read often holds most of its expected errors.
Solexa against Phred. At the Solexa score is , close to the Phred score 10. At the Solexa score is 0 and the Phred score is 3.01. A Solexa score can be negative, down to in practice, while a Phred score cannot.
Non-example: the average of qualities. Phred scores do not average. Two bases of Q40 and Q10 have the mean quality 25, which stands for . Their mean error probability is , which is Q13.0. To combine qualities, convert to probabilities first, then convert back.
Non-example: a quality that is not calibrated. A base caller may report Q35 for bases whose observed error rate is 1 in 500, which is Q27. The number is still written on the Phred scale, but it is not the Phred score of the true error rate. Base quality score recalibration estimates the true rate from mismatches against a reference and rewrites the values.
Non-example: binned qualities. Many current Illumina instruments write only a few distinct quality values, so each written value stands for a range of error probabilities. The values are still on the Phred scale, but the resolution is coarse, and two bases with the same written value may differ in their true error rates.
Related definitions
- Base quality. The Phred score of one base call, stored per base in FASTQ and in the QUAL field of SAM. The alias "base quality score" names this use only; the scale is also used for the qualities below.
- Mapping quality. The Phred score of the probability that a read is placed at the wrong location; see mapping quality.
- Variant quality. QUAL in a VCF record is the Phred score of the probability that the site has no variant, and GQ is the Phred score of the probability that the called genotype is wrong; see Bayesian genotype calling.
- Phred-scaled likelihood. The PL field of VCF stores of each genotype likelihood, shifted so that the best genotype has 0. It is not an error probability, so it is not a Phred quality in the strict sense.
- Error model. Genotype likelihoods turn a base quality into , most often for a match and for each mismatch.
- Use in a pileup. A read pileup lists, for each reference position, the bases of the reads that cover it together with their qualities.
References
- Brent Ewing, LaDeana Hillier, Michael C. Wendl and Phil Green, Base-calling of automated sequencer traces using phred. I. Accuracy assessment, Genome Research 8(3), 1998, pp. 175 to 185 (the phred base caller and its accuracy on trace data)
- Brent Ewing and Phil Green, Base-calling of automated sequencer traces using phred. II. Error probabilities, Genome Research 8(3), 1998, pp. 186 to 194 (the quality value q = -10 log10 p and its calibration against observed errors)
- Peter J. A. Cock, Christopher J. Fields, Naohisa Goto, Michael L. Heuer and Peter M. Rice, The Sanger FASTQ file format for sequences with quality scores, and the Solexa/Illumina FASTQ variants, Nucleic Acids Research 38(6), 2010, pp. 1767 to 1771 (the Phred and Solexa scales, the ASCII offsets 33 and 64, and the conversions)
- The SAM/BAM Format Specification, version 1.6, hts-specs, Section 1.2 (the Phred scale) and Section 1.4 (the MAPQ and QUAL fields)
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag 594N0V Edit this page History Report an error Markdown