- Low-quality base and read trimming are important preprocessing steps in bioinformatics that improve the reliability of DNA and RNA sequencing data. Sequencing instruments generate reads containing nucleotide sequences and associated quality scores, but some bases may have a high probability of being incorrect. These low-quality bases can contribute to mismatches, inaccurate sequence alignment, false variant calls, and errors in genome assembly. Read trimming removes or filters unreliable portions of sequencing reads before downstream analysis. It helps reduce technical errors while preserving as much useful biological information as possible.
- A sequencing read consists of nucleotide bases generated from a DNA or RNA fragment. Each base is assigned a quality score, commonly expressed as a Phred quality score. This score estimates the probability that the base has been called incorrectly. The relationship between the Phred score and the probability of error is expressed as:
[
Q = -10\log_{10}(P)
]
- Here, (Q) is the Phred quality score and (P) is the estimated probability of an incorrect base call. A Q10 score corresponds to an estimated error probability of 10%, Q20 to 1%, Q30 to 0.1%, and Q40 to 0.01%. Higher scores indicate greater confidence in the base call. These scores are generally stored as ASCII characters in FASTQ files, commonly using Phred+33 encoding in modern sequencing workflows.
- Low-quality bases may arise from several technical and biological factors. In short-read sequencing, sequencing quality can decline toward the ends of reads as the number of sequencing cycles increases. Incomplete nucleotide incorporation, background signals, overlapping signals, and basecalling errors can also reduce quality. Library preparation problems, damaged DNA, contamination, and amplification bias may contribute to poor read quality. In long-read sequencing, quality can vary with the characteristics of the original molecule, sequencing chemistry, signal quality, and basecalling software.
- Low-quality bases are not distributed uniformly across all reads. Some reads may have high-quality scores throughout their entire length, while others may contain only a few unreliable bases near one end. Some reads may contain low-quality regions internally, and others may have consistently poor quality across most of their length. This variation makes it important to evaluate both base-level and read-level quality before selecting a trimming strategy.
- Base trimming and read filtering are related but different operations. Base trimming removes selected nucleotide positions from a read, usually from one or both ends, while retaining the remaining sequence. Read filtering evaluates an entire read and either retains or discards it according to specified criteria. For example, a read with a few low-quality bases at its 3′ end may be trimmed and retained, whereas a read with very low average quality or excessive ambiguous bases may be discarded entirely. Some preprocessing tools combine trimming and filtering in a single workflow.
- Quality trimming commonly uses a minimum Phred score as a threshold. Bases with scores below the selected threshold may be removed or treated as unreliable. A threshold of Q20 corresponds to an estimated base-call error probability of 1%, while Q30 corresponds to 0.1%. The choice of threshold depends on the sequencing platform, read length, experiment, and downstream analysis. A higher threshold may produce more reliable retained bases but can also shorten reads and reduce the amount of usable sequencing data. A lower threshold may preserve more sequence information but retain a greater number of potentially incorrect bases.
- One common strategy is 3′ end trimming, in which low-quality bases are removed from the end of a read. This approach is useful when quality declines toward the end of sequencing reads. For example, a read may begin with high-quality bases but contain progressively lower-quality positions near its 3′ end. Removing the low-quality terminal region can improve the reliability of the remaining sequence. Similarly, 5′ end trimming removes low-quality bases from the beginning of a read when quality problems are concentrated at that end.
- Sliding-window trimming is another approach. The read is examined using a window of consecutive bases, and the average or another summary of quality scores is calculated for each window. When the quality falls below a specified threshold, the affected portion of the read may be removed. This method can identify quality deterioration without relying only on individual base scores. Different tools use different algorithms, window sizes, and quality calculations, so parameters should be selected according to the software documentation.
- Some reads contain low-quality regions within the sequence rather than only at the ends. Internal trimming or filtering strategies may identify such regions and remove them, split the read, or discard the entire read, depending on the tool and workflow. Internal trimming requires particular care because removing an internal segment may disrupt the biological continuity of the sequence. For many standard short-read applications, terminal quality trimming is more commonly used than arbitrary internal removal.
- Read filtering can be based on average quality score, the proportion of bases below a quality threshold, the number of ambiguous bases, or the minimum length remaining after trimming. A read may be discarded if its average quality is too low, if too many bases have poor quality, or if it becomes too short to support reliable analysis. Reads containing excessive N characters may also be filtered because ambiguous bases provide limited information for alignment and sequence comparison. The appropriate filtering criteria vary according to the biological objective and sequencing technology.
- Minimum read length is an important consideration when trimming. After low-quality bases and adapters have been removed, some reads may become too short for reliable alignment or classification. A minimum length threshold can be used to discard such reads. However, there is no single minimum length suitable for every experiment. Short-read genome sequencing, targeted sequencing, small RNA sequencing, metagenomics, and long-read sequencing have different requirements. Researchers should consider the reference genome, expected sequence complexity, alignment method, and downstream analytical goals when selecting a threshold.
- Paired-end sequencing requires additional attention during trimming. In paired-end experiments, two reads originate from opposite ends of the same DNA fragment and are usually stored in separate FASTQ files. If one read becomes too short or fails filtering while the other remains usable, the pair may be treated as an orphan or unpaired read. Some tools preserve the surviving read in a separate output file, while others discard the entire pair according to the selected settings. Maintaining the relationship between read pairs is important for paired-end alignment and accurate fragment reconstruction.
- Several bioinformatics tools are commonly used for low-quality base and read trimming. fastp is a fast preprocessing program that supports quality filtering, trimming, adapter removal, ambiguous-base filtering, and HTML and JSON reporting. Trimmomatic provides flexible trimming operations for paired-end and single-end short-read data, including sliding-window trimming, leading and trailing base removal, and minimum-length filtering. Cutadapt is widely used for adapter and primer removal and also supports quality trimming. BBDuk, included in the BBTools suite, supports quality filtering, trimming, adapter removal, and other sequence-processing operations. The choice of tool depends on the data type, required operations, and reproducibility needs.
- The following example demonstrates quality trimming of paired-end Illumina reads using fastp:
fastp \
-i sample_R1.fastq.gz \
-I sample_R2.fastq.gz \
-o sample_R1_clean.fastq.gz \
-O sample_R2_clean.fastq.gz \
-q 20 \
-l 50 \
-h fastp_report.html \
-j fastp_report.json
- In this command, -i and -I specify the input forward and reverse reads, while -o and -O specify the processed output files. The -q 20 option sets the quality threshold used by fastp’s quality-filtering and trimming procedures, and -l 50 specifies a minimum retained read length of 50 bases. The HTML and JSON options generate reports describing the processing results. These settings are illustrative and should be adjusted to the sequencing experiment. The exact trimming behaviour should be checked against the fastp documentation and reported parameters.
- Trimmomatic provides another approach to quality trimming. The following example uses sliding-window trimming and minimum-length filtering for paired-end data:
trimmomatic PE \
-phred33 \
sample_R1.fastq.gz \
sample_R2.fastq.gz \
sample_R1_paired.fastq.gz \
sample_R1_unpaired.fastq.gz \
sample_R2_paired.fastq.gz \
sample_R2_unpaired.fastq.gz \
SLIDINGWINDOW:4:20 \
MINLEN:50
- The PE option indicates paired-end processing, and -phred33 specifies Phred+33 quality encoding. The SLIDINGWINDOW:4:20 operation examines a four-base window and trims when the window’s average quality falls below Q20. MINLEN:50 removes reads shorter than 50 bases after trimming. Paired reads that pass filtering are written to the paired output files, while surviving reads whose partners do not pass are written to the unpaired output files. These parameters are examples rather than universal recommendations.
- Cutadapt can also perform quality trimming. For example:
cutadapt \
-q 20 \
-m 50 \
-o sample_trimmed.fastq.gz \
sample.fastq.gz
- The -q 20 option trims low-quality bases from the read ends using a Q20 threshold, and -m 50 discards reads shorter than 50 bases after processing. Cutadapt can also remove adapters and primers in the same workflow. When combining operations, researchers should check the order and behaviour of the selected options in the software documentation.
- Quality trimming should be followed by another round of quality assessment to determine whether the preprocessing has improved the dataset. FastQC can generate reports for the original and processed FASTQ files, while MultiQC can combine the results across samples. Researchers can compare per-base quality, per-sequence quality, read length distribution, adapter content, GC distribution, and the number of retained reads. The following commands illustrate this process:
fastqc sample_R1.fastq.gz sample_R2.fastq.gz
fastqc sample_R1_clean.fastq.gz sample_R2_clean.fastq.gz
multiqc .
- A successful trimming process should reduce the presence of low-quality terminal bases while retaining a sufficient number of informative reads. However, an increase in average quality does not necessarily mean that the overall dataset has become more useful. If excessive trimming removes a large proportion of the original sequence, coverage may decrease and some genomic regions may become less reliably represented. Both quality improvement and data retention should therefore be evaluated.
- Low-quality base and read trimming have different implications across sequencing applications. In whole-genome sequencing, trimming can improve the quality of reads used for reference alignment and variant detection. In whole-exome and targeted sequencing, it may help reduce unreliable sequence positions in reads covering selected genomic regions. In RNA sequencing, trimming can improve transcript alignment and quantification, although excessive trimming may remove useful information from short transcripts. In metagenomic sequencing, poor-quality bases can interfere with taxonomic classification and microbial genome assembly. In small RNA sequencing, read lengths are naturally short, so minimum-length filtering must be selected carefully to avoid discarding genuine biological sequences.
- Single-cell sequencing requires special consideration because reads may contain cell barcodes and unique molecular identifiers (UMIs). These sequences are essential for assigning reads to individual cells and identifying original molecules. Trimming or filtering must not remove barcode and UMI regions unless the workflow specifically requires it. Platform-specific single-cell pipelines generally define how these regions should be handled, and their instructions should be followed before applying general-purpose trimming tools.
- Long-read sequencing also requires a different approach. Oxford Nanopore and PacBio reads may have variable lengths and platform-specific error profiles. Tools such as NanoFilt, NanoPlot, NanoStat, and platform-specific software can help assess and filter long reads. Filtering by read length or average quality may be useful for particular applications, but strict thresholds can remove long molecules that contain valuable structural information. PacBio HiFi reads are already generated through consensus-based processing, while Oxford Nanopore reads depend on the basecalling model and chemistry. Quality thresholds should reflect the expected performance of the relevant platform.
- Over-trimming is one of the most important risks in sequencing preprocessing. If the quality threshold is too strict, large portions of reads may be removed, reducing effective read length and coverage. This may negatively affect genome assembly, variant detection, transcript quantification, and taxonomic classification. Similarly, discarding every read with a small number of low-quality bases may unnecessarily reduce the dataset. A balanced approach should remove genuinely unreliable sequence while retaining useful biological information.
- Another important consideration is that quality scores are estimates rather than absolute measurements of correctness. A high Phred score does not guarantee that a base is biologically correct, and a low-quality base may sometimes still match the true nucleotide. Systematic errors, contamination, sample mix-ups, and reference-genome problems may remain even after trimming. Quality trimming therefore cannot replace contamination screening, alignment quality assessment, coverage analysis, or other validation procedures.
- For reproducible bioinformatics research, the original sequencing files should be preserved before preprocessing. Researchers should document the sequencing platform, library preparation method, quality encoding, software name and version, trimming algorithm, quality threshold, window size, minimum read length, and other relevant parameters. Reports generated before and after trimming should be retained. File checksums can be used to verify data integrity, while workflow managers such as Snakemake and Nextflow can help apply consistent preprocessing procedures across multiple samples.
- Low-quality base and read trimming are essential techniques for preparing reliable sequencing data for downstream bioinformatics analysis. Base trimming removes unreliable nucleotide positions, whereas read filtering removes entire reads that fail defined quality or length criteria. Tools such as fastp, Trimmomatic, Cutadapt, and BBDuk provide flexible approaches for these operations. The most appropriate strategy depends on the sequencing technology, experimental design, read characteristics, and downstream application. Careful parameter selection, preservation of biological information, and post-trimming quality assessment help improve the accuracy and reproducibility of sequencing analyses.