arXiv:2610.10500cs.DSOct 2026

Manuscript Offprint

arXiv:2610.10500

Taxonomic Classification with Complete Tag Arrays

Travis Gagie, Gonzalo Navarro

Abstract

Taxonomic classifiers such as Kraken assign each k-mer of a reference database to the lowest common ancestor (LCA) of the genomes containing it, but this works less well as databases grow, because more and more k-mers are shared across species. Cliffy (Ahmed, Boucher and Langmead, 2025) instead uses variable-length exact matches found with an r-index, and can list approximately the genera containing each match; on 16S rRNA it is more accurate than Kraken 2, but its index is large and expensive to build. We present KATKA, which finds the maximal exact matches (MEMs) of at least a given length in each read with Boyer–Moore–Li on a run-length compressed suffix array, counts the occurrences of each MEM in each genus exactly with a complete, run-length compressed tag array, and gives each genus credit in proportion to those counts. On the SILVA 16S rRNA database, KATKA's default index takes 1.44 GB and can be built in minutes on a desktop computer; it classifies a read in 66 μs with one thread and reaches 93.8% genus-level accuracy, close to what Cliffy reports for its 9 GB index. Grammar-compressing the runs of the tag array shrinks the index to 1.04 GB, at 75 μs per read. On the same machine and reads, it is more accurate than Kraken 2 (79.3%) and Tagger (81.7 to 92.8%, depending on how mates that disagree are scored). Indexing minimizer digests instead of the sequences makes the index three times smaller and classification 1.7 times faster, at a cost of 1.3 points of accuracy. KATKA is available at https://github.com/TravisGagie/KATKA.

2012 ACM Subject Classification Theory of computation → Data structures design and analysis; Applied computing → Bioinformatics

Keywords and phrases Taxonomic classification, maximal exact matches, Boyer–Moore–Li, run-length compressed suffix arrays, tag arrays, document listing, minimizer digests, 16S rRNA

Acknowledgements We thank Ben Langmead for encouraging us to classify with MEMs, and Omar Ahmed, Christina Boucher and Ben Langmead for making Cliffy and their experimental scripts publicly available. We thank Victor Alfaro, whose work with the second author on grammar-compressing the differential suffix array prompted us to grammar-compress the runs of the tag array. The ideas in this paper are the authors'; the code, the experiments and the text were developed by Claude Opus 5.5, an AI model by Anthropic, under their direction.

Taxonomic Classification with Complete Tag Arrays

1 Introduction

A sequencing experiment on a microbial sample produces millions of reads: short strings, typically of a few hundred bases, copied from random places in the DNA of whatever organisms the sample contains, and from either strand of that DNA, so a read may match the database only as a reverse complement: reversed, with A and T, and C and G, swapped. Taxonomic classification assigns each read to a node of a taxonomy, such as a species or genus, by comparing it with a reference database of sequences whose taxa are known. Kraken [57] made this fast by precomputing, for every k-mer in the database, the lowest common ancestor (LCA) in the taxonomy of the genomes containing it. To classify a read, Kraken looks up its k-mers and gives each a vote for its stored LCA; the read is assigned to the leaf of the taxonomy whose root-to-leaf path collects the most votes. Kraken 2 [56] stores minimizers instead of all k-mers, in a compact probabilistic hash table, which makes the database about 85% smaller: for a reference of 9.1 Gbp it uses 10.6 GB of memory when classifying, against Kraken's 72.4 GB. Even so, the databases keep growing: the prebuilt Kraken 2 Standard database (RefSeq archaea, bacteria, viruses, plasmids, human and vectors) now takes 103 GB, and the one built from GTDB release 226 takes 644 GB. 1^{1}

Growth also hurts accuracy, because k-mer methods depend on k-mers that are specific to a single taxon, and such k-mers become rarer as databases grow. Nasko et al. [48] showed that as NCBI RefSeq grew, the number of species grew much faster than the number of genera; as a result, more reads were classified with newer versions of the database, but fewer of them at the species level, because more k-mers were shared by several species and their LCAs moved up the taxonomy. Commichaux et al. [19] showed a similar trend for the 16S rRNA gene and other prokaryotic marker genes: species-level resolution is lost as the number of sequences in reference databases grows, and the loss is strongest for the best represented taxa. In work in preparation, Cheng et al. [14] report that using maximal exact matches (MEMs) instead of k-mers gives better classifications than any single choice of k: a MEM is as long as the match allows, so a read from a well represented taxon can still have long matches that are specific to it.

Whatever the matches are, a classifier has to decide what each match votes for. Following Kraken, a match can vote for the LCA of all the taxa containing it. Alternatively, it can vote directly for each of the taxa containing it, splitting its weight among them, either evenly or in proportion to the number of occurrences of the match in each. We call these the LCA and listing approaches; Figure 1 illustrates the difference. Listing avoids giving weight to taxa that do not contain the match, which matters when a match occurs in a few distant taxa.

