A Phred quality score is a compact way to say how likely a base call is wrong. The score is logarithmic, so a difference of ten points means the error probability changes by a factor of ten.
The definition
If a base has quality score Q, the estimated probability that the call is incorrect is:
P(error) = 10^(-Q/10)
A score of 10 means a 1 in 10 chance of error. A score of 20 means 1 in 100. A score of 30 means 1 in 1,000, and a score of 40 means 1 in 10,000. The scores are estimates from the base-calling software, not measurements of truth.
The same number appears in different places. A FASTQ quality character encodes the score with an ASCII offset, usually 33. A BAM file stores the score as an integer. A report may show a median, a mean or a count above a threshold. Those summaries are not interchangeable.
Reading a FASTQ quality string
Take a quality string of IIII+IIII. The character I is ASCII 73, so with offset 33 the score is 40. The + is ASCII 43, so the score is 10. That single low-quality base is easy to miss if you look only at the average.
The first few bases of a read are often noisier, and quality usually falls towards the end. A per-position quality plot shows this pattern. A sudden drop at a fixed position can indicate a cycle problem, a shorter insert or the start of adapter sequence.
What thresholds mean
There is no universal threshold. A common working rule is to trim bases below Q20 or Q30, but the right choice depends on the application.
- Variant calling benefits from high base quality because a single wrong base can look like a variant.
- Read counting is more tolerant of low-quality tails, but adapter and rRNA reads still waste effort.
- Assembly needs reads that are long enough to overlap; aggressive trimming can remove the overlap.
- Amplicon analysis depends on the primer region, so trimming that removes the primer can break the first step.
A threshold is a trade-off between keeping data and removing noise. Record the threshold and test whether the downstream result changes. A result that disappears when the threshold moves by a few points is not robust.
Quality is not the same as accuracy
Base quality describes one call at one position. It does not describe whether the read maps to the right place, whether the library is contaminated, or whether the sample is what the label says. A file can have excellent base quality and still be the wrong sample.
Mapping quality is a separate score attached to an alignment. It estimates the chance that the read is placed incorrectly. A high base quality and a low mapping quality together often mean a repeat region or a multi-mapping read.
Common encodings
Most modern FASTQ files use Phred+33. Older Illumina files used Phred+64. If a file is read with the wrong offset, scores shift by 31 and can look impossibly high or negative. A quick check is the range of characters: Phred+33 files usually contain ! through I, while Phred+64 files contain @ through h.
Never "fix" an encoding by adding a constant to every character unless you know the source. It is better to find the instrument or pipeline that produced the file and use the matching setting.
Summaries and their traps
A mean quality of 35 sounds good, but a mean hides a tail. A file with most bases at Q40 and a small block at Q2 can still produce false variants. Look at the distribution, the lower percentile and the per-position plot.
A "percentage above Q30" is also easy to misread. It says nothing about where the low-quality bases are. If they are at the start of every read, primer trimming may fix the problem. If they are at the end, quality trimming may help. If they are scattered, the run itself may be poor.
Key points
- Q10 is 1 in 10, Q20 is 1 in 100, Q30 is 1 in 1,000, Q40 is 1 in 10,000.
- FASTQ stores Q with an ASCII offset, usually 33.
- Per-position plots reveal patterns that averages hide.
- Base quality and mapping quality answer different questions.
- Record and justify the threshold you use.
Common mistakes
- Treating a mean quality as proof that every base is good.
- Using a Q30 filter on short reads and then wondering why coverage fell.
- Mixing Phred+33 and Phred+64 files in one batch.
- Confusing base quality with mapping quality.
- Trimming the same reads twice with different tools and losing track of the original.
When to ask for help
If a quality report shows an unusual pattern, if trimming changes a biological conclusion, or if you cannot tell whether a low score is normal for your platform, ask before deleting data. You can order an analysis or read the RNA-seq QC checklist. The free FASTQ Read Processing studio shows quality distributions, and the NGS pipeline overview explains where quality filtering fits.
Sources and further reading
A worked comparison
Suppose two files both report a mean quality of 32. In the first, every base is near Q32 with a narrow spread. In the second, most bases are Q40 and a short block is Q2. The means are similar, but the risks are different. The first file has a uniform, moderate error rate. The second has a concentrated problem that may correspond to a specific cycle or a specific position in the read.
A per-position plot, a percentile table and a count of bases below Q20 together tell a more useful story than the mean. If the low-quality block is at the start of every read, look for primer or adapter sequence. If it is at the end, consider quality trimming. If it is in the middle, inspect the run report and the library.
The same logic applies to mapping quality. A mean mapping quality of 55 can hide a small set of multi-mapping reads in a repeat. Those reads may be exactly the ones that matter for a duplication or a paralogue. Always look at the distribution and at the reads that fail the threshold, not only the ones that pass.
Written by the Solagene team for research and education. Found an error? Tell us and we will correct it.