Medlib: A Feature-Rich C/C++ Library for Exact Alignment of Nanopore Sequences Using Multiple Edit Distance
Preprint
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.Keywords
Funding Information
- Cancer Council New South Wales (RG 20-11)
This publication has 29 references indexed in Scilit:
- Single-molecule protein sequencing with nanoporesNature Reviews Bioengineering, 2024
- A signal processing and deep learning framework for methylation detection using Oxford Nanopore sequencingNature Communications, 2024
- Detection of m6A from direct RNA sequencing using a multiple instance learning frameworkNature Methods, 2022
- Alignment and integration of spatial transcriptomics dataNature Methods, 2022
- Nanopore sequencing technology, bioinformatics and applicationsNature Biotechnology, 2021
- Haplotype-resolved de novo assembly using phased assembly graphs with hifiasmNature Methods, 2021
- Basic Local Alignment Search ToolJournal of Molecular Biology, 1990
- An improved algorithm for matching biological sequencesJournal of Molecular Biology, 1982
- Identification of common molecular subsequencesJournal of Molecular Biology, 1981
- A general method applicable to the search for similarities in the amino acid sequence of two proteinsJournal of Molecular Biology, 1970