Cliffy [1], which we describe in Section 2, supports both approaches for variable-length exact matches, and on 16S rRNA it is considerably more accurate than Kraken 2: its authors report genus-level accuracy 11 to 18 percentage points higher, although Kraken 2's index for SILVA takes only 144 MB. Its index, however, is large and expensive to build. In this paper we present KATKA, a classifier built from standard compressed data structures that is about as accurate as Cliffy reports, with an index that is several times smaller and can be built in minutes on a desktop computer; on the same machine and reads, it is also more accurate than Kraken 2 and Tagger. KATKA's design has four parts (Section 3):

It indexes the reference sequences, grouped by genus and with their reverse complements, with a run-length compressed suffix array (RLCSA) [45, 11], together with a table of the search states of all 10-mers.

1^{1} https://benlangmead.github.io/aws-indexes/k2, accessed October 2026.

Figure

LCA (Cliffy): ∣M∣/4|M|/4 to each of g2,…,g5g_{2}, \ldots, g_{5}

Figure 1 A match M that occurs in genera g2g_{2} and g5g_{5} (boxed). The LCA of g2g_{2} and g5g_{5} is the root, so with Kraken's rule the match votes only for the root. With the leaves in left-to-right order, Cliffy's LCA query spreads the weight ∣M∣|M| evenly over the genera from the leftmost to the rightmost one containing the match, including g3g_{3} and g4g_{4}, which do not contain it; listing splits the weight between g2g_{2} and g5g_{5} only, evenly as shown or in proportion to the number of occurrences in each.

It finds only the MEMs of each read that are at least L = 30 bases long, with Boyer–Moore–Li (BML) [28, 43], which skips over parts of the read as Boyer–Moore pattern matching does. Short MEMs occur in many genera, so they say little about where a read came from, and they are the expensive ones to answer for.

It counts the occurrences of each MEM in each genus with a run-length compressed tag array that stores the genus of each suffix of the reference in suffix-array order [5, 25, 26, 50]. Neighbouring suffixes tend to come from the same genus, so the tag array compresses well, and counting needs only the runs that overlap the MEM's interval, rather than locating every occurrence as an r-index would, which on SILVA makes classification about twice as fast; when counts are not needed, Muthukrishnan's document listing algorithm [47] lists the genera in an interval in time proportional to their number.

It gives each genus credit in proportion to the number of occurrences of the MEM in it, which turns out to be about 3.5 points more accurate than splitting the credit evenly. On the SILVA 16S rRNA database, this index takes 1.44 GB, against 9.01 GB for Cliffy's undigested index, classifies a read in 66 μ\mus with one thread, and reaches 93.8% genus-level accuracy (Section 4). As an option, KATKA can index minimizer digests [54, 3], as Cliffy can, which makes the index three times smaller and classification 1.7 times faster at a cost of 1.3 points of accuracy (Section 5).

We call our tool KATKA, reusing the name of two earlier projects of ours that share its goals but little of its design. The first KATKA [33] was a Kraken-like index with k given at query time: it found the leftmost and rightmost genomes containing each k-mer with range-minimum queries on grids built from LZ77 parses. The second [24] classified reads by the LCAs of their MEMs, concentrating on each read's longest MEMs, and studied how well this works over minimizer digests and over lossy “KATKA kernels”. The present KATKA differs from both in how it finds matches, in how it answers for them, and in its evaluation, which follows Cliffy's.

The closest work to ours is Tagger [22], which finds the super-maximal exact matches of length at least L of a read with move structures [49] and also uses a tag array of genera, sampled at the ends of BWT runs. Tagger assigns each match a single genus, that of the match's last occurrence in the BWT, which it maintains during the search much as the r-index maintains its toehold (the position of one occurrence of the current match); it is small, and its own evaluation, by a group of authors that includes one of us, found Cliffy's listing of several genera per match more accurate on the same SILVA genera, with different reads.

Taxonomic Classification with Complete Tag Arrays

Tagger reads only one tag of each match's BWT interval, the last one; we use all the tags in the interval, to count the occurrences of a match in each genus. Other classifiers built on r-indexes, such as SPUMONI 2 [3] and col-BWT [12], address a different problem: deciding whether a read comes from a target pangenome, such as a set of human haplotypes, or which of a few such pangenomes it comes from. Col-BWT adds chain statistics, which say whether a read's maximal matches are co-linear in the references, and with them comes within 0.6 percentage points of the sensitivity of alignment with minimap2 on long reads. Co-linearity matters less for our short 16S reads, which usually have only a few long MEMs, but it might help KATKA on longer reads or whole genomes. Alignment-free machine-learning methods based on k-mer frequencies or chaos-game representations classify or cluster whole genomes and metagenome-assembled genomes [53, 46, 44, 4]; we target short reads, for which we expect long exact matches to be more informative than k-mer profiles.

Section 2 gives some background on 16S rRNA classification and on Cliffy, Section 3 describes KATKA and Section 4 evaluates it and compares it with Kraken 2 and Tagger. Section 5 describes digestion, and Section 6 concludes. Appendix A gives the details needed to reproduce our experiments, and Appendix B describes the alternatives we considered and why we did not choose them.

References (100)

Couldn't load all references. Reload the page to try again.