Skip to content
A fast approximate aligner for long DNA sequences
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
scripts Use specified font parameters in png output Mar 22, 2019
src Using google sparsehash Jan 30, 2018
.gitignore Adding alignment support, minor changes Sep 8, 2017
INSTALL.txt Adding README and INSTALL file Jan 25, 2017
LICENSE.txt Using google sparsehash Jan 30, 2018 Included header file Nov 26, 2017 Update Sep 20, 2018 Source files moved Jan 25, 2017 Source files moved Jan 25, 2017


MashMap implements a fast and approximate algorithm for computing local alignment boundaries between long DNA sequences. It can be useful for mapping genome assembly or long reads (PacBio/ONT) to reference genome(s). Given a minimum alignment length and an identity threshold for the desired local alignments, Mashmap computes alignment boundaries and identity estimates using k-mers. It does not compute the alignments explicitly, but rather estimates a k-mer based Jaccard similarity using a combination of Minimizers and MinHash. This is then converted to an estimate of sequence identity using the Mash distance. An appropriate k-mer sampling rate is automatically determined using the given minimum local alignment length and identity thresholds. The efficiency of the algorithm improves as both of these thresholds are increased.

As an example, Mashmap can map a human genome assembly to the human reference genome in about one minute total execution time and < 4 GB memory using just 8 CPU threads, achieving more than an order of magnitude improvement in both runtime and memory over alternative methods. We describe the algorithms associated with Mashmap, and report on speed, scalability, and accuracy of the software in the publications listed below. Unlike traditional mappers, MashMap does not compute exact sequence alignments. In future, we plan to add an optional alignment support to generate base-to-base alignments.


Follow INSTALL.txt to compile and install MashMap. We also provide dependency-free linux and OSX binaries for user convenience through the latest release.


  • Map set of query sequences against a reference genome:

    mashmap -r reference.fna -q query.fa

    The output is space-delimited with each line consisting of query name, length, 0-based start, end, strand, target name, length, start, end and mapping nucleotide identity.

  • Map set of query seqences against a list of reference genomes:

    mashmap --rl referenceList.txt -q query.fa

    File 'referenceList.txt' containing the list of reference genomes should contain path to the reference genomes, one per line.


For most of the use cases, default values should be appropriate. However, different parameters and their purpose can be checked using the help page mashmap -h. Important ones are mentioned below:

  • Identity threshold (--perc_identity, --pi) : By default, it is set to 85, implying mappings with 85% or more identity should be reported. For example, it can be set to 80% to account for more noisy long-read datasets or 95% for mapping human genome assembly to human reference.

  • Minimum segment length (-s, --segLength) : Default is 5,000 bp. Sequences below this length are ignored. Mashmap provides guarantees on reporting local alignments of length twice this value.

  • Filtering options (-f, --filter_mode) : Mashmap implements a plane-sweep based algorithm to perform the alignment filtering. Similar to delta-filter in nucmer, different filtering options are provided that are suitable for long read or assembly mapping. Option -f map is suitable for reporting the best mappings for long reads, whereas -f one-to-one is suitable for reporting orthologous mappings among all computed assembly to genome mappings.


We provide a perl script for generating dot-plots to visualize mappings. It takes Mashmap's mapping output as its input. This script requires availability of gnuplot. Below is an example demonstrating mapping of canu NA12878 human genome assembly (y-axis) to hg38 reference (x-axis).


Use the latest release for a stable version.


You can’t perform that action at this time.