Zubair Khalid

Virologist/Molecular Biologist | Veterinarian | Bioinformatician

Conventional & Molecular Virology • Vaccine Development • Computational Biology

Dr. Zubair Khalid is a veterinarian and virologist specializing in conventional and molecular virology, vaccine development, and computational biology. Dedicated to advancing animal health through innovative research and multi-omics approaches.

Dr. Zubair Khalid - Veterinarian, Virologist, and Vaccine Development Researcher specializing in Computational Biology, Multi-omics, Animal Health, and Infectious Disease Research

Category: Guides

Per Base Quality Sequencing

Per base quality sequencing refers to the process of evaluating each nucleotide call in a sequencing read by its associated quality score, typically represented in FASTQ format. This guide is for bioinformaticians, laboratory scientists, and students who need to understand, assess, and act on per base quality metrics to ensure reliable downstream analysis. By reading this guide, you will learn how to interpret quality scores, decide when to filter or trim data, implement a robust QC workflow, avoid common pitfalls, and recognize the limits of quality score interpretation. Unless you use these scores appropriately, your variant calls, assemblies, or quantification results may be compromised.

At a Glance

Aspect Key Information
Core metric Phred quality score (Q score) per base position
Typical range Q2 to Q40 (error probabilities 0.63 to 0.0001)
Common threshold Q20 (1% error) or Q30 (0.1% error)
Primary tools FastQC, MultiQC, fastp, Trimmomatic, cutadapt
Key decision Whether to trim low quality bases or whole reads
Main output Per base quality plot showing boxplots for each cycle
Pitfall Over trimming that discards valuable data or under trimming that leaves errors
Limit of use Quality scores are estimates, they do not capture all error types

Core Concepts

Per base quality scores originate from the sequencing instrument's base caller. Each base call in a FASTQ file is assigned a Phred quality score, Q, defined as Q = -10 log10(p), where p is the estimated probability of an incorrect base call. A Q score of 30 corresponds to an error probability of 1 in 1000 (0.1% error). For Illumina sequencing, scores typically range from Q2 to Q40, with Q30 considered a gold standard for high confidence calls. According to the NCBI Bookshelf, FASTQ files store these scores as ASCII characters, making them human readable but requiring careful parsing in scripts [1]. The per base quality assessment examines the distribution of scores across all reads at each sequencing cycle. This reveals positional biases, such as declining quality toward the end of reads due to reagent depletion or sequencing chemistry artifacts. The EMBL EBI Training resources emphasize that viewing per base quality plots is often the first step in any sequencing QC workflow, as it directly informs whether trimming is necessary [2]. You must understand that quality scores are best understood as relative measures within a sequencing run, they are not absolute guarantees of accuracy.

Decision Criteria

When should you apply per base quality based trimming or filtering? Three main factors guide this decision.

First, examine your per base quality plot. If the median quality falls below your chosen threshold (commonly Q20 or Q30) for the last 20 to 30 bases, sliding window trimming or end trimming is warranted. If quality is uniformly low across the read, consider discarding the entire read.

Second, consider your downstream application. For de novo genome assembly, higher quality (Q30) is critical to avoid misassemblies. For variant calling in high coverage data, modestly lower quality (Q20) may be acceptable because multiple reads support each call. As shown in a study on per base quality scores as a surrogate marker for cell free DNA fragmentome, the quality distribution can even carry biological signal in certain contexts [6]. Thus the decision to trim should balance error tolerance against information loss.

Third, evaluate read length requirements. Some aligners require a minimum read length, trimming too aggressively may waste data. A practical rule is to use a sliding window approach (e.g., trim when average quality in a 4 base window falls below Q15) rather than fixed length trimming.

Practical Workflow

The following workflow implements per base quality assessment and iterative trimming. It is designed to be run on a typical high performance computing cluster but also works on a local machine with sufficient memory.

Step 1: Generate raw quality reports. Run FastQC (available via Galaxy Training Network) on your FASTQ files [3]. This produces an HTML report with a per base sequence quality plot. Examine the boxplots: each box shows the median, quartiles, and whiskers for all read positions. Identify any cycles where the median quality drops below your threshold. Note that some tools like MultiQC can aggregate multiple FastQC reports for batch runs.

Step 2: Decide on trimming parameters. Based on the plot, choose a trimming strategy. For uniform quality decline at read ends, use a simple end trim: for example, remove bases after position 140 if that is where quality falls below Q20. For variable read lengths, use a sliding window trimmer. The Bioconductor package ShortRead offers quality trimming functions for R users who prefer a programmatic approach [4]. Many projects use the tool fastp because it both trims and generates a pre and post quality report.

Step 3: Execute trimming. Run your chosen tool. For instance, with cutadapt, you can specify --quality-cutoff 20 to trim low quality ends. Alternatively, with fastp use --qualified_quality_phred 15 --unqualified_percent_limit 40 to set a sliding window. Verify that the trimming does not remove too many reads or excessively shorten reads. You can inspect the trimming statistics.

Step 4: Re evaluate quality. After trimming, run FastQC again on the trimmed FASTQ files. Compare the per base quality plots with the originals. The goal is a plot where all cycles have median quality above your threshold. If quality is still poor for many bases, you may need to be more aggressive or consider discarding the run.

Step 5: Document and archive. Record the trimming parameters, the number of reads and bases retained, and the final per base quality metrics. This documentation is essential for reproducibility. You can store the raw and trimmed data in the NCBI Sequence Read Archive (SRA) along with metadata describing the QC steps [5].

Quality Checks

