No retraction, correction or concern found when last checked on Oct 18, 2026.
Mashtree: a rapid comparison of whole genome sequence files
Lee Katz, Taylor Griswold, Shatavia Morrison and 5 more
Journal of Open Source Software · 2019 · CC BY
Abstract
In the past decade, the number of publicly available bacterial genomes has increased dramatically.These genomes have been generated for impactful initiatives, especially in the field of genomic epidemiology (Brown, Dessai, McGarry, & Gerner-Smidt, 2019;Timme et al., 2017).Genomes are sequenced, shared publicly, and subsequently analyzed for phylogenetic relatedness.If two genomes of epidemiological interest are found to be related, further investigation might be prompted.However, comparing the multitudes of genomes for phylogenetic relatedness is computationally expensive and, with large numbers, laborious.Consequently, there are many strategies to reduce the complexity of the data for downstream analysis, especially using nucleotide stretches of length k (kmers).
Full text
From PubMed Central, U.S. National Library of Medicine, as current on Oct 18, 2026. Paragraph numbers are ours, so an answer can point at one.
Summary
In the past decade, the number of publicly available bacterial genomes has increased dramatically. These genomes have been generated for impactful initiatives, especially in the field of genomic epidemiology. Genomes are sequenced, shared publicly, and subsequently analyzed for phylogenetic relatedness. If two genomes of epidemiological interest are found to be related, further investigation might be prompted. However, comparing the multitudes of genomes for phylogenetic relatedness is computationally expensive and, with large numbers, laborious. Consequently, there are many strategies to reduce the complexity of the data for downstream analysis, especially using nucleotide stretches of length k (kmers).
One major kmer strategy is to reduce each genome to split kmers. With split kmer analysis, kmers on both sides of a variable site are recorded, and the variable nucleotide is identified. When comparing two or more genomes, the variable sites are compared. Split kmers have been implemented in software packages such as KSNP and SKA.
Another major kmer strategy is to convert genomic data into manageable datasets, usually called sketches. Most notably, an algorithm called min-hash was implemented in the Mash package. In the min-hash algorithm, all kmers are recorded and transformed into integers using hashing and a Bloom filter. These hashed kmers are sorted and only the first several kmers are retained. The kmers that appear at the top of the sorted list are collectively called the sketch. Any two sketches can be compared by counting how many hashed kmers they have in common.
Because min-hash creates distances between any two genomes, min-hash values can be used to rapidly cluster genomes into trees using the neighbor-joining algorithm. We implemented this idea in software called Mashtree, which quickly and efficiently generates large trees that would be too computationally intensive using other methods.
Workflow
Mashtree builds on two major algorithms that are already implemented in other software packages. The first is the min-hash algorithm, which is implemented in the software Mash. Mashtree uses Mash to create sketches of the genomes with the function mash sketch. We elected to keep most default Mash parameters but increased the sketch size (number of hashed kmers) from 1,000 to 10,000 to increase discriminatory power. Then, Mash is used to calculate the distances between genomes with mash dist. Mashtree records these distances into a pairwise distance matrix. Next, Mashtree calls the neighbor-joining (NJ) algorithm which is implemented in the software QuickTree. The Mash distance matrix is used with QuickTree with default options to generate a dendrogram. The workflow is depicted in Figure 1.
Confidence values
Although Mashtree does not infer phylogeny, we have borrowed the ideas behind phylogenetic confidence values to yield confidence values for each parent node in the tree. There are two resampling methods implemented in Mashtree to assign support values to internal nodes: bootstrapping and jackknifing. Initially, both methods create a tree as depicted in Figure 1. Then, confidence values can be calculated for the tree using either the bootstrapping approach or the jackknifing approach (Figures 2 and 3).
Other features
Mashtree has several other useful features. First, Mashtree can read any common sequence file type and can read gzip-compressed files (e.g., fastq, fastq.gz, fasta). This is a major advantage in being compatible with a wide variety of databases and with space-saving file compression. Second, Mashtree takes advantage of multithreading. The number of requested threads is used to determine how many genomes are sketched at the same time and how many sketches can be compared at the same time. When the number of threads requested outnumbers the number of operations that it can parallelize, Mashtree uses the multithreading already encoded in Mash sketches and distances. Third, Mashtree uses an SQLite database which can be used to cache results between runs.
Installation
The Mashtree package is programmed in Perl, and is available in the CPAN repository. Documentation can be found at https://github.com/lskatz/mashtree.
References 10
- 1.
Baker DN, & Langmead B. (2019 ). Dashing: Fast and accurate genomic distances with hyperloglog. bioRxiv
Not in our library10.1101/501726
- 2.
Bloom BH (1970 ). Space/time trade-offs in hash coding with allowable errors. Communications of the ACM, 13(7), 422–426
Not in our library10.1145/362686.362692
- 3.
- 4.
Gardner SN, Slezak T, & Hall BG (2015 ). KSNP3. 0: SNP detection and phylogenetic analysis of genomes without genome alignment or reference genome. Bioinformatics, 31(17), 2877–2878
Not in our library10.1093/bioinformatics/btv271
- 5.
Harris SR (2018 ). SKA: Split kmer analysis toolkit for bacterial genomic epidemiology. BioRxiv, 453142
Not in our library10.1101/453142
- 6.
Howe K, Bateman A, & Durbin R. (2002 ). QuickTree: Building huge neighbour-joining trees of protein sequences. Bioinformatics, 18(11), 1546–1547
Not in our library10.1093/bioinformatics/18.11.1546
- 7.
- 8.
Saitou N, & Nei M. (1987 ). The neighbor-joining method: A new method for reconstructing phylogenetic trees. Molecular Biology and Evolution, 4(4), 406–425
Not in our library10.1093/oxfordjournals.molbev.a040454
- 9.
Timme RE, Rand H, Shumway M, Trees EK, Simmons M, Agarwala R, Davis S, (2017 ). Benchmark datasets for phylogenomic pipeline validation, applications for foodborne pathogen surveillance. PeerJ, 5, e3893
Not in our library10.7717/peerj.3893
- 10.
Zhao X. (2018 ). BinDash, software for fast genome distance estimation on a typical personal laptop. Bioinformatics, 35(4), 671–673
Not in our library10.1093/bioinformatics/bty651
Cited by papers we hold 5
- Delineating Mycobacterium abscessus population structure and transmission employing high-resolution core genome multilocus sequence typing · 2022Not checked
- Convergence of virulence and antimicrobial resistance in increasingly prevalent Escherichia coli ST131 papGII+ sublineages · 2022Not checked
- Emergence of IncHI2 Plasmids With Mobilized Colistin Resistance (mcr)-9 Gene in ESBL-Producing, Multidrug-Resistant Salmonella Typhimurium and Its Monophasic Variant ST34 From Food-Producing Animals in Italy · 2021Not checked
- Variability of plasmid fitness effects contributes to plasmid persistence in bacterial communities · 2021No notice
- Bactopia: a Flexible Pipeline for Complete Analysis of Bacterial Genomes · 2020No notice
Reads
Read by people on this page
None yet.
Checked or read by AI through naulon
None yet.
A person counts once a day per paper. We keep no cookie and no address: a reader is a hash that changes every day. Any month under five reads shows no number.
Are you an author?
Is this your paper?
Claim it to add your note and be paid when agents cite it. Free.