henhaobio
Sign in

Nature MethodsBioinformaticsPeer-reviewed journal article

Fast and robust metagenomic sequence comparison through sparse chaining with skani

Jim ShawiD, Yun William YuiD

PDFDOIPreprintCode

Abstract

Sequence comparison algorithms for metagenome-assembled genomes (MAGs) often have difficulties dealing with data that is high-volume or low-quality. We present skani (https://github.com/bluenote-1577/skani), a method for calculating average nucleotide identity (ANI) using sparse approximate alignments. skani is more accurate than FastANI for comparing incomplete, fragmented MAGs while also being > 20 times faster. For searching a database of > 65, 000 prokaryotic genomes, skani takes only seconds per query and 6 GB of memory. skani is a versatile tool that unlocks higher-resolution insights for larger, noisier metagenomic data sets.

In-depth summary

Claude Opus 5.5 · xhigh effort · 8 Nov 2026 · from the full text of version 2 (7 Feb 2023) · CC BY 4.0

skani estimates average nucleotide identity (ANI) from sparse FracMinHash k-mer chains, staying robust to incomplete, fragmented metagenome-assembled genomes while running over 20 times faster than FastANI.

Sketching tools such as Mash and sourmash underestimate ANI when metagenome-assembled genomes (MAGs) are incomplete or fragmented, while alignment-based ANI is too slow for hundreds of thousands of MAGs and FastANI's minimizer seeding must stay dense and degrades at low N50. skani pairs sparse, unbiased FracMinHash seeds with approximate chaining to restrict k-mer statistics to orthologous regions, giving alignment-like robustness near sketching speed.

Key results

  1. ShownOn near-identical real MAG pairs, skani's ANI estimates barely change with genome incompleteness and contamination, matching the alignment-based ANIm. FastANI and the sketch-only methods drift toward lower ANI as MAG quality drops.

    OLS of each method's ANI on CheckM incompleteness and contamination across 41,494 Pasolli et al. MAG pairs with ANIm ANI > 99%: R^2 0.001 for skani and 0.005 for ANIm vs > 0.2 for every other method; in E. coli simulations, two 50% complete genomes gave Mash ANI estimates averaging only 96%. · Abstract; Figure legends

  2. ShownHierarchical clusterings built from skani distances agree much more closely with ANIm-based clustering than those from FastANI, Mash or sourmash. skani also computes the distance matrix far faster than ANIm and FastANI.

    Mean cophenetic correlation deviation from ANIm's own baseline over 238 Pasolli et al. species-level bins: skani −0.039, sourmash max-containment −0.148, FastANI −0.228, Mash -0.424. For the distance matrix of the 195-genome Alistipes ihumii bin, skani's speedup was > 500 times over ANIm and > 50 times over FastANI. · Abstract; Figure legends

  3. ShownA max-containment prefilter on very sparse marker k-mers, checked pair by pair for few queries and through an inverted index when there are > 50 queries, makes database search nearly as fast as Mash with modest memory and much faster than FastANI.

    Querying an E. coli genome against GTDB took seconds with < 6GB RAM, comparable to Mash; querying was > 20 times faster than FastANI on the E. coli data set and indexing was > 2.5 times faster than Mash; all-to-all comparison of 4233 RefSeq complete representative genomes ran as quickly as Mash (50 threads). · Abstract; Abstract; Max-containment putative ANI screening with…; Figure legends

  4. ShownOn reference-quality genomes, skani's ANI is usually more accurate than Mash's and only slightly less accurate than FastANI's. skani beats both on a fragmented E. coli collection where they produce outliers.

    Against BLAST-based ANIu as the baseline, the mean absolute error (MAE) difference between skani and FastANI never exceeded 0.20 ANI across reference data sets; FastANI's Pearson R on the E. coli set rose from 0.974 to 0.994 only after genomes with N50 <10,000 were excluded. · Abstract; Figure legends

  5. Shownskani's robustness and aligned fraction (AF) accuracy carry over to ocean eukaryotic, ocean archaeal and soil prokaryotic MAGs, including very large eukaryotic assemblies.

    Across four MAG data sets, skani (default or c = 30) had the narrowest 1 to 99 percentile deviation from ANIm; the eukaryotic set had an N50 of 17.6 Mbp and 32 MAGs over 100 Mbp. skani's AF correlated better with ANIm than FastANI's on every set, and with c = 30 Pearson R exceeded 0.996 on three of the four. · Abstract; Figure legends

Methods, data and reproducibility

skani prefilters pairs using a max-containment ANI from sparse FracMinHash marker k-mers (keeping > 80%) and cuts the query into 20kb chunks. It chains sparse FracMinHash seeds to the reference with banded dynamic programming, greedily keeps minimally overlapping orthologous chains, and averages chunk-level k-mer ANI, optionally debiased by gradient-boosted trees.

  • Pasolli et al. short-read MAGs from species-level bins with > 25 and < 50 genomes, plus the separate bin 2328 (Alistipes ihumii, 195 genomes) used for clustering and timing · Alistipes ihumii for bin 2328; others not stated · n = 238 bins; 41,494 pairs with ANIm > 99%
  • Simulated MAGs from one E. coli genome with exponentially distributed contig lengths and random contig retention · E. coli · n = 20 per parameter setting
  • Ocean eukaryotic, ocean archaeal and soil prokaryotic MAG sets used for generalization tests (Supplementary Table 2) · marine eukaryotes and archaea; soil prokaryotes
  • Collection of E. coli genomes queried with an E. coli K12 genome · E. coli
  • GTDB reference database searched with an E. coli query genome · prokaryotes · n = > 65, 000 genomes
  • refseq-cr: RefSeq complete, representative bacterial genomes (obtained with ncbi-genome-download) for all-to-all comparison · bacteria · n = 4233 genomes
  • Nayfach et al. MAGs used to train the ANI debiasing regressor against ANIm; disjoint from evaluation sets · n = 52,515 MAGs; 1,004,213 pairs
  • Extra benchmark sets (Parks MAGs, B. anthracis and B. fragilis genomes) plus a held-out human gut MAG set for hyperparameter tuning · B. anthracis; B. fragilis; others not stated
Methods & tools
skani, FastANI, Mash, sourmash (default and --max-containment), ANIm (MUMmer-based ANI), ANIu (BLAST-based ANI), MUMmer, CheckM, FracMinHash sketching, gradient boosted regression trees, ncbi-genome-download
Assay conditions & compute
Google Cloud instance with an Intel Xeon CPU @ 3.10GHz, 64 cores, 240 GB RAM and a persistent SSD; runs used 50 threads unless noted (sourmash was single-threaded); the GTDB query used < 6GB RAM.
Reproducibility gaps
Data sets are identified only through Supplementary Table 2 and benchmark commands through Supplementary Table 1. The text gives no accessions or software versions. The MAGs used to train the debiasing model are cited only as Nayfach et al.
Limitations (6)
  • skani's on-disk indices are larger than those of pure sketching tools (Supplementary Table 3), though the authors argue disk space matters less than RAM. · stated by the authors
  • On reference-quality genomes, skani is usually slightly less accurate than FastANI (MAE gap up to 0.20 ANI); FastANI's Pearson R rises from 0.974 to 0.994 once genomes with N50 <10,000 are removed. · stated by the authors
  • skani is not built for distant genomes: accuracy is best above about 82% ANI and pairs with a putative ANI under 80% are filtered out, whereas FastANI reports values down to roughly 75%. · stated by the authors
  • The optional bootstrap 90% confidence interval reflects only randomness from k-mer subsampling, not systematic bias of skani's estimator relative to other methods, and it requires > 10 chunks. · stated by the authors
  • Sparse chaining can inflate ANI by missing mutated k-mers at chain edges, so a learned debiasing step is needed. AF is noisier for archaeal MAGs with short N50 (median 5863 bp) and small genomes (median 1.27 Mbp). · stated by the authors
  • MAG accuracy is judged against ANIm as ground truth, and the debiasing regressor is trained to reproduce ANIm. Agreement may therefore partly reflect calibration toward one alignment method rather than independent true ANI. · noted in this summary

Read this if you compute ANI or aligned fraction for large sets of incomplete or fragmented MAGs and want alignment-like robustness at near-sketching speed for database search or species-level clustering.

Citations
243
FWCI
21.73
Field percentile
top 1%

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.

Similarity Map
SelectedSame fieldCross-field
THISZhao '26Stewart '18Larralde '25Xu '24Heimburger '26Hera '23
63% semantic matchBioinformatics
Jianshu Zhao, Daniel McDonald, Lucas Patel+3 more·bioRxiv·Nov 9, 2026