<h2>Maximal Unique Matches</h2>
<p>To answer the question about MUMs, there are two important definitions:</p>
<ul>
<li>A &quot;match&quot; is <em>maximal</em> if it cannot be extended in either direction and still be a match i.e, for two strings <span class="math-container">$s,r$</span>, a match
<span class="math-container">$s_i,...,s_{i+k}$</span>, <span class="math-container">$r_{j},...,r_{j+k}$</span> is maximal if <span class="math-container">$s_i,...,s_{i+k+1}$</span>, <span class="math-container">$r_{j},...,r_{j+k+1}$</span> is not a match and <span class="math-container">$s_{i-1},...,s_{i+k}$</span>, <span class="math-container">$r_{j-1},...,r_{j+k}$</span> is also not a match.</li>
<li>A &quot;match&quot; is <em>unique</em> if the matched substring is not present anywhere else in either genome. i.e, for two strings <span class="math-container">$s,r$</span>, a match
<span class="math-container">$s_i,...,s_{i+k}$</span>, <span class="math-container">$r_{j},...,r_{j+k}$</span> is unique if the substring <span class="math-container">$s_i,...,s_{i+k}$</span> is present only once in each genome.</li>
</ul>
<p>With those definitions in hand, we can easily define a Maximal Unique Match (MUM) as an exact match that is both maximal and unique. Note that MUMmer also provides support for Maximal Exact Matches (MEMs), which do not require uniqueness of matches.</p>
<h2>MUMmer output</h2>
<p>As far as the output goes:</p>
<blockquote>
<p><a href="http://mummer.sourceforge.net/manual/" rel="nofollow noreferrer">For each match, the three columns list the position in the reference sequence, the position in the query sequence, and the length of the match respectively. Reverse complemented query positions are reported relative to the reverse of the query sequence unless the <code>-c</code> option was used</a>.</p>
</blockquote>
<p>For example, the row:</p>
<pre><code>1      1120       299
</code></pre>
<p>denotes a MUM of length 299 starting at the first base in the first input file and the 1120th base in the second input file. For matches on the reverse complement strand, you'll notice a second part of the output that contains the matches on the reverse complemented strand.</p>
<p>Here is a sample output I have on my device:</p>
<pre><code>&gt;$ $  mummer -mum -b -c England1.fna Indiana-USA-1_Saudi_Arabia_2014.fna
&gt; gi|633896549|gb|KJ813439.1|
       1      1120       299
     301      1420       174
     476      1595        65
     542      1661        81
     624      1743        43
     668      1787       264
     933      2052      1042
    1976      3095      1299
    3276      4395       330
    3607      4726        69
    3677      4796       885
    4563      5682       812
    5376      6495       792
    6169      7288       831
    7001      8120       731
    7733      8852      1963
    9697     10816      1176
   10874     11993       617
   11492     12611        41
   11534     12653       164
   11708     12827      3007
   14716     15835      1040
   15757     16876       489
   16247     17366       412
   16660     17779       337
   16998     18117       463
   17462     18581       325
   17788     18907       686
   18475     19594       599
   19075     20194       342
   19418     20537       179
   19598     20717       532
   20131     21250       152
   20284     21403       935
   21220     22339       348
   21569     22688       764
   22334     23453       351
   22686     23805        73
   22760     23879        29
   22790     23909       180
   22971     24090       532
   23504     24623       143
   23648     24767       107
   23756     24875       434
   24191     25310        59
   24251     25370        47
   24299     25418       214
   24515     25634       224
   24740     25859      1386
   26127     27246        39
   26167     27286        63
   26231     27350       114
   26346     27465       102
   26449     27568      1399
   27849     28968       207
   28057     29176       938
   28996     30115       726
   29743     30868       369
&gt; gi|633896549|gb|KJ813439.1| Reverse
</code></pre>
<p>Now, if you compute the reverse complement of the input and rerun, you'll notice the matches appear in reverse in the second section denoted by <code>&gt; gi|633896549|gb|KJ813439.1| Reverse</code></p>

