tantan is a tool for masking simple regions (low complexity and short-period tandem repeats) in biological sequences.

The aim of tantan is to prevent false predictions when searching for homologous regions between two sequences. Simple repeats often align strongly to each other, causing false homology predictions.


You need to have a C++ compiler. On Linux, you might need to install a package called "g++". On Mac, you might need to install command-line developer tools. On Windows, you might need to install Cygwin.

Using the command line, go into the tantan directory. To compile it, type:


Optionally, copy tantan to a standard "bin" directory (using "sudo" to request administrator permissions):

sudo make install

Or copy it to your personal bin directory:

make install prefix=~

You might need to log out and back in for your computer to recognize the new program.

Normal usage

Advanced usage

The preceding examples cover all of tantan's options that you should ever need.


Why does tantan sometimes mask isolated bases?

This happens when a region is borderline repetitive, and a single base creeps just over the threshold. Don't worry about it, it's not a problem (at least for tantan's aim of preventing false homology).

Does tantan mask functional sequence?

Of course. Proteins and protein-coding exons can contain simple repeats. Repeats can be functional. If we want to avoid false homology we have to mask them. Remember that tantan merely lowercases repeats, so it's easy to lift the masking after determining homology.


-p interpret the sequences as proteins
-x letter to use for masking, instead of lowercase
-c preserve uppercase/lowercase in non-masked regions
-m file for letter-pair score matrix
-r probability of a repeat starting per position
-e probability of a repeat ending per position
-w maximum tandem repeat period to consider
-d probability decay per period (period-(i+1) / period-i)
-i match score
-j mismatch cost
-a gap existence cost
-b gap extension cost
-s minimum repeat probability for masking
-n minimum copy number, affects -f4 only
-f output type: 0=masked sequence, 1=repeat probabilities, 2=repeat counts, 3=BED, 4=tandem repeats
-h, --help show help message, then exit
--version show version information, then exit

Advanced issues

When tantan masks tandem repeats, it tends to leave the first (left-most) repeat unit unmasked. This sometimes allows us to find homologs we would otherwise miss:

||| ||| | |||||||||||||||||| ||| |||||||||||||| ||| ||

However, there is a danger of non-equivalent repeat units being unmasked. This happens especially if we mask DNA on one strand but align it on the other strand:

                   TGCAAGCTA TTAGGCTTAGGTCAGTGC ttaagcttaggtcagtgc AACATA

(My thanks to Junko Tsuji and Paul Horton for finding these issues.)

Finding straightforward tandem repeats

Option -f4 runs tantan in a different mode, where it finds straightforward tandem repeats only. (Technically, it uses a Viterbi algorithm instead of a Forward-Backward algorithm.) This is not recommended for avoiding false homologs! But it might be useful for studying tandem repeats. The output looks like this:

mySeq   14765   14780   6       2.5     GTCATG  GTCATG,GTCATG,GTC
mySeq   632362  632377  2       6       GC      GC,GC,GC,GCt,GCT,GCT
mySeq   1278353 1278369 3       6.5     TCA     TCA,TCA,TCA,TC-,TC,TC,T
mySeq   3616084 3616100 3       5.33333 TGG     TGA,TGA,TGG,TGG,TGG,T

The first 3 columns show the start and end coordinates of the repetitive region, in BED format. Column 4 shows the length of the repeating unit (which might vary due to insertions and deletions, so this column shows the most common length). Column 5 shows the number of repeat units. Column 6 shows the repeating unit (which again might vary, so this is just a representative). Column 7 shows the whole repeat: lowercase letters are insertions relative to the previous repeat unit, and dashes are deletions relative to the previous repeat unit.


tantan is distributed under the GNU General Public License, either version 3 of the License, or (at your option) any later version. For details, see COPYING.txt.

If you use tantan in your research, please cite: "A new repeat-masking method enables specific detection of homologous sequences", MC Frith, Nucleic Acids Research 2011 39(4):e23.

tantan's website is: http://www.cbrc.jp/tantan/

If you have any questions, comments, or problems concerning tantan, please email: tantan (ATmark) cbrc (dot) jp.