AmpliconHunter2: a SIMD-Accelerated In-Silico PCR Engine

Rye Howard-Stone \ORCID 0009-0005-7518-1867, Ion I. Măndoiu \ORCID 0000-0002-4818-0237 · 2025

Read AmpliconHunter2: a SIMD-Accelerated In-Silico PCR Engine by Rye Howard-Stone \ORCID 0009-0005-7518-1867, Ion I. Măndoiu \ORCID 0000-0002-4818-0237 (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2511-00170.txt.

Introduction

Rye Howard-Stone and Ion Mandoiu present AmpliconHunter2, a fast in silico PCR engine written in C for finding primer matches across genomes. The tool handles degenerate primers with an accurate melting temperature model, using a bit-mask matcher accelerated by AVX2 vector instructions. User-specified mismatches and three-prime clamp constraints are supported, and amplicons are called in all four primer pair orientations.

Sequences are packed into two-bit batches and streamed in chunks to keep memory low, with optional primer trimming and barcode extraction. Bioinformatics readers get a scalable simulator for primer design. Predicting PCR products in silico prevents wasted laboratory work on primer pairs that misfire.

Catalog record

CREATORRye Howard-Stone \ORCID 0009-0005-7518-1867, Ion I. Măndoiu \ORCID 0000-0002-4818-0237
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE22 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2511-00170

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

AmpliconHunter2: a SIMD-Accelerated In-Silico PCR Engine Rye Howard-Stone \ORCID 0009-0005-7518-1867, Ion I. Măndoiu \ORCID 0000-0002-4818-0237 Abstract Summary: We present AmpliconHunter2 (AHv2), a highly scalable in silico PCR engine written in C that can handle degenerate primers and uses a highly accurate melting temperature model. AHv2 implements a bit-mask IUPAC matcher with AVX2 SIMD acceleration, supports user-specified mismatches and 3’ clamp constraints, calls amplicons in all four primer pair orientations (FR/RF/FF/RR), and optionally trims primers and extracts fixed-length flanking barcodes into FASTA headers. The pipeline packs FASTA into 2-bit batches, streams them in 16 MB chunks, writes amplicons to per-thread temp files and concatenates outputs, minimizing peak RSS during amplicon finding. We also summarize updates to the Python reference (AHv1.1). Availability and Implementation: AmpliconHunter2 is available as a freely available webserver at: https://ah2.uconn.engr.edu . Source code is available at: https://github.com/rhowardstone/AmpliconHunter2 under an MIT license. AHv2 was implemented in C; AHv1.1 using Python 3 with Hyperscan. Contact: [email protected] Supplementary information: Supplementary data are available at Bioinformatics online. Howard-Stone and Măndoiu \ast ]Corresponding author. [email protected] 0Year 0Year 0Year keywords in silico PCR, AVX2, SIMD, IUPAC matching, barcodes, amplicon sequencing, streaming, 2-bit encoding † † journal: Bioinformatics † † doi: DOI HERE † † copyright-year: 2025 † † year: 2025 † † access: Advance Access Publication Date: Day Month Year † † appnotes: Application Note † † firstpage: 1 † † address: School of Computing, University of Connecticut, 371 Fairfield Way, 06269, \state CT, USA † † corresponding: [ † † received: Date † † revised: Date † † accepted: Date 1 Introduction Polymerase chain reaction (PCR) amplicon sequencing remains a cornerstone of microbiome profiling because it is cost-effective, scalable and can generate taxonomic profiles from complex microbial communities. Most microbial surveys amplify portions of the 16S rRNA gene because this gene contains nine hypervariable regions (V1–V9) flanked by conserved segments that allow the same primers to amplify diverse bacterial taxa. Despite its ubiquity, amplicon sequencing can be affected by amplification bias: variability in primer binding sites across taxa means that some organisms may be under-represented in sequence data. Indeed, recent studies emphasize that commonly used universal primer sets often fail to capture the full microbial diversity in a sample and that primer design must account for inter-genomic variation [ Sunthornthummas et al. 2025 ] . As in vitro experimentation is expensive, practitioners frequently use in silico tools to predict genome amplification patterns and assess off-target amplification before wet-lab experiments. Existing in silico tools, however, struggle to process currently available million-genome datasets or lack features such as the accurate modeling of melting temperature with mismatches required by commonly used sets of degenerate primers. To address these shortcomings, we recently released AmpliconHunter v1 (AHv1), a scalable in silico PCR package implemented in Python [ Howard-Stone and Măndoiu 2026 ] . AHv1 relies on the Hyperscan regex engine Wang et al. 2019 for performing approximate matching with mismatches and performs nearest-neighbor melting temperature calculations using the BioPython’s Tm_NN function. In this paper we further improve the scalability of in silico PCR by introducing AmpliconHunter v2 (AHv2). AHv2 is written in C and implements a bit-mask IUPAC matcher with AVX2 SIMD acceleration. For this tool, we also implemented a C version of the nearest-neighbor melting temperature model that is identical to BioPython’s Tm_NN function. In the rest of the paper we describe AHv2 and provide benchmarking results comparing it with an updated version of AHv1 (AHv1.1) and several interim versions (Table 1 ). 2 Implementations AHv1.1 is a functional update to AmpliconHunter [ Howard-Stone and Măndoiu 2026 ] , that permits FASTQ input and output, optionally trims primer sequences, extracts fixed-length flanking barcodes and can automatically filter off-target amplicons. When published, AmpliconHunter was compared against prior efforts such as PrimerEvalPy [ Vázquez-González et al. 2024 ] and Ribdif2 [ Murphy and Strube 2023 ] , which offer utilities for in silico PCR, but are not designed for million-genome scale. AHv1.1 retains nearly identical runtime characteristics as version 1, which was found to be 100 times faster than PrimerEvalPy and 10 times faster than Ribdif2, while supporting significantly more features. AHv2. \alpha was rewritten in C to use 2-bit compressed data for performance. Input FASTA files are compressed into 2-bit batches that store headers, lengths and packed bases. These batches are memory-mapped with MAP_PRIVATE ; AHv2. \alpha advises the kernel that pages will be accessed sequentially and dropped once consumed using posix_madvise with POSIX_MADV_SEQUENTIAL and POSIX_MADV_DONTNEED The engine enforces a user-defined 3-prime clamp, streams amplicons to per-thread buffers and periodically merges them to minimize peak resident set size (RSS). AHv2. \alpha outputs FASTA only and omits melting temperature ( T_{m} ), HMM calculation, decoy analysis, and taxonomy modules for simplicity. AHv2. \beta builds on AHv2. \alpha by incorporating AVX2 parallelization, improved thread scheduling and dynamic buffer allocation. Primers are compiled into per-base IUPAC masks and matched using AVX2 256-bit registers; each register holds 32 bytes, allowing mismatches to be counted in parallel. AHv2. \beta achieves lower runtime but consumes untenable RAM. AHv2. \gamma further optimizes the AVX2 matcher and I/O pipeline by reading data in 16 MB chunks. It hoists primer masks into contiguous vectors, employs unrolled loops to reduce branch mispredictions, and aggressively reclaims memory after each batch. AHv2. \gamma also uses static scheduling to mitigate load imbalance. These changes yield the fastest runtimes and the best parallel efficiency but still incur a moderate memory footprint due to decoded cache blocks. AHv2 reimplements BioPython’s entire Tm_NN function in C, permitting exact replication of the calculations in AHv1.1, for any parameter combination and all salt correction methods. Results are rounded to two decimal places but are otherwise identical to the BioPython annotations. AHv2 omits HMMs, decoys, taxonomy, and FASTQ features by design for minimal dependencies and maximal throughput. 3 Results We compared AHv1.1–AHv2 using six tests. All comparisons used 204.8K genomes from the AllTheBacteria genome collection, a set of 2.4M publicly available bacterial assemblies that we previously used for large-scale amplicon evaluation [ Hunt et al. 2024 ] . Instructions for downloading the genomes we tested are shown as part of our supplementary repository. Each test includes multiple replicates. The benchmarking script used the same set of primer pairs (V1V9) and parameters (two mismatches, clamp size of 3) across versions. Tests 1–5 were all conducted on the 12.8K genome subset. Filtering based on T_{m} is disabled in both implementations that support it: AHv1.1 and AHv2; however, both implementations automatically compute and annotate amplicons with T_{m} using the same nearest-neighbor model. Figure 1: Runtimes for AHv1.1–AHv2 across six experiments. Lines are means; ribbons show 95% CI. (A) Input-size scaling across 6.4K–204.8K genomes. (B) Effect of primer degeneracy (number of appended N bases). (C) Effect of allowed mismatches (substitutions). (D) Thread scaling from 1–190 threads. (E) Cold vs warm cache performance. (F) Primer pair performance (Titan, V1V9, V3V4). 3.1 Input size scaling Figure 1 A shows the runtime as the number of genomes increases (6.4K–204.8K). AHv2 consistently performs the fastest, followed by AHv2. \gamma , AHv2. \beta , AHv2. \alpha and AHv1.1. AHv2 completes 204.8K genomes in 347.9 seconds (95% CI: [332.0, 363.8]), whereas AHv1.1 requires 2056.5 seconds (95% CI: [1925.5, 2187.6]). Memory usage (Figure S1 A) tells a different

Read the complete text