Medlib: A Feature-Rich C/C++ Library for Exact Alignment of Nanopore Sequences Using Multiple Edit Distance

Read the full article See related articles

Listed in

This article is not in any list yet, why not save it to one of your lists.
Log in to save this article

Abstract

Pairwise sequence alignment is a cornerstone of bioinformatics, driving applications from variant calling to barcode demultiplexing. However, the advent of long-read, high-error sequencing platforms—such as Oxford Nanopore Technologies—demands alignment tools that not only deliver exact results but also accommodate the elevated noise inherent in these data. Here, we introduce Medlib (Multiple Edit Distance Library) that offers both high performance and novel, biologically motivated features. Medlib’s threshold mode allows users to retrieve every alignment with edit distance k ≤ k th and optionally alignment score s ≥ s th , ensuring comprehensive discovery of all plausible matches. Counterintuitively, this exhaustive retrieval outpaces traditional minimum-error searches. Medlib further provides the first exact implementations of overlap-aware reporting and motif boundary treatment. Medlib supports multiple input formats, predefined and custom alphabets, affine-gap scoring applied retrospectively, built-in dedicated multithreading schemes, and user-defined function callbacks for immediate post-processing. Benchmarking against Edlib demonstrates a 1.6× speedup in minimum mode and even greater gains (2.5×) in threshold mode—while delivering up to twice as many alignments. Medlib thus offers a robust, feature-rich engine for exact pairwise alignment in modern, high-throughput sequencing workflows.

Availability and Implementation

Source code, installation instructions and test data are freely available for download at https://github.com/Mehdi-Rafeie/Medlib , under the MIT license.

Article activity feed