CC BY-SA 4.0
2021-06-30T10:33:53.230Z
Thank you very much @Throckmorton . But I have still a doubt. How can mummerplot do the dotplot of the MUMs if in the .mums file contains only the "x starting value" and the "y ending value", let's say, (and the length) of the MUM ? Moreover, I do not understand why, using the options -b and -c (so running the first command line written in my question post), in my file there is also the list of the matches on the reverse complemented strand...
HelpNeederStudent
CC BY-SA 4.0
2021-06-30T14:57:18.120Z
For each row $x,y,z$ in the mummer output, there will be a line between points $(x, y)$ and $(x+z, y+z)$ in the plot representing the MUM.
Throckmorton
CC BY-SA 4.0
2021-06-30T14:58:40.403Z
@Manuela There are matches on the reverse complement strand because you used the `-b` flag. If you run `mummer -h` you will see what the different flags do. For example, `-b             compute forward and reverse complement matches
`
Throckmorton
CC BY-SA 4.0
2021-06-30T17:05:41.923Z
ok @Throckmorton for the first comment (I actually read your answer wrong, sorry). For the second I still can not understand because also you runned the same command with -b and -c and you do not have the list under "reverse"... isn'it it? And also in the manual (as I mentioned) there is: *This command will find all maximal unique matches (-mum) between the reference and query on both the forward and reverse strands (-b) **and report all the match positions relative to the forward strand (-c)**.*
HelpNeederStudent
CC BY-SA 4.0
2021-07-01T00:34:10.093Z
The reason I have no matches for the reverse complement is because the two sequences I ran MUMmer on are for the same strand and don't contain any inversions. If I invert the second half of the query sequence, those matches will then appear under the "Reverse" strand.
Throckmorton
CC BY-SA 4.0
2021-07-01T00:37:41.547Z
As far as the `-c` flag goes, consider the string `ATTTATTTGC` and the reverse complement `GCAAATAAAT`. If I have a match on the reverse complement strand at position 2, that's actually position 9 on the forward strand. With the `-c` flag, mummer will report the match at position 9 as opposed to reporting it at position 2 without the flag.
Throckmorton
CC BY-SA 4.0
2021-07-01T07:22:33.143Z
ok thank you very much !!!! @Throckmorton
HelpNeederStudent
CC BY-SA 4.0
2021-06-29T17:04:07.147Z
2021-06-29T17:11:17.577Z
2021-06-29T17:11:17.577Z
Throckmorton
<p>found this in the manual, so I guess the first two columns are the reference and query positions and the third is the length. I am not 100% sure either, so let me know if you find out more.</p>
<p><a href="http://mummer.sourceforge.net/manual/#mummerplot" rel="nofollow noreferrer">http://mummer.sourceforge.net/manual/#mummerplot</a></p>
<blockquote>
<p>Just a simple three column list, noting the position and length of every maximal exact match. Note that for reverse complement matches (produced with the -r option), the query start positions will reference the reverse complement of the query input sequence.</p>
</blockquote>

CC BY-SA 4.0
2021-06-29T08:13:17.537Z
Thank you @HermannGregorDallinger ! Yes then I found an explanation like the yours always in the manual but in a different part of it that is:
HelpNeederStudent
CC BY-SA 4.0
2021-06-29T08:20:50.253Z
*For each match, the three columns list the position in the reference sequence, the position in the query sequence, and the length of the match respectively. Reverse complemented query positions are reported relative to the reverse of the query sequence unless the -c option was used. As was stated above the -L option adds the sequence lengths to the header line and the -s option adds the match strings to the output, if these options were used the format would be as follows:* etc...
HelpNeederStudent
CC BY-SA 4.0
2021-06-29T08:21:00.063Z
But I still wonder if these query and reference positions are the "starting" positions from the left or from the right... they should represent like a point (x,y) in a Cartesian plane but I do not understand very well which point.
HelpNeederStudent
CC BY-SA 4.0
2021-06-29T11:55:58.650Z
Looks like this is undocumented, but a sensible default would be to get the end position by adding start and length, so they would be as you said from the "left" and the "right" position would be start + length. For most applications and for producing a "rough" dotplot, I guess it will not matter. You could try using blast to get more exact and detailed output if it is necessary.
Hermann Gregor Dallinger
CC BY-SA 4.0
2021-06-29T07:56:14.893Z
2021-06-29T07:56:14.893Z
Hermann Gregor Dallinger
<p>I am doing genome sequence alignment using MUMmer, in particular I want to do a dotplot with mummerplot. So the passages that I did are:</p>
<p>1.create a file .mums with the following command line:</p>
<pre><code>mummer -mum -b -c H_pylori26695_Eslice.fasta H_pyloriJ99_Eslice.fasta &gt; mummer.mums
</code></pre>
<p>2.and then plot all the MUMs with MUMmerplot:</p>
<pre><code>mummerplot -x &quot;[0,275287]&quot; -y &quot;[0,265111]&quot; -postscript -p mummer mummer.mums
</code></pre>
<p>The example is taken <a href="https://mummer4.github.io/tutorial/tutorial.html" rel="nofollow noreferrer">here</a>. The plot works, but I would like to understand several things to have more consciousness of what I am doing: the file .mums has three columns with many rows. What do they represent ? I know that it is a little explained in the link given before:</p>
<blockquote>
<p>This command will find all maximal unique matches (-mum) between the reference and query on both the forward and reverse strands (-b) and report all the match positions relative to the forward strand (-c). Output is to stdout, so we will redirect it into a file named mummer.mums. This file lists all of the MUMs of the default length or greater between the two input sequences.</p>
</blockquote>
<p>So the file should report all the Maximal Unique Matches between the two sequences but I do not understand what are these three columns...</p>
<p>Moreover, can someone explain in simple words the reason of the term &quot;unique&quot; in &quot;Maximal Unique Matches&quot; ?</p>
<p>Thank you in advance .</p>

