<p>I've tried to search a bit first, but have been unable to find a quick answer. In the documentation for biopython I come across this:</p>

<pre><code>#Distance is calculated based on the number of shared 6mers.
</code></pre>

<p>This is the default alignment algorithm for MAFFT. What is a 6mer?</p>

<p>Also when should I choose the alternatives over the 6mer pairwise alignment? Those alternatives are:</p>

<ul>
<li>Needleman-Wunsch (global pairwise)</li>
<li>Smith-Waterman (local pairwise)</li>
<li>Local pairwise with generalized affine gap cost (Altschul 1998)</li>
</ul>

A 6-mer is a sub-sequence of 6 letters (nucleotides or amino-acids).

For example, a length 10 DNA sequence has 5 possible 6-mers: the sequences using bases 1..6, 2..7, 3..8, 4..9, and 5..10. Think of a sliding window of length 6 moving across the sequence one letter at a time.

Aligning two sequences with the alternatives you list is the "optimal" way but it takes time proportional to the product (*) of the lengths of the two sequences. The distance can be measured from the alignment score.

To speed this up for the case where the sequences are reasonably similar, another way is to *count the number of shared k-mers*. MAFFT must use k=6. This can be done more quickly than full alignment.

The decision is a trade-off between computation and sensitivity. k=6 might be ok for protein but may fail for DNA if the sequences diverge to any great extent.