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

16s Contaminant Removal

If you work with 16S rRNA amplicon sequencing data, you have likely encountered sequences that do not belong to your sample. Reagent contaminants, cross contamination from laboratory environments, and index hopping can inflate diversity and obscure biological signals. This guide explains how to identify and remove contaminants using a source bounded workflow. It is written for graduate students, postdocs, and bioinformaticians who have already generated an amplicon sequence variant (ASV) table and want to clean it before downstream analysis. You should also read our companion guides on Fastq Read Quality Metrics and Adapter Trimming Validation to ensure your raw data is properly prepared before contamination filtering.

Contamination removal is not a single button click. It requires understanding where contamination originates and which filtering strategy fits your experimental design. The Bioconductor package decontam Bioconductor is the most widely used tool for this task, but its effectiveness depends on proper controls and appropriate parameter selection. This guide draws on authoritative training materials from EMBL EBI EMBL-EBI Training and practical workflows from the Galaxy Training Network Galaxy Training Network.

At a Glance

Aspect Key Information
Goal Remove contaminant ASVs from 16S amplicon data while retaining true low abundance taxa
Primary method decontam package (Bioconductor) using either prevalence or frequency based approach
Required inputs ASV table (or OTU table) and metadata indicating sample types (true sample vs. negative control)
Alternative methods MicroDecon, SourceTracker, manual removal based on known contaminants
Best practice Include extraction and PCR negative controls in every sequencing run
Main pitfall Removing genuine low abundance taxa by applying overly aggressive thresholds

Core Concepts and Decision Points

Contaminant sequences enter 16S datasets through several routes. Reagent kits, especially DNA extraction columns and polymerase enzymes, carry trace microbial DNA that is amplified during PCR. Laboratory air and handling surfaces contribute additional sequences. In multiplexed sequencing runs, index hopping can swap reads between samples, though this usually affects a small fraction of reads. A study on vanadate reducing bacteria isolated from contaminated groundwater noted that laboratory reagents can introduce false positives even in carefully controlled enrichments Reduction and resistance of vanadate by Lysinibacillus fusiformis. For 16S work, the most common source is the extraction kit itself.

The two core strategies for detecting contaminants are prevalence based and frequency based.

Prevalence based detection compares the occurrence of each ASV in true samples versus negative controls. An ASV that appears much more often in negative controls is considered a contaminant. This method requires at least a few negative controls. It works best when contamination is consistent across controls and samples.

Frequency based detection uses the total DNA concentration of each sample as a covariate. The idea is that contaminant sequences are proportionally higher in low biomass samples. If the frequency of an ASV correlates inversely with sample DNA concentration, it is likely a contaminant. This method does not require negative controls, but it demands accurate DNA concentration measurements and assumes that true taxa have a constant relative abundance across biomass levels.

Your decision depends on your experimental design. If you have negative controls, use the prevalence method. If you have DNA concentration data and no negative controls, use the frequency method. If both are available, use the intersection or the combined method offered by decontam. The Galaxy Training Network provides a clear step by step tutorial for running decontam in a graphical interface Galaxy Training Network.

Workflow or Implementation Steps

The following workflow assumes you have already processed raw sequencing reads into an ASV table using tools such as QIIME 2, DADA2, or mothur. If you have not done that, consult the NCBI Bookshelf references on sequence processing NCBI Bookshelf.

Step 1: Prepare your ASV table and metadata

Your ASV table should contain counts per ASV per sample. Filter out any ASVs that appear in only one sample across the entire dataset, as singletons are often spurious. This step is not contaminant removal per se, but it reduces the feature table size and simplifies downstream filtering.

Your metadata file must include a column indicating whether each sample is a true sample or a negative control. In decontam terms, a true sample gets a label such as “true sample” and a negative control gets “control.” For frequency based analysis, include a column with DNA concentration (e.g., ng/µL) or another quantitative measure of sample biomass.

Step 2: Run the prevalence method

Load the decontam package in R or RStudio. Use the isContaminant function with method = "prevalence". The default threshold is 0.1, meaning that an ASV with a probability greater than 0.1 of being a contaminant is flagged. You can adjust this threshold. A lower threshold removes more ASVs but risks removing genuine taxa. A higher threshold retains more sequences but may leave contaminants in the data.

Examine the table of contaminant probabilities. The function returns a column contaminant with TRUE or FALSE. Review which ASVs are flagged. If you notice that ASVs with expected biological relevance (e.g., known plant symbionts) are flagged, consider raising the threshold.

Step 3: Run the frequency method (optional)

If you have DNA concentration data, run isContaminant with method = "frequency". This method fits a statistical model using sample concentration as a predictor. The output includes a p.value column. ASVs with low p values are considered contaminants. You must decide on a significance cutoff, typically p < 0.05 or p < 0.01.

Note that the frequency method is more sensitive to outliers and to samples with extreme concentration values. Validate that the results are consistent with biological expectations.

Step 4: Combine methods or choose one

If you ran both methods, you can take the union of flagged ASVs and remove them all. Alternatively, take the intersection to be conservative. The decontam package supports a combined method that uses both prevalence and concentration information. Use method = "combined" to run it.

Step 5: Remove contaminant ASVs

Once you have a list of contaminants, filter them out of your ASV table. You can do this in R using t() or via the phyloseq package if you are using that framework. Verify that the total read count in negative controls drops substantially after removal. If negative controls still contain many reads, the filtering may have been too lenient.

Step 6: Document your threshold and reasoning

Always record the method, threshold, and number of removed ASVs in your lab notebook or analysis log. This transparency allows reviewers to evaluate your decisions. Research on biochar assisted microbial remediation emphasizes the importance of documenting contamination control steps in environmental microbiome studies Enhancing chlorpyrifos degradation.

Quality Checks

After you remove contaminants, run these checks.

Check negative controls. Your negative controls should have very few reads after filtering. If they still contain thousands of reads, either the contaminant removal was insufficient or your controls were themselves contaminated during handling.

Compare alpha diversity before and after removal. A well designed contaminant removal step should decrease apparent richness in negative controls but not dramatically change diversity in true samples. If you see a large drop in richness across all samples, you may have removed genuine taxa.

Check the taxonomic composition of removed ASVs. Often the removed sequences belong to common reagent contaminants such as Ralstonia, Bradyrhizobium, or Cutibacterium. If cultured in your laboratory, these may be legitimate. Use your domain knowledge to decide. A study on hybrid constructed wetlands noted that certain bacteria associated with the rhizosphere could be mistaken for contaminants if control samples are not properly handled Associations between rhizosphere microbial community.

Validate with positive controls. If you included a mock community with known composition, confirm that the expected taxa remain and unexpected ones are removed.

Common Mistakes

Using negative controls as a filter without also checking prevalence in true samples. Some contaminant ASVs appear in only one or two negative controls but also appear in many true samples at low abundance. Removing them solely based on presence in controls can be too aggressive. Use decontam and rely on the probability score.

Running decontam on a rarefied table. Rarefaction reduces counts and can distort the frequency based model. Always run contaminant removal on the unrarefied ASV table. Rarefy after filtering if you plan to use rarefied data for diversity analysis.

Ignoring batch effects. If you sequenced samples in multiple runs, reagent batch contamination may differ. Treat each sequencing batch separately. Pooling all samples together can cause decontam to miss batch specific contaminants.

Setting the threshold too low. A prevalence threshold of 0.5 is often too high and will leave many contaminants in the data. A threshold of 0.1 is standard but may still be too stringent for some studies. Test multiple thresholds and inspect the results.

Removing ASVs manually without statistical justification. Hand picking ASVs based on taxonomy is subjective and introduces bias. Use an automated method and document the criteria.

Limits of Interpretation

Decontam and other statistical methods cannot distinguish between a true low abundance taxon that happens to be present in a negative control due to low level cross contamination and a legitimate environmental organism that is also in reagents. For example, a bacterium that is both a soil resident and a known kit contaminant may be flagged. In such cases, you must rely on your experimental design and biological judgment. A study on co contamination of microplastics and PFOA in rhizosphere communities warned that some abundant taxa in treatment samples could be mislabeled as contaminants if controls are not adequately matched Co contamination of hybrid microplastics.

Contaminant removal does not address index hopping or sample cross contamination. Those require separate steps such as using unique dual indexing or removing samples with low index quality.

No method can recover an ASV that was never genuinely present. If a contaminant is removed, you may lose some true signal from taxa that are also found in controls. The trade off is between false positives (retained contaminants) and false negatives (removed true taxa). The choice depends on the question. For discovery studies, a more permissive threshold may be acceptable. For hypothesis testing about specific taxa, be more aggressive.

Finally, contaminant removal is an active research area. New tools like MicroDecon and SourceTracker offer alternative approaches. The EMBL EBI Training portal regularly updates its resources on microbial community analysis EMBL-EBI Training.

Frequently Asked Questions

Q: Can I use decontam if I have only one negative control? A: Yes, but the prevalence method requires at least one control. With a single control, the statistical power is low. The frequency method may be a better alternative if you have DNA concentration data. In any case, be conservative in interpreting the results and consider validating with additional controls in a future run.

Q: How do I choose between the prevalence and frequency method? A: Use prevalence if you have multiple negative controls (at least three recommended). Use frequency if you have DNA concentration data and few or no negative controls. If both are available, use the combined method.

Q: Will contaminant removal affect my beta diversity results? A: Yes, especially if you remove ASVs that are present in many samples. Always compare beta diversity before and after removal. If the ordination plot changes dramatically, the removal may have altered the biological structure. In that case, consider a higher threshold.

Q: What if my negative controls contain expected environmental taxa? A: This can happen if the controls were exposed to the environment or if the kit itself contains sequences from common soil or water bacteria. It is acceptable to keep those ASVs if they are also present at higher abundance in true samples. Decontam’s probability score will typically be low for such ASVs if they are truly enriched in samples.

References and Further Reading

Related Articles