<phylogenetics><genome><file-formats><software-usage>
What is the file .mums created by mummer?
# What is the file .mums created by mummer?

(Asked by: username_0 on 2021-06-03)

I am doing genome sequence alignment using MUMmer, in particular I want to do a dotplot with mummerplot. So the passages that I did are:
1.create a file .mums with the following command line:
mummer -mum -b -c H_pylori26695_Eslice.fasta H_pyloriJ99_Eslice.fasta > mummer.mums

2.and then plot all the MUMs with MUMmerplot:
mummerplot -x "[0,275287]" -y "[0,265111]" -postscript -p mummer mummer.mums

The example is taken here. The plot works, but I would like to understand several things to have more consciousness of what I am doing: the file .mums has three columns with many rows. What do they represent ? I know that it is a little explained in the link given before:

This command will find all maximal unique matches (-mum) between the reference and query on both the forward and reverse strands (-b) and report all the match positions relative to the forward strand (-c). Output is to stdout, so we will redirect it into a file named mummer.mums. This file lists all of the MUMs of the default length or greater between the two input sequences.

So the file should report all the Maximal Unique Matches between the two sequences but I do not understand what are these three columns...
Moreover, can someone explain in simple words the reason of the term "unique" in "Maximal Unique Matches" ?
Thank you in advance .

**Tags:** phylogenetics, genome, file-formats, software-usage

---

## 2 answers

### Answer by username_1 on 2021-06-29. Score: 2 | Accepted answer

Maximal Unique Matches
To answer the question about MUMs, there are two important definitions:

A "match" is maximal if it cannot be extended in either direction and still be a match i.e, for two strings $s,r$, a match
$s_i,...,s_{i+k}$, $r_{j},...,r_{j+k}$ is maximal if $s_i,...,s_{i+k+1}$, $r_{j},...,r_{j+k+1}$ is not a match and $s_{i-1},...,s_{i+k}$, $r_{j-1},...,r_{j+k}$ is also not a match.
A "match" is unique if the matched substring is not present anywhere else in either genome. i.e, for two strings $s,r$, a match
$s_i,...,s_{i+k}$, $r_{j},...,r_{j+k}$ is unique if the substring $s_i,...,s_{i+k}$ is present only once in each genome.

With those definitions in hand, we can easily define a Maximal Unique Match (MUM) as an exact match that is both maximal and unique. Note that MUMmer also provides support for Maximal Exact Matches (MEMs), which do not require uniqueness of matches.
MUMmer output
As far as the output goes:

For each match, the three columns list the position in the reference sequence, the position in the query sequence, and the length of the match respectively. Reverse complemented query positions are reported relative to the reverse of the query sequence unless the -c option was used.

For example, the row:
1      1120       299

denotes a MUM of length 299 starting at the first base in the first input file and the 1120th base in the second input file. For matches on the reverse complement strand, you'll notice a second part of the output that contains the matches on the reverse complemented strand.
Here is a sample output I have on my device:
>$ $  mummer -mum -b -c England1.fna Indiana-USA-1_Saudi_Arabia_2014.fna
> gi|633896549|gb|KJ813439.1|
       1      1120       299
     301      1420       174
     476      1595        65
     542      1661        81
     624      1743        43
     668      1787       264
     933      2052      1042
    1976      3095      1299
    3276      4395       330
    3607      4726        69
    3677      4796       885
    4563      5682       812
    5376      6495       792
    6169      7288       831
    7001      8120       731
    7733      8852      1963
    9697     10816      1176
   10874     11993       617
   11492     12611        41
   11534     12653       164
   11708     12827      3007
   14716     15835      1040
   15757     16876       489
   16247     17366       412
   16660     17779       337
   16998     18117       463
   17462     18581       325
   17788     18907       686
   18475     19594       599
   19075     20194       342
   19418     20537       179
   19598     20717       532
   20131     21250       152
   20284     21403       935
   21220     22339       348
   21569     22688       764
   22334     23453       351
   22686     23805        73
   22760     23879        29
   22790     23909       180
   22971     24090       532
   23504     24623       143
   23648     24767       107
   23756     24875       434
   24191     25310        59
   24251     25370        47
   24299     25418       214
   24515     25634       224
   24740     25859      1386
   26127     27246        39
   26167     27286        63
   26231     27350       114
   26346     27465       102
   26449     27568      1399
   27849     28968       207
   28057     29176       938
   28996     30115       726
   29743     30868       369
> gi|633896549|gb|KJ813439.1| Reverse

Now, if you compute the reverse complement of the input and rerun, you'll notice the matches appear in reverse in the second section denoted by > gi|633896549|gb|KJ813439.1| Reverse

> **Comments:**
> **username_0**: Thank you very much @Throckmorton . But I have still a doubt. How can mummerplot do the dotplot of the MUMs if in the .mums file contains only the "x starting value" and the "y ending value", let's say, (and the length) of the MUM ? Moreover, I do not understand why, using the options -b and -c (so running the first command line written in my question post), in my file there is also the list of the matches on the reverse complemented strand...  
> **username_1**: For each row $x,y,z$ in the mummer output, there will be a line between points $(x, y)$ and $(x+z, y+z)$ in the plot representing the MUM.  
> **username_1**: @Manuela There are matches on the reverse complement strand because you used the `-b` flag. If you run `mummer -h` you will see what the different flags do. For example, `-b             compute forward and reverse complement matches `  
> **username_0**: ok @Throckmorton for the first comment (I actually read your answer wrong, sorry). For the second I still can not understand because also you runned the same command with -b and -c and you do not have the list under "reverse"... isn'it it? And also in the manual (as I mentioned) there is: *This command will find all maximal unique matches (-mum) between the reference and query on both the forward and reverse strands (-b) **and report all the match positions relative to the forward strand (-c)**.*  
> **username_1**: The reason I have no matches for the reverse complement is because the two sequences I ran MUMmer on are for the same strand and don't contain any inversions. If I invert the second half of the query sequence, those matches will then appear under the "Reverse" strand.  
> **username_1**: As far as the `-c` flag goes, consider the string `ATTTATTTGC` and the reverse complement `GCAAATAAAT`. If I have a match on the reverse complement strand at position 2, that's actually position 9 on the forward strand. With the `-c` flag, mummer will report the match at position 9 as opposed to reporting it at position 2 without the flag.  
> **username_0**: ok thank you very much !!!! @Throckmorton  

---

### Answer by username_2 on 2021-06-29. Score: 0

found this in the manual, so I guess the first two columns are the reference and query positions and the third is the length. I am not 100% sure either, so let me know if you find out more.

<http://mummer.sourceforge.net/manual/#mummerplot>

> Just a simple three column list, noting the position and length of every maximal exact match. Note that for reverse complement matches (produced with the -r option), the query start positions will reference the reverse complement of the query input sequence.

> **Comments:**
> **username_0**: Thank you @HermannGregorDallinger ! Yes then I found an explanation like the yours always in the manual but in a different part of it that is:  
> **username_0**: *For each match, the three columns list the position in the reference sequence, the position in the query sequence, and the length of the match respectively. Reverse complemented query positions are reported relative to the reverse of the query sequence unless the -c option was used. As was stated above the -L option adds the sequence lengths to the header line and the -s option adds the match strings to the output, if these options were used the format would be as follows:* etc...  
> **username_0**: But I still wonder if these query and reference positions are the "starting" positions from the left or from the right... they should represent like a point (x,y) in a Cartesian plane but I do not understand very well which point.  
> **username_2**: Looks like this is undocumented, but a sensible default would be to get the end position by adding start and length, so they would be as you said from the "left" and the "right" position would be start + length. For most applications and for producing a "rough" dotplot, I guess it will not matter. You could try using blast to get more exact and detailed output if it is necessary.  

---