After implementing the workflow, perform these checks to confirm quality improvement and data integrity.

Check 1: Confirm per base quality improvement. Compare the per base quality plot of trimmed reads against raw reads. The post trim plot should show higher median scores across all positions, especially at the end. If improvement is minimal, verify that the trimming tool correctly interpreted the quality encoding (Sanger, Illumina 1.3+, etc.). Mismatched encoding is a common error.

Check 2: Verify read count and length distributions. Use FastQC's per sequence quality scores, per base sequence content, and sequence length distribution modules. Trimming should not remove an excessive proportion of reads (e.g., >20%) unless the run quality is exceptionally poor. Also ensure that after trimming, reads are long enough for alignment or assembly. Some assemblers require a minimum length (e.g., 50 bases for de Bruijn graphs). The study on BINSEQ binary formats for nucleotide sequences illustrates how careful data handling can preserve quality information even when converting formats [11].

Check 3: Check for adapter contamination. After quality trimming, adapter sequences at read ends may become more visible. Use tools like fastp or cutadapt to detect and remove adapters. A final FastQC run should show no adapter peaks.

Check 4: Validate with a small downstream analysis. Run a quick alignment of a subset of trimmed reads to a reference genome. Count the number of mapped reads and the percentage of properly paired reads. If these metrics are typical for your data type, your per base quality control has been effective.

Common Mistakes

Even experienced analysts can make errors when handling per base quality scores. Avoid these frequent pitfalls.

Mistake 1: Using a fixed quality cutoff without checking the plot. Trimming all reads to a fixed length (e.g., truncating to 100 bases) ignores the actual per base quality distribution. You may discard good data or retain poor data. Always rely on the per base quality plot to guide where to trim.

Mistake 2: Trimming too aggressively with a sliding window. Using a very high quality threshold (e.g., Q30) in a sliding window may remove most of a read, leaving only a few high quality bases. This can destroy read pairs and lead to data loss. Choose a threshold that matches your application's tolerance.

Mistake 3: Ignoring the base composition bias. Sometimes poor per base quality at the start of reads is actually a feature of biased fragmentation or library preparation, as seen in samples from laser capture microdissection followed by transcriptome sequencing [10]. In such cases, trimming the first few bases may be inappropriate if the bias is biological rather than technical.

Mistake 4: Failing to re evaluate after trimming. Some analysts trim once and never check the post trim quality. Always run FastQC again to confirm the trim worked. Without verification, you cannot guarantee that your data meets quality standards for downstream analysis.

Mistake 5: Treating quality scores as absolute. Phred scores are estimates from the base caller's model. They can be inaccurate for certain sequence contexts (e.g., homopolymers, GC rich regions). The NAP pipeline for Nanopore data highlights the need to adjust quality expectations for different sequencing technologies [7]. Do not rely solely on scores, also evaluate alignment metrics and reproducibility.

Limits of Interpretation

Per base quality scores are powerful but have inherent limitations that affect their use.

Limitation 1: Scores are not calibrated identically across platforms. Illumina, Nanopore, and PacBio use different base calling algorithms and error models. A Q20 on Illumina does not carry the same error probability as Q20 on Nanopore. The study on ensilication preserving native DNA for long read sequencing shows that sample preparation can also affect quality score reliability [9]. Always calibrate expectations to your platform.

Limitation 2: Quality scores do not capture structural errors. They estimate substitution errors but are poor at detecting insertions or deletions (indels), which are common in homopolymer regions. Base calls may be wrong but still have high quality scores if the underlying signal is ambiguous.

Limitation 3: Averaging aggregates per base. The per base quality plot uses median and quartiles over millions of reads. A high median at a given position does not guarantee every read's base is accurate. Some reads may have very low scores at that same position. Always consider the distribution and not just the median.

Limitation 4: Context dependent accuracy. For example, the first few bases of Illumina reads often have lower quality due to incomplete cluster generation. However, trimming them may remove genuine biological signal if the sample has biased GC content. A study on rice panicle branch meristems using transcriptome sequencing found that careful quality trimming preserved important gene expression differences [10]. You must decide based on your specific experiment.

Limitation 5: Over trimming reduces information. Trimming too much can discard valuable reads, especially in samples with low input DNA or degraded RNA. The trade off between quality and quantity must be evaluated per dataset. For metagenomic or microbiome studies, even low quality reads might contain unique taxa.

Frequently Asked Questions

Q1: What is the difference between per base quality and per sequence quality?
Per base quality shows the distribution of quality scores at each sequencing cycle across all reads. Per sequence quality shows the average quality score per read. A poor per base quality at the end of reads often indicates the need for trimming, while a poor per sequence quality may indicate whole read removal.

Q2: Should I always trim reads to a uniform length based on per base quality?
Not necessarily. Uniform length trimming is only advisable if quality declines consistently at a fixed position. Many modern tools use sliding window trimming, which adapts to variable read lengths and quality drops. Check the per base quality plot to decide which strategy fits.

Q3: Can I use per base quality scores to compare different sequencing runs?
Cautiously. Because quality scores are generated by different base callers and chemistry versions, they are only comparable within the same run or platform generation. Use them as a relative metric within your dataset, not as an absolute benchmark across experiments.

Q4: How do I handle per base quality in long read sequencing (e.g., Nanopore)?
Long read quality scores are less reliable than Illumina scores. For Nanopore data, you may need to use read level quality (e.g., average Q > 9) rather than per base thresholds. Additionally, tools like NAP incorporate technology specific quality checks [7]. Refer to platform guidelines for appropriate thresholds.

References and Further Reading

Related Articles