bioRxivBioinformaticsPreprint
Are all global alignment algorithms and implementations correct?
Tomáš FlouriiD, Kassian Kobert, Torbjørn Rognes, Alexandros StamatakisiD
Abstract
Abstract.Pairwise sequence alignment is perhaps the most fundamental bioinformatics operation. An optimal global alignment algorithm was described in 1970 by Needleman and Wunsch. In 1982 Gotoh presented an improved algorithm with lower time complexity. Gotohs algorithm is frequently cited (1447 citations, Google Scholar, May 2015), taught and, most importantly, used as well as implemented. While implementing the algorithm, we discovered two mathematical mistakes in Gotohs paper that induce sub-optimal sequence alignments. First, there are minor indexing mistakes in the dynamic programming algorithm which become apparent immediately when implementing the procedure. Hence, we report on these for the sake of completeness. Second, there is a more profound problem with the dynamic programming matrix initialization. This initialization issue can easily be missed and find its way into actual implementations. This error is also present in standard text books. Namely, the widely used books by Gusfield and Waterman. To obtain an initial estimate of the extent to which this error has been propagated, we scrutinized freely available undergraduate lecture slides. We found that 8 out of 31 lecture slides contained the mistake, while 16 out of 31 simply omit parts of the initialization, thus giving an incomplete description of the algorithm. Finally, by inspecting ten source codes and running respective tests, we found that five implementations were incorrect. Note that, not all bugs we identified are due to the mistake in Gotohs paper. Three implementations rely on additional constraints that limit generality. Thus, only two out of ten yield correct results. We show that the error introduced by Gotoh is straightforward to resolve and provide a correct open-source reference implementation. We do believe though, that raising the awareness about these errors is critical, since the impact of incorrect pairwise sequence alignments that typically represent one of the very first stages in any bioinformatics data analysis pipeline can have a detrimental impact on downstream analyses such as multiple sequence alignment, orthology assignment, phylogenetic analyses, divergence time estimates, etc.
Reproducibility ledger
Nobody has reported trying to reproduce this paper yet. Did you replicate an experiment or run the code? Your report saves the next lab a week.
Sign in to file a reproducibility report.
Related papers
- Block aligner: fast and flexible pairwise sequence alignment with SIMD-accelerated adaptive blocks
Daniel Liu, Martin Steinegger·bioRxiv·Nov 8, 2021
- Exact global alignment using A* with chaining seed heuristic and match pruning
Ragnar Groot Koerkamp, Pesho Ivanov·BioinformaticsPeer-reviewed·Jan 20, 2024
- Optimal gap-affine alignment in O(s) space
Santiago Marco‐Sola, Jordan M. Eizenga, … Miquel Moretó·BioinformaticsPeer-reviewed·Feb 1, 2023
- Accelign: a GPU-based Library for Accelerating Pairwise Sequence Alignment
Felix Kallenborn, Fawaz Dabbaghie, … Bertil Schmidt·BMC BioinformaticsPeer-reviewed·Jun 21, 2026
- An alignment method for nucleic acid sequences against annotated genomes
Koen Deforche·bioRxiv·Oct 11, 2017
- Faster sequence alignment through GPU-accelerated restriction of the seed-and-extend search space
Richard Wilton, Tamas Budavari, … Alex Szalay·bioRxiv·Aug 1, 2014