- Sequencing quality control and preprocessing are essential stages in bioinformatics that ensure DNA and RNA sequencing data are suitable for downstream analysis. Modern sequencing technologies generate millions to billions of reads in a single experiment, but raw sequencing data may contain low-quality bases, adapter contamination, sequencing errors, duplicated reads, ambiguous nucleotides, and unwanted biological sequences. These technical issues can affect sequence alignment, genome assembly, variant detection, gene expression quantification, and metagenomic analysis. Quality control identifies potential problems in sequencing datasets, while preprocessing applies appropriate operations to improve the usability of the data without removing important biological information.
- Sequencing quality control, commonly abbreviated as QC, involves evaluating the technical characteristics of raw sequencing data. It helps determine whether the sequencing experiment produced data of sufficient quality for the intended analysis. QC also identifies unusual patterns that may indicate problems during sample preparation, library construction, sequencing, or data processing. Preprocessing refers to the computational procedures used to prepare sequencing reads for further analysis. These procedures may include adapter removal, quality trimming, filtering of short or poor-quality reads, removal of unwanted sequences, correction of certain sequencing errors, and conversion or organization of sequencing files.
- The most common input format for short-read sequencing quality control is FASTQ. A FASTQ file stores nucleotide sequences together with quality scores for individual bases. Each read is represented by four lines: a sequence identifier, a nucleotide sequence, a separator line, and a quality string. The quality string encodes the estimated confidence of each base call, commonly using Phred quality scores. These scores allow bioinformatics tools to identify low-confidence positions and evaluate the overall quality of sequencing reads.
- A simplified FASTQ record is:
@READ_001
ATGCGTACGTAGCTAGCTAG
+
IIIIIIIIIIIIIIIIIIII
- The first line identifies the read, the second contains its nucleotide sequence, the third separates the sequence from the quality information, and the fourth contains the encoded quality scores. The example is illustrative; actual FASTQ records may contain longer identifiers and sequences, and quality strings depend on the encoding convention used by the sequencing pipeline.
- Phred quality scores express the estimated probability that a base call is incorrect. A higher score indicates greater confidence in the reported nucleotide. The relationship between a Phred score and the probability of an incorrect base call is:
- Q = -10 × log10(P)
- Here, Q represents the Phred quality score and P represents the estimated probability of an incorrect base call. A Q10 score corresponds to an estimated error probability of 10%, Q20 corresponds to 1%, Q30 corresponds to 0.1%, and Q40 corresponds to 0.01%. These values help evaluate base-level sequencing quality, although they do not capture every source of error, such as incorrect mapping, contamination, or systematic experimental bias.
- The first step in a typical sequencing QC workflow is to inspect the raw FASTQ files before modifying them. This initial assessment establishes the quality of the original sequencing data and provides a baseline for evaluating the effects of preprocessing. FastQC is one of the most widely used tools for this purpose. It generates graphical reports containing information about per-base sequence quality, per-sequence quality scores, nucleotide composition, GC content, sequence length distribution, sequence duplication, adapter contamination, and overrepresented sequences.
- Per-base sequence quality examines the distribution of quality scores at each position across all reads. Sequencing quality may decline toward the ends of reads, particularly in some short-read sequencing workflows. A strong decline in quality near the 3′ end may indicate that trimming is appropriate. However, the presence of lower-quality bases does not automatically mean that all affected reads should be discarded. The decision should depend on the severity of the quality decline, the intended analysis, and whether the remaining sequence is long enough to be informative.
- Per-sequence quality scores summarize the average quality of individual reads. A dataset containing a large proportion of low-quality reads may indicate poor sequencing performance, degraded starting material, or other technical problems. Such reads may contribute to incorrect alignments or unreliable variant calls. Filtering may be appropriate when the quality distribution indicates that a subset of reads is unsuitable for the intended analysis.
- Per-base sequence content evaluates the proportions of adenine, thymine, guanine, and cytosine at each read position. In a random genomic library, base composition may be relatively stable across positions, although it depends on the organism and the biological material. Deviations can arise from library preparation, random priming bias, amplification, transcript-specific composition, or other technical and biological factors. For example, RNA-seq libraries may show non-uniform nucleotide composition near the beginning of reads because of reverse transcription and library preparation procedures. Therefore, unusual base composition should be interpreted in the context of the sequencing experiment rather than automatically classified as a failure.
- GC-content distribution measures the proportion of guanine and cytosine bases in sequencing reads. The distribution is often compared with the expected GC content of the organism or target region. A pronounced deviation or unexpected secondary peak may indicate contamination, amplification bias, or the presence of multiple biological sources. However, real biological samples may naturally contain sequences with different GC compositions. Metagenomic datasets, for example, can contain organisms with substantially different genomic GC contents. GC-content analysis should therefore be combined with other evidence before concluding that contamination is present.
- Sequence duplication levels indicate how frequently identical or very similar reads occur in the dataset. High duplication may result from PCR amplification, high sequencing depth, low library complexity, or biological enrichment of particular sequences. In RNA-seq, highly expressed transcripts can naturally produce many identical reads. In targeted sequencing, repeated reads may reflect strong enrichment of specific genomic regions. Consequently, duplication should not always be interpreted as a technical failure. Unique molecular identifiers, library design, and the biological purpose of the experiment can help distinguish PCR duplicates from repeated observations that are biologically meaningful.
- Overrepresented sequence analysis identifies sequences occurring more frequently than expected. These sequences may represent sequencing adapters, primers, ribosomal RNA, poly-A or poly-G tails, highly expressed transcripts, or contaminants. Their identity can be investigated using sequence databases and alignment tools. Adapter contamination is particularly common when the original DNA fragments are shorter than the sequencing reads, allowing the instrument to sequence through the insert and into the adapter sequence. Such contamination can interfere with read alignment and should generally be removed when identified.
- Adapter content analysis evaluates whether sequencing adapter sequences are present in the reads. Adapters are short synthetic DNA sequences introduced during library preparation. They are necessary for sequencing but are not part of the original biological sequence. If adapter sequences remain in the final reads, they may reduce mapping accuracy, produce misleading alignments, or interfere with downstream analysis. Adapter removal is therefore a common preprocessing step for short-read sequencing data.
- FastQC provides an overview of these metrics and is commonly used before and after preprocessing. A typical command is:
fastqc sample_R1.fastq.gz sample_R2.fastq.gz -o fastqc_results/
- For large projects containing multiple samples, MultiQC can combine the reports generated by FastQC and many other bioinformatics tools into a single interactive summary. This makes it easier to compare samples, identify outliers, and detect batch-specific problems.
multiqc fastqc_results/ -o multiqc_report/
- MultiQC supports reports from a broad range of bioinformatics tools, making it useful throughout sequencing workflows rather than only at the initial QC stage. Its reports can include quality-control, trimming, alignment, quantification, and other analytical results.
- After raw-data inspection, preprocessing may be performed to remove technical sequences and filter unsuitable reads. Adapter trimming is one of the most important operations. Sequencing adapters are synthetic sequences added during library preparation, and they may appear at the ends of reads when the biological insert is shorter than the sequencing read. Adapter trimming identifies and removes these sequences while retaining the biological portion of the read. The correct adapter sequence should be obtained from the library preparation protocol or sequencing provider whenever possible.
- Cutadapt is a widely used tool for adapter and primer removal. It can identify adapter sequences even when they contain a limited number of sequencing errors and supports several types of adapter configurations. It can also remove unwanted primers, poly-A tails, and other known sequence components. Cutadapt is suitable for single-end and paired-end sequencing data.
- An example of adapter trimming for paired-end reads is:
cutadapt \
-a ADAPTER_R1 \
-A ADAPTER_R2 \
-o sample_R1_trimmed.fastq.gz \
-p sample_R2_trimmed.fastq.gz \
sample_R1.fastq.gz \
sample_R2.fastq.gz
- In this command, -a specifies the adapter for the forward reads, while -A specifies the adapter for the reverse reads. The output files contain the processed reads. The adapter sequences shown are placeholders and must be replaced with the actual sequences used in the library preparation protocol. Incorrect adapter sequences can cause incomplete trimming or removal of genuine biological sequence.
- Quality trimming removes low-quality bases from sequencing reads. Because sequencing quality may decrease toward the ends of reads, trimming often focuses on the 3′ end, although both ends may require processing in some datasets. Quality trimming can use a fixed quality threshold or a sliding-window approach that evaluates the quality of a group of bases. When the average quality within a window falls below the selected threshold, bases may be removed from the relevant end of the read.
- Quality filtering differs from quality trimming. Trimming removes selected bases from individual reads, whereas filtering removes entire reads that fail specified quality requirements. A read may be discarded if its average quality is too low, if it contains too many ambiguous bases represented by N, or if its length falls below a specified minimum after trimming. The thresholds should be selected according to the biological application and the characteristics of the sequencing platform.
- Read-length filtering is important because very short reads may map to multiple locations or fail to align reliably. After adapter and quality trimming, some reads may become too short for the intended analysis. Removing such reads can improve mapping specificity and reduce computational effort. However, minimum-length thresholds should be chosen carefully. Excessively aggressive filtering can remove useful biological information, particularly in small RNA sequencing, amplicon sequencing, and other applications where short reads are expected.
- The presence of ambiguous nucleotides is another quality consideration. The nucleotide symbol N indicates that the base could not be confidently identified. A small number of ambiguous bases may be acceptable, but reads containing many Ns may provide limited information for alignment and variant detection. Filtering can remove reads with excessive ambiguous positions, while low-quality individual bases may be trimmed or masked according to the workflow.
- fastp is an all-in-one preprocessing tool widely used for short-read FASTQ data. It can perform quality assessment, adapter trimming, quality filtering, length filtering, poly-G and poly-X trimming, and other preprocessing operations. It generates HTML and JSON reports that summarize data quality before and after processing. Its features make it convenient for projects involving large numbers of paired-end or single-end samples.
- A basic fastp command for paired-end sequencing data is:
fastp \
-i sample_R1.fastq.gz \
-I sample_R2.fastq.gz \
-o sample_R1_clean.fastq.gz \
-O sample_R2_clean.fastq.gz \
-h fastp_report.html \
-j fastp_report.json \
-w 8
- Here, -i and -I specify the input forward and reverse reads, while -o and -O specify the output files. The HTML and JSON options generate quality-control reports, and -w specifies the number of processing threads. fastp can also perform additional filtering and trimming operations through its command-line parameters. Researchers should inspect its reports and settings to understand which operations were performed.
- Trimmomatic is another established tool for trimming and filtering short-read sequencing data. It supports adapter removal, quality trimming, sliding-window filtering, and minimum-length filtering. It is commonly used in Illumina sequencing workflows and provides flexible control over preprocessing parameters. The appropriate tool depends on the sequencing data, the required operations, and the reproducibility requirements of the project.
- A simplified Trimmomatic command for paired-end reads is:
trimmomatic PE \
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
- This example uses a sliding window of four bases and a minimum average quality threshold of 20 within the window. Reads that become shorter than 50 bases are removed from the paired output. The command does not specify an adapter file, so adapter removal would need to be configured separately when required. The output includes paired reads and unpaired reads that remain after processing.
- Paired-end sequencing requires special attention during preprocessing. Each DNA fragment generates a forward read and a reverse read. These reads are linked and should remain synchronized throughout processing. If one read fails filtering while its partner passes, the workflow must handle the pair according to the chosen software and downstream requirements. Some tools retain surviving single reads in separate unpaired files, while others discard the entire pair when either mate fails. The treatment of orphan reads should be documented because it can influence alignment and downstream analysis.
- Poly-G trimming is relevant to certain short-read sequencing datasets, particularly those generated by platforms and configurations where low-signal cycles may produce artificial runs of guanine bases near read ends. Poly-A tails may also be present in RNA-related datasets, depending on the library preparation and sequencing strategy. Poly-X trimming can remove unwanted homopolymer tails, but it should only be applied when the biological and technical context supports it. Genuine biological poly-A sequences, homopolymer regions, and other meaningful sequence features should not be removed indiscriminately.
- Low-complexity filtering identifies reads with simple or repetitive sequence composition. Such reads may align ambiguously and provide limited information for some analyses. Low-complexity regions include sequences with long homopolymers, short tandem repeats, and other repetitive patterns. Tools such as DUST and related sequence-complexity methods can identify certain low-complexity regions. However, repetitive DNA is biologically important, and removing all repetitive sequences may be inappropriate for genome assembly, repeat analysis, or other specialized applications.
- Contamination screening is another important component of sequencing quality control. Contaminating sequences may originate from host organisms, microorganisms, laboratory reagents, environmental sources, or cross-sample contamination. In microbial sequencing, host-derived reads may need to be removed before analysing microbial communities. In human sequencing, contamination from other organisms or samples may affect interpretation. Screening can involve comparison with reference genomes, taxonomic classification, sequence composition analysis, and examination of unexpected alignments.
- Tools such as Kraken2, Centrifuge, and other taxonomic classifiers can help identify the taxonomic origin of sequencing reads. Alignment tools such as Bowtie2 or BWA can be used to map reads against selected host or contaminant reference sequences. The appropriate strategy depends on the organism, sample type, and research objective. Host-read removal is particularly relevant to metagenomic and microbiome studies, but the reference database must be selected carefully to avoid removing genuine microbial sequences that resemble host sequences.
- Duplicate reads may also be evaluated during preprocessing. In some workflows, duplicate marking or removal is performed after alignment because genomic coordinates and alignment information help identify reads that may originate from the same DNA fragment. In UMI-based workflows, molecular identifiers provide additional information for distinguishing independent molecules from PCR duplicates. Deduplication is not appropriate in every sequencing experiment. For example, RNA-seq may contain naturally repeated reads from highly expressed transcripts, and amplicon sequencing intentionally produces repeated observations of targeted regions. Removing duplicates without considering the experimental design can distort biological abundance estimates.
- Error correction is another preprocessing strategy. It aims to identify and correct sequencing errors by comparing reads with overlapping sequences, consensus information, or other evidence. For example, paired-end reads that overlap may provide an opportunity to correct low-quality mismatches when one read supports a base with substantially higher confidence than the other. Some sequencing workflows also use UMI-based consensus methods to reduce errors introduced during amplification or sequencing. Error correction should be applied with suitable methods and parameters because inappropriate correction can introduce false sequence changes or remove genuine biological variation.
- Preprocessing strategies differ between short-read and long-read sequencing. Short-read datasets commonly require adapter removal, quality trimming, filtering, and sometimes duplicate handling. Long-read datasets may require platform-specific processing, including read-quality assessment, adapter or barcode removal, read-length evaluation, and basecalling. For Oxford Nanopore sequencing, tools such as NanoPlot and NanoStat can summarize read-length and quality distributions, while Dorado performs basecalling from supported raw signal data. For PacBio sequencing, platform-specific tools and reports can be used to assess read quality, subreads, circular consensus reads, and HiFi data. Long-read workflows should preserve useful read length whenever possible because aggressive trimming may remove the long-range information that makes these technologies valuable.
- For Oxford Nanopore data, NanoPlot can generate graphical summaries of read length and quality. A typical command is:
NanoPlot \
–fastq sample.fastq.gz \
–outdir nanoplot_results/
- For PacBio data, quality assessment depends on the data type and the workflow used to generate subreads, circular consensus sequences, or HiFi reads. PacBio tools such as SMRT Link and associated command-line utilities support processing and quality assessment of PacBio sequencing data. The correct procedures should follow the data format and the platform’s current documentation.
- RNA sequencing preprocessing has additional considerations. RNA-seq libraries may contain residual ribosomal RNA, adapter sequences, low-quality bases, and technical artifacts associated with reverse transcription and amplification. The preprocessing workflow should preserve information needed for gene expression quantification and transcript analysis. Strand-specific library information should also be retained because it is important for identifying transcriptional orientation and resolving overlapping genes.
- For small RNA sequencing, read lengths are often much shorter than in conventional RNA-seq. Adapter removal is particularly important because sequencing reads may extend beyond the original small RNA molecule into the adapter sequence. After trimming, reads may be filtered according to the expected size range of the RNA species under investigation. The selected length range should reflect the biological targets, such as microRNAs or other small noncoding RNAs.
- Single-cell RNA sequencing requires specialized preprocessing because reads may contain cell barcodes and unique molecular identifiers. These sequences are used to assign transcripts to individual cells and distinguish original RNA molecules. Barcode correction, UMI processing, cell identification, and quality filtering are important steps before gene expression matrices are generated. Tools such as Cell Ranger, STARsolo, alevin-fry, and related pipelines perform several of these operations, depending on the experimental platform and library design.
- Metagenomic sequencing also requires application-specific preprocessing. Raw reads may contain host contamination, adapters, low-quality sequences, and unwanted laboratory or environmental contaminants. After initial QC and filtering, host reads may be removed before taxonomic classification or metagenomic assembly. However, filtering must be designed carefully because overly broad removal procedures can eliminate genuine microbial sequences. The selected reference database, taxonomic classification method, and contamination-screening strategy should be documented.
- The quality of preprocessing should be assessed by performing QC again after trimming and filtering. This second assessment determines whether adapter contamination and low-quality sequence problems have been reduced and whether the processing has introduced unintended effects. It is important to compare the number of reads, total bases, read-length distribution, quality scores, GC content, and other relevant measurements before and after processing. A successful workflow should improve or appropriately manage the identified technical problems without unnecessarily reducing the useful biological information.
- A general short-read quality-control and preprocessing workflow can be summarized as follows:
Raw FASTQ files
|
v
Initial quality control
|
v
Inspect FastQC and MultiQC reports
|
v
Identify adapters and technical artifacts
|
v
Adapter trimming and quality filtering
|
v
Remove unsuitable or contaminating reads
|
v
Post-processing quality control
|
v
Compare before-and-after QC metrics
|
v
- Prepare reads for downstream analysis
- For a reproducible analysis, preprocessing should be automated and documented. A simple Bash workflow using FastQC, fastp, and MultiQC can be structured as follows:
#!/bin/bash
set -euo pipefail
mkdir -p raw_qc cleaned_reads cleaned_qc reports
# Initial quality control
fastqc sample_R1.fastq.gz sample_R2.fastq.gz \
-o raw_qc/
# Adapter trimming and quality filtering
fastp \
-i sample_R1.fastq.gz \
-I sample_R2.fastq.gz \
-o cleaned_reads/sample_R1_clean.fastq.gz \
-O cleaned_reads/sample_R2_clean.fastq.gz \
-h reports/fastp_report.html \
-j reports/fastp_report.json \
-w 8
# Quality control after preprocessing
fastqc \
cleaned_reads/sample_R1_clean.fastq.gz \
cleaned_reads/sample_R2_clean.fastq.gz \
-o cleaned_qc/
# Combine reports
multiqc raw_qc cleaned_qc reports \
-o reports/multiqc_report/
- This is a basic illustrative workflow. It should be adapted to the actual library preparation protocol, adapter sequences, sequencing platform, and research objective. The fastp settings should be reviewed rather than assumed to be appropriate for every dataset. For large projects, the workflow can be expanded to process multiple samples using loops, configuration files, workflow managers, and sample metadata tables.
- Several tools are commonly used in sequencing QC and preprocessing. FastQC is used for initial read-quality assessment, while MultiQC combines results from multiple samples and tools. fastp provides integrated quality assessment and preprocessing for short-read data. Cutadapt is useful for adapter, primer, and poly-A trimming. Trimmomatic supports configurable short-read trimming and filtering. SeqKit provides utilities for FASTA and FASTQ processing. For long-read sequencing, NanoPlot and NanoStat support quality assessment of nanopore reads, while platform-specific PacBio and Oxford Nanopore tools support basecalling, consensus generation, and other preprocessing operations. The choice of software should reflect the sequencing technology and the type of data being analysed.
- Preprocessing also has important limitations. Trimming low-quality bases can reduce read length and may remove informative sequence. Aggressive filtering can reduce sequencing depth and eliminate reads that contain genuine biological variation. Adapter detection may be imperfect when the library structure is unknown or when sequencing errors occur within adapter sequences. Contamination removal depends on the quality and completeness of reference databases. Deduplication can distort expression or abundance estimates when repeated reads are biologically meaningful. Error correction may introduce false changes if the supporting evidence is insufficient. These limitations demonstrate why preprocessing should be guided by biological objectives rather than by the automatic removal of every unusual QC feature.
- The interpretation of QC reports also requires biological context. A high duplication rate may be expected in targeted sequencing or highly expressed RNA-seq libraries. A non-uniform GC distribution may reflect a real microbial community rather than contamination. Uneven base composition at the beginning of reads may be associated with RNA library preparation. Low-complexity sequences may be important in studies of repetitive DNA. QC warnings are therefore indicators for investigation, not automatic evidence that a dataset is unusable. Researchers should consider the sequencing protocol, sample type, reference genome, and intended analysis before changing the data.
- For reproducible bioinformatics research, it is important to preserve the original raw sequencing files and never overwrite them during preprocessing. Cleaned files should be stored separately, with clear sample identifiers and processing records. The software names and versions, command-line parameters, adapter sequences, quality thresholds, filtering criteria, and reference databases should be documented. Checksums can be used to verify file integrity during transfer and storage. Workflow management systems such as Snakemake and Nextflow can help automate processing, manage dependencies, and record the steps used to generate processed datasets.
- Sequencing quality control and preprocessing are fundamental to reliable bioinformatics analysis. They help identify technical problems, remove unwanted sequences, manage low-quality reads, and prepare sequencing data for alignment, assembly, variant detection, gene expression analysis, and metagenomic investigation. However, preprocessing must be performed carefully because excessive filtering or inappropriate correction can remove genuine biological information. Combining systematic quality assessment, application-specific processing, post-processing validation, and reproducible documentation allows researchers to produce more reliable sequencing datasets and strengthen the conclusions drawn from genomic and other omics analyses.