- Removal of contaminants and technical artifacts is an essential stage of sequencing data preprocessing in bioinformatics. Raw sequencing datasets may contain biological sequences originating from unintended organisms, laboratory contamination, host organisms, environmental microorganisms, or sample carryover. They may also contain non-biological or technically generated artifacts introduced during sample preparation, library construction, amplification, sequencing, basecalling, and data processing. If these unwanted sequences and artifacts are not identified and handled appropriately, they can affect read quality, genome assembly, sequence alignment, taxonomic classification, variant detection, gene expression analysis, and downstream biological interpretation. Contamination removal and artifact correction therefore help improve the reliability, accuracy, and reproducibility of genomic and other omics analyses.
- Biological contamination occurs when sequencing reads originate from organisms or biological materials that are not intended to be part of the study. Common sources include bacteria, fungi, viruses, human or animal DNA, plant material, environmental organisms, and laboratory-associated microorganisms. For example, a microbial genome sequencing experiment may contain reads from the human host, whereas a plant genome dataset may contain bacterial sequences from the laboratory environment or associated microorganisms. In metagenomic studies, however, the presence of multiple organisms is often the biological objective rather than contamination. Researchers must therefore distinguish unwanted biological material from organisms that are genuinely part of the sample.
- Laboratory contamination can occur during sample collection, DNA or RNA extraction, library preparation, PCR amplification, and sequencing. Contamination may be introduced through reagents, water, laboratory surfaces, extraction kits, pipettes, consumables, or cross-contamination between samples. Microbial DNA in extraction kits and other laboratory reagents is sometimes referred to as a reagent contaminant or kitome. Such contamination can be particularly important in low-biomass samples, where contaminant DNA may represent a substantial proportion of the total sequencing reads. Environmental contamination may also occur during sample collection and handling, especially when samples are exposed to soil, water, air, or other biological materials.
- Cross-sample contamination occurs when biological material from one sample enters another sample. It may result from sample handling errors, insufficient separation during library preparation, barcode misassignment, index hopping, or carryover between sequencing runs. Index hopping is a technical issue in multiplexed sequencing, particularly relevant to certain library and platform configurations, in which an incorrect index combination may cause reads to be assigned to the wrong sample. Unique dual indexing can reduce the risk of misassignment, but it does not eliminate every possible source of cross-sample contamination. Researchers should examine sample indexes, demultiplexing reports, negative controls, and unexpected taxonomic or sequence patterns when investigating this problem.
- Host contamination is a common challenge in microbiome, pathogen, metagenomic, and environmental sequencing. For example, sequencing DNA from a human stool, saliva, tissue, or respiratory sample may generate a large number of human reads alongside microbial sequences. Similarly, animal, plant, or other host DNA may be present in samples collected from associated microorganisms. If the research objective is to characterize the microbial community, host-derived reads may need to be removed before microbial classification or assembly. The appropriate host reference should be selected carefully, because an incomplete or incorrect reference can leave host reads undetected or incorrectly remove genuine microbial sequences.
- Reference-based host read removal commonly involves aligning sequencing reads against a host reference genome and retaining reads that do not align. Tools such as Bowtie2, BWA-MEM2, minimap2, and HISAT2 can be used for different sequencing data types and analytical requirements. Short reads are commonly aligned using Bowtie2 or BWA-MEM2, while minimap2 is widely used for long-read alignment and can also support short-read applications. The alignment parameters should be selected according to read length, sequencing technology, expected sequence divergence, and the required balance between sensitivity and specificity.
- The following example uses Bowtie2 to identify reads that align to a host reference genome and retain reads classified as unmapped. It assumes that the paired-end FASTQ files and a prepared Bowtie2 host reference index are available.
bowtie2 -x host_reference \
-1 sample_R1.fastq.gz \
-2 sample_R2.fastq.gz \
–very-sensitive \
–threads 8 \
–un-conc-gz sample_nonhost_%.fastq.gz \
-S host_alignment.sam
- The –un-conc-gz option writes paired reads that do not align concordantly to the host reference into separate output files. Depending on the study, researchers may also need to account for discordant pairs, singleton reads, and reads that align only partially. A simple strategy that removes only concordantly mapped pairs may retain some host-derived reads or discard useful microbial reads. The output should therefore be checked to confirm that the selected alignment strategy matches the biological objective.
- For long-read datasets, minimap2 can be used to align reads against a host reference. The following example illustrates an Oxford Nanopore read-mapping workflow:
minimap2 -ax map-ont -t 8 host_reference.mmi sample.fastq.gz \
| samtools sort -o host_alignment.bam
samtools index host_alignment.bam
- For PacBio HiFi reads, the map-hifi preset can be used instead of map-ont. Reads that do not align to the host reference can then be extracted using appropriate alignment filtering tools or a validated workflow. Researchers should carefully consider partially aligned reads, supplementary alignments, and reference completeness before deciding which reads to retain.
- Another important source of contamination is the presence of sequences from laboratory model organisms, commonly used vectors, cloning systems, or expression constructs. Examples include plasmid sequences, cloning vectors, bacterial expression hosts, and synthetic constructs. These sequences may enter a dataset during molecular cloning, recombinant protein production, transfection, or sample preparation. Vector contamination can affect genome assembly, gene annotation, and sequence similarity searches. Tools such as NCBI VecScreen, UniVec, and related sequence-screening resources can help identify vector-derived sequences. Researchers should also consider screening against relevant plasmid and laboratory organism references when the experimental design indicates a potential risk.
- Adapter contamination is a common technical artifact in sequencing data. Sequencing adapters are artificial oligonucleotide sequences attached to DNA or cDNA fragments during library preparation. When the insert fragment is shorter than the sequencing read length, the sequencing instrument may continue reading into the adapter sequence. Adapter contamination can interfere with alignment, assembly, sequence classification, and variant detection. Tools such as Cutadapt, fastp, Trimmomatic, and BBDuk can identify and remove adapter sequences. The adapter sequence must match the library preparation method and sequencing platform; a generic adapter sequence should not automatically be assumed to apply to every dataset.
- The following example demonstrates adapter removal and quality filtering using Cutadapt:
cutadapt \
-a AGATCGGAAGAGC \
-A AGATCGGAAGAGC \
-q 20 \
-m 50 \
-o trimmed_R1.fastq.gz \
-p trimmed_R2.fastq.gz \
sample_R1.fastq.gz \
sample_R2.fastq.gz
- The adapter sequences shown are illustrative and should be replaced with the actual sequences used in the library preparation protocol. The -q option performs quality trimming, while -m specifies a minimum retained read length. In workflows involving cell barcodes or unique molecular identifiers, researchers must ensure that required barcode and UMI sequences are preserved or extracted before trimming.
- PCR amplification can introduce additional technical artifacts. During amplification, duplicate copies of the same original DNA molecule may be generated. These PCR duplicates can produce an artificial increase in apparent sequencing depth and distort allele frequencies, coverage estimates, and molecular abundance measurements. In genome sequencing, duplicate reads are often identified by comparing their alignment positions and orientation. Tools such as Picard MarkDuplicates and SAMtools markdup can identify and mark duplicates in aligned sequencing data. However, identical reads do not always represent PCR duplicates, particularly in targeted sequencing, highly expressed RNA-seq regions, or low-complexity genomic regions where independent molecules may naturally produce identical alignments.
- Unique molecular identifiers provide a more reliable way to distinguish original molecules from amplification-derived copies. UMIs are short random or designed nucleotide sequences attached to individual molecules before amplification. Reads containing the same UMI and compatible alignment positions can be grouped into molecular families. Consensus sequences can then be generated to reduce sequencing errors and improve molecule counting. Tools such as UMI-tools support UMI extraction, grouping, deduplication, and related analyses. UMI-based deduplication is especially useful in single-cell RNA sequencing, targeted sequencing, and applications where accurate molecule counting is important.
- The following example illustrates duplicate marking with Picard after alignment and sorting:
picard MarkDuplicates \
I=sorted_alignment.bam \
O=marked_duplicates.bam \
M=duplicate_metrics.txt \
CREATE_INDEX=true
- This procedure marks duplicate reads rather than automatically removing them. Keeping duplicate information in the alignment file can be useful because downstream tools may apply different duplicate-handling strategies. Duplicate removal should not be performed indiscriminately, since naturally occurring identical fragments may be biologically meaningful.
- Sequencing instruments and library preparation procedures can also produce technical artifacts unrelated to biological contamination. These include low-quality reads, ambiguous nucleotide calls, abnormal base composition, artificial chimeric sequences, sequencing errors, barcode errors, and systematic platform-specific errors. Low-quality bases may arise from declining signal intensity, imperfect cluster separation, polymerase errors, or difficulties in interpreting sequencing signals. In short-read sequencing, quality often decreases toward the end of reads, while long-read technologies may show different error patterns depending on the platform and basecalling method. Tools such as FastQC, fastp, NanoPlot, NanoStat, and MultiQC can help identify these problems.
- Chimeric sequences contain fragments originating from two or more distinct DNA or RNA molecules joined together. They may be generated during PCR amplification, library construction, reverse transcription, ligation, or sequencing. Chimeric reads can create false genomic rearrangements, incorrect transcript structures, misleading taxonomic assignments, and artificial assembly connections. Their identification is particularly important in amplicon sequencing, metagenomics, transcriptomics, and long-read sequencing. Tools such as VSEARCH and USEARCH can identify potential chimeric sequences in amplicon datasets, while alignment patterns and specialized long-read analysis tools can help investigate suspected chimeric reads in other applications. Chimeric sequences should be interpreted carefully because some genuine biological events, including fusion transcripts and structural rearrangements, can also produce sequences spanning different genomic regions.
- Low-complexity sequences are regions containing repetitive or compositionally biased nucleotide patterns. Examples include homopolymer runs, simple tandem repeats, and regions dominated by a small number of nucleotide types. Such sequences can produce unreliable alignments and misleading similarity-search results. They may also contribute to false-positive sequence matches and inaccurate taxonomic classification. Tools such as DUST, tantan, SEG, and low-complexity filtering options in sequence-search software can identify or mask some of these regions. However, low-complexity sequences can be genuine biological features, including regulatory elements, repeat regions, and structurally important genomic sequences. Masking should therefore be guided by the analysis objective rather than applied automatically.
- Poly-G artifacts can occur in certain two-colour sequencing systems when signal interpretation becomes unreliable near the end of a read, resulting in artificial runs of guanine bases. These artifacts can affect quality profiles, read composition, and downstream alignment. Tools such as fastp provide options for identifying and trimming poly-G tails in supported sequencing workflows. Poly-A and poly-T tails may also occur naturally or be introduced through library preparation, especially in RNA sequencing. Their removal must be performed carefully because genuine polyadenylation and other biologically meaningful sequence features may be important for transcriptome analysis.
- Contamination screening can also identify unexpected microbial organisms, viruses, or other sequences in a dataset. Taxonomic classification tools such as Kraken2, Bracken, Centrifuge, and Kaiju compare reads against reference databases to estimate their taxonomic origins. These tools are useful for detecting unexpected organisms, identifying possible laboratory contaminants, and investigating mixed biological samples. However, taxonomic classification is affected by database completeness, reference quality, sequence conservation, and the presence of closely related organisms. A read assigned to a particular taxon should not automatically be treated as definitive evidence that the organism is present in the sample.
- The following example illustrates taxonomic classification using Kraken2:
kraken2 \
–db kraken_database \
–threads 8 \
–paired \
sample_R1.fastq.gz \
sample_R2.fastq.gz \
–report kraken_report.txt \
–output kraken_output.txt
- The Kraken2 database should be selected and documented according to the organisms relevant to the study. Researchers should examine classification confidence, unclassified reads, unexpected taxa, and possible database limitations. Bracken can be used with compatible Kraken2 databases and reports to estimate taxonomic abundance at selected taxonomic levels. Taxonomic results should be interpreted alongside negative controls, sample metadata, biological expectations, and independent evidence.
- Contamination assessment is especially important in low-biomass microbiome studies. In such studies, microbial DNA introduced by extraction kits, reagents, or laboratory environments may be comparable to or greater than the biological DNA in the original sample. Negative controls, including extraction blanks and library preparation blanks, help identify background contamination. Positive controls and mock microbial communities can be used to assess whether the laboratory and bioinformatics workflow can recover expected organisms. Statistical approaches may also identify taxa that are more prevalent in negative controls or inversely associated with sample DNA concentration. Tools and approaches such as decontam in R can support contaminant identification, but results should be interpreted using experimental design and biological knowledge.
- The removal of contaminants and technical artifacts should be performed in a controlled and documented manner. A typical workflow begins with raw-read quality assessment, followed by adapter detection and trimming, quality filtering, contamination screening, host read removal, and additional artifact handling appropriate to the experiment. The order may vary depending on the sequencing technology and study design. For example, host read removal may be performed before microbial assembly, whereas adapter trimming and barcode processing may be necessary before reliable alignment. Some workflows also perform contaminant screening both before and after read processing to identify sequences that become easier to classify after technical artifacts have been removed.
- A basic short-read preprocessing workflow can combine quality assessment, trimming, host screening, and post-processing evaluation. The following Bash example illustrates the main stages using FastQC, fastp, Bowtie2, SAMtools, and MultiQC. It is a simplified workflow and should be adapted to the sample type, reference database, and required handling of paired and unpaired reads.
# Initial quality assessment
fastqc sample_R1.fastq.gz sample_R2.fastq.gz -o qc_before/
# Adapter trimming and quality filtering
fastp \
-i sample_R1.fastq.gz \
-I sample_R2.fastq.gz \
-o trimmed_R1.fastq.gz \
-O trimmed_R2.fastq.gz \
–detect_adapter_for_pe \
–qualified_quality_phred 20 \
–length_required 50 \
–thread 8 \
–html fastp_report.html \
–json fastp_report.json
# Align reads against the host reference
bowtie2 \
-x host_reference \
-1 trimmed_R1.fastq.gz \
-2 trimmed_R2.fastq.gz \
–very-sensitive \
–threads 8 \
–un-conc-gz nonhost_%.fastq.gz \
-S host_alignment.sam
# Assess retained reads
fastqc nonhost_1.fastq.gz nonhost_2.fastq.gz -o qc_after/
# Combine quality reports
multiqc qc_before/ qc_after/ -o multiqc_report/
- The example uses paired-end reads and assumes that Bowtie2 has been provided with a correctly prepared host reference index. A production workflow should also record software versions, reference genome versions, adapter sequences, filtering parameters, and the number of reads retained or removed at each stage. It should account for unpaired reads and discordant alignments where relevant and should verify that the final outputs remain suitable for the intended analysis.
- Contamination removal can affect biological interpretation if genuine sequences are incorrectly classified as unwanted. For example, microbial sequences may share conserved regions with host genomes, and genuine microbial reads may align to host references because of sequence similarity. Conversely, incomplete host references may fail to remove some host-derived reads. In metagenomic studies, removing an organism simply because it is unexpected may eliminate a genuine but previously unreported member of the microbial community. Therefore, aggressive filtering should be avoided unless supported by appropriate evidence.
- The distinction between contamination and biological variation is particularly important in microbiome research. A microorganism detected in a negative control may also be genuinely present in a biological sample. Similarly, a low-abundance organism should not automatically be classified as contamination merely because it is uncommon. Researchers should compare the organism’s abundance and prevalence across samples and controls, examine reagent and laboratory histories, and consider whether the taxon is biologically plausible. Independent validation may be required when a finding has important scientific or clinical implications.
- Contamination and artifact removal also differ across sequencing applications. In whole-genome sequencing, host contamination, adapter sequences, PCR duplicates, and library artifacts can affect variant calling and genome assembly. In RNA sequencing, ribosomal RNA contamination, genomic DNA carryover, adapter sequences, and transcript-derived artifacts may influence gene expression estimates. In metagenomics, host DNA, reagent contaminants, index misassignment, and unexpected environmental sequences may affect microbial community profiles. In single-cell sequencing, barcode swapping, ambient RNA, doublets, and incorrect cell assignments are important technical concerns. In amplicon sequencing, primer dimers, nonspecific amplification, and chimeric sequences require particular attention.
- For RNA-seq, ribosomal RNA contamination is an important issue because ribosomal RNA can dominate sequencing libraries when depletion or poly(A) selection is incomplete. This reduces the proportion of reads available for measuring messenger RNA or other target RNA molecules. Tools such as SortMeRNA can identify and filter ribosomal RNA reads using reference databases. Researchers should select the appropriate strategy according to whether the experiment uses poly(A) enrichment, ribosomal RNA depletion, total RNA sequencing, or another library preparation method. Ribosomal RNA reads are not necessarily contaminants in every RNA-seq experiment; in some studies, they are the intended target.
- In single-cell RNA sequencing, ambient RNA refers to RNA molecules released from damaged or lysed cells that remain in the suspension and can enter droplets or partitions containing other cells. This can create false gene-expression signals and complicate cell-type identification. Doublets occur when two or more cells are captured together and represented as a single cell barcode. Tools such as SoupX, CellBender, DecontX, Scrublet, DoubletFinder, and scDblFinder address different aspects of ambient RNA correction and doublet detection. These methods do not identify the same type of artifact and should be selected according to the platform and analysis objective.
- In addition to biological contaminants and sequencing artifacts, computational errors can introduce problems during data processing. Incorrect reference genome versions, mismatched genome assemblies, inconsistent chromosome naming conventions, corrupted files, incomplete downloads, and incorrect sample assignments can produce misleading results. File integrity can be checked using checksums such as MD5 or SHA-256. Sequence files can be validated using tools such as SeqKit, while alignment and variant files can be checked using SAMtools and bcftools. Metadata should be examined to ensure that sample identifiers, sequencing runs, reference assemblies, and experimental groups are correctly associated.
- The following commands illustrate how to calculate and verify a SHA-256 checksum for a sequencing file:
# Calculate a checksum
sha256sum sample_R1.fastq.gz > sample_R1.fastq.gz.sha256
# Verify the checksum
sha256sum -c sample_R1.fastq.gz.sha256
- File integrity checks are particularly useful when sequencing data are transferred between laboratories, downloaded from public repositories, or stored in long-term archives. A matching checksum indicates that the file content has not changed relative to the recorded checksum, although it does not establish that the original file was biologically correct or free of contamination.
- Quality control reports should be generated before and after contaminant removal to assess whether the processing steps improved the dataset. Important measurements include the number of raw reads, retained reads, removed reads, percentage of host-mapped reads, adapter content, average base quality, GC content, duplication rate, read length distribution, and taxonomic composition. For paired-end sequencing, both mates should be evaluated to ensure that read pairs remain correctly synchronized. Unexpected changes in read counts or composition may indicate overly aggressive filtering, incorrect parameters, or problems with the processing workflow.
- Several tools are commonly used for contamination and technical artifact removal. FastQC and MultiQC support quality assessment and reporting. Fastp, Cutadapt, Trimmomatic, and BBDuk support adapter trimming and quality filtering. Bowtie2, BWA-MEM2, and minimap2 support reference-based alignment and host read identification. SAMtools and Picard support alignment processing and duplicate marking. Kraken2, Bracken, Centrifuge, and Kaiju support taxonomic classification. VSEARCH and USEARCH can identify potential chimeric amplicon sequences. SortMeRNA supports ribosomal RNA filtering, while UMI-tools supports UMI-based processing. The appropriate tools depend on the sequencing platform, library preparation, biological material, and research question.
- Removal of contaminants and technical artifacts is not simply a process of deleting unwanted reads. It requires understanding the origin of each sequence, the experimental design, the characteristics of the sequencing platform, and the potential biological significance of the data. A sequence that appears unusual may represent genuine biological variation, while a sequence that appears familiar may have been introduced during laboratory processing. Filtering decisions should therefore be based on evidence rather than assumptions.
- For reproducible research, all preprocessing steps should be documented, including the original input files, software names and versions, reference databases, adapter sequences, filtering thresholds, alignment parameters, and the number of reads removed or retained. Negative and positive controls should be included where appropriate, and intermediate files and quality reports should be preserved. Workflow management systems such as Snakemake and Nextflow can help automate the process and maintain consistent analysis procedures across samples. Container technologies such as Docker and Apptainer can also support reproducible software environments.
- Removal of contaminants and technical artifacts is fundamental to producing reliable sequencing datasets. Biological contaminants, host-derived sequences, laboratory-associated DNA, adapters, PCR duplicates, chimeric reads, low-complexity regions, and sequencing-specific artifacts can all affect downstream analyses. By combining careful experimental controls, appropriate reference databases, validated bioinformatics tools, and transparent quality assessment, researchers can reduce technical interference while preserving genuine biological information. Accurate contaminant removal ultimately improves the reliability of genome analysis, transcriptomics, metagenomics, variant detection, microbial profiling, and other bioinformatics applications.