PIMENTO: A PrIMEr infereNce TOolkit to facilitate large-scale calling of amplicon sequence variants

Christian Atallah, Lorna Richardson, Martín Beracochea, Robert FinnbioRxiv 2025 · DOI

TL;DR

This paper introduces PIMENTO, a Python toolkit that automates the identification and removal of sequencing primers from large-scale DNA metabarcoding datasets. By addressing the challenge of missing or inconsistent primer metadata, PIMENTO enables more robust and scalable amplicon sequence variant (ASV) calling, crucial for accurately assessing biodiversity in environmental samples.

What Problem Does This Paper Address?

DNA metabarcoding is a powerful technique for identifying the diversity of organisms within an environmental sample by sequencing specific marker genes. A critical step in analyzing this data is calling Amplicon Sequence Variants (ASVs), which represent the unique genetic sequences present. However, a major bottleneck in large-scale ASV calling, especially when using publicly available data, is the presence of primer sequences at the beginning and end of sequencing reads. These primers, used to amplify specific DNA regions, must be removed before ASV calling. The problem is that this primer information is often missing or inconsistent in public sequence databases, making automated analysis difficult. Without accurate primer removal, ASV calling can be compromised by chimeric sequences and inaccurate diversity estimates.

Methods

PIMENTO employs a novel dual-strategy approach to infer primer sequences:

  • Standard Primer Search: This strategy uses a curated library of known, commonly used metabarcoding primers. It performs fuzzy regular expression searches against the initial bases of sequencing reads to identify matches. Primers are considered detected if they appear in a significant proportion of reads (defaulting to 60%).
  • Primer Cutoff Prediction: For cases where standard primers are not found, this strategy uses a heuristic approach based on base-conservation patterns. It analyzes the conservation of bases at the beginning of reads, assuming that primer sequences will be highly conserved, while the subsequent biological sequence will be more variable. This method identifies a "cutoff point" where the primer likely ends and the biological sequence begins, allowing for the inference of primer sequences and their trimming. This strategy involves several steps, including calculating base-conservation vectors and identifying inflection points in these vectors.

PIMENTO also includes an optional preliminary step to flag whether primers are likely present in the reads before proceeding with the more intensive cutoff prediction.

Datasets

The primary dataset used for evaluation was the Marine Survey Dataset (MSD), comprising 855 paired-end, marine microbiome, amplicon sequencing runs randomly retrieved from the European Nucleotide Archive (ENA).

Two additional biome-specific datasets were created to assess PIMENTO's consistency across different environments:

  • Soil Survey Dataset (SSD): 79 random runs from ENA.
  • Human Gut Survey Dataset (HGSD): 78 random runs from ENA.

Key Insights and Ideas

  • Primer Metadata is a Major Bottleneck: The lack of standardized and complete primer metadata in public sequence databases is a significant hurdle for automated, large-scale metabarcoding analysis.
  • Dual Strategy for Robustness: Combining a curated library search with a de novo base-conservation approach makes PIMENTO versatile, capable of handling both known and novel primer sets.
  • Heuristic Cutoff Prediction Works: The base-conservation strategy, while heuristic, proved effective in identifying primer cutoff points, even for primers not in the standard library.
  • Crowdsourcing Potential: The ability to identify new primers that can be added to the standard library highlights the potential for community-driven improvement of PIMENTO's capabilities.

Key Results

  • High Confidence Outcomes: Across the tested datasets, PIMENTO achieved high confidence in primer inference for a substantial proportion of runs: 80.9% for the MSD, 81.0% for the SSD, and 67.9% for the HGSD.
  • Primer Presence: For the MSD, 80.9% of runs were confidently identified as having primers removed (either by standard search or cutoff prediction), with 23% confidently identified as primer-free.
  • Standard Primer Performance: For runs where standard primers were identified, they were present in the vast majority of reads (first quartiles of 0.98 and 0.97 for forward and reverse strands, respectively), indicating effective primer binding.
  • Cutoff Prediction Accuracy: In comparisons with literature, primers predicted by the cutoff method showed exact sequence identity to native primers, though sometimes with slight length differences.
  • Biome Consistency: PIMENTO demonstrated consistent performance across marine, soil, and human gut biomes, with high confidence outcomes generally exceeding 65%.

Limitations and Future Work

  • False Positives: The paper acknowledges that the heuristic nature of the cutoff prediction method can lead to false positives, where primers are inferred when they are not present. Validation of low-confidence inferred primers is recommended.
  • Primer Length Variation: Inferred primers can sometimes be slightly shorter or longer than the true primer, which could impact downstream ASV calling by either failing to fully remove the primer or trimming biological sequence.
  • Future Work: The authors suggest that adding newly identified primers to the standard library through community contributions (e.g., via GitHub issues) is a significant avenue for improving PIMENTO's detection capabilities over time. Further validation strategies for automatically inferred primers are also discussed.

Summary updated

Abstract

Abstract The identification of amplicon sequence variants from DNA metabarcoding data is a common method for revealing the taxonomic makeup of environmental samples, and for allowing comparative studies between similar datasets. A significant hurdle to the large-scale calling of amplicon sequence variants from publicly available nucleotide datasets is the heterogeneous presence of primer sequences in reads, the removal of which is a necessary pre-processing step for this form of analysis. Furthermore, as the details of the experimental primers are rarely captured in the metadata associated with the sequence records, there is a need for a method that can automatically infer the presence and identity of primers in sequencing data. In this work, we introduce PIMENTO, a Python package which uses a dual-strategy approach for identifying primers that are present in sequencing reads to enable their removal, and therefore facilitate amplicon sequence variant calling at scale.
BibTeX
@misc{atallah2025pimento,
  author = {Christian Atallah and Lorna Richardson and Martín Beracochea and ROBERT FINN},
  title = {{PIMENTO: A PrIMEr infereNce TOolkit to facilitate large-scale calling of amplicon sequence variants}},
  year = {2025},
  doi = {10.1101/2025.07.04.663168},
  howpublished = {bioRxiv},
}
Figure