MUSCLE User Guide








Multiple sequence comparison by log-expectation

by Robert C. Edgar


Version 3.8

May 2010





Edgar, Robert C. (2004), MUSCLE: multiple sequence alignment with high accuracy and high throughput, Nucleic Acids Research 32(5), 1792-97.


For a complete description of the algorithm, see also:


Edgar, Robert C (2004), MUSCLE: a multiple sequence alignment method with reduced time and space complexity. BMC Bioinformatics, 5(1):113.
Table of Contents

1 Introduction. 3

2 Quick Start 3

2.1 Installation. 3

2.2 Making an alignment 3

2.3 Large alignments. 3

2.4 Faster speed. 4

2.5 Huge alignments. 4

2.6 Pipelining. 4

2.7 Refining an existing alignment 4

2.8 Using a pre-computed guide tree. 4

2.9 Profile-profile alignment 5

2.10 Adding sequences to an existing alignment 5

2.11 Specifying a protein substitution matrix. 5

2.12 Specifying a nucleotide substitution matrix. 5

2.13 Refining a long alignment 6

3 File Formats. 6

3.1 Input files. 6

3.1.1 Amino acid sequences. 6

3.1.2 Nucleotide sequences. 6

3.1.3 Determining sequence type. 6

3.2 Output files. 7

3.2.1 Sequence grouping. 7

3.2.2 Output to multiple file formats. 7

3.3 CLUSTALW format 7

3.4 MSF format 7

3.5 HTML format 8

3.6 Phylip format 8

4 Using MUSCLE.. 8

4.1 How the algorithm works. 8

4.2 Command-line options. 9

4.3 The maxiters option. 9

4.4 The maxtrees option. 10

4.5 The maxhours option. 10

4.6 The profile scoring function. 10

4.7 Diagonal optimization. 10

4.8 Anchor optimization. 10

4.9 Log file. 11

4.10 Progress messages. 11

4.11 Running out of memory. 11

4.12 Troubleshooting. 12

4.13 Technical support 12

5 Command Line Reference. 12


1 Introduction

MUSCLE is a program for creating multiple alignments of amino acid or nucleotide sequences. A range of options is provided that give you the choice of optimizing accuracy, speed, or some compromise between the two. Default parameters are those that gave the best average benchmark accuracy in my tests. However, benchmark accuracy is a rather dubious measure; see:


Edgar, R.C. (2010) Quality measures for protein alignment benchmarks, Nucleic Acids Res., 2010, 1–9.



THE -stable OPTION HAD A SERIOUS BUG IN VERSIONS OF MUSCLE PRIOR TO v3.8 AND IS CURRENTLY NOT SUPPORTED. Go to this link for latest news and work-arounds:


2 Quick Start

The MUSCLE algorithm is delivered as a command-line program called muscle. If you are running under Linux or Unix you will be working at a shell prompt. If you are running under Windows, you should be in a command window (nostalgically known to us older people as a DOS prompt). If you don't know how to use command-line programs, you should get help from a local guru.

2.1 Installation

Copy the muscle binary file to a directory that is accessible from your computer. That's it—there are no configuration files, libraries, environment variables or other settings to worry about. If you are using Windows, then the binary file is named something like muscle3.8.31_i86win32.exe. From now on muscle should be understood to mean "the file or path name of your executable file".

2.2 Making an alignment

Make a FASTA file containing some sequences. (If you are not familiar with FASTA format, it is described in detail later in this Guide.) For now, just to make things fast, limit the number of sequence in the file to no more than 50 and the sequence length to be no more than 500. Call the input file seqs.fa. Make sure the directory containing the muscle binary is in your path. (If it isn't, you can run it by typing the full path name, and the following example command lines must be changed accordingly). Now type:


muscle -in seqs.fa -out seqs.afa


You should see some progress messages. If muscle completes successfully, it will create a file seqs.afa containing the alignment. By default, output is created in "aligned FASTA" format (hence the .afa extension). This is just like regular FASTA except that gaps are added in order to align the sequences. This is a nice format for computers but not very readable for people, so to look at the alignment you will want an alignment viewer such as Belvu, or a script that converts FASTA to a more readable format. You can also use the –clw command-line option to request output in CLUSTALW format, which is easier to understand for people. If muscle gives an error message and you don't know how to fix it, please read the Troubleshooting section.


The default settings are designed to give the best accuracy, so this may be all you need to know.

2.3 Large alignments

If you have a large number of sequences (a few thousand), or they are very long, then the default settings of may be too slow for practical use. A good compromise between speed and accuracy is to run just the first two iterations of the algorithm. This is done by the option –maxiters 2, as in the following example.


muscle -in seqs.fa -out seqs.afa -maxiters 2

2.4 Faster speed

The –diags option enables an optimization for speed by finding common words (6-mers in a compressed amino acid alphabet) between the two sequences as seeds for diagonals. This is related to optimizations in programs such as BLAST and FASTA: you get faster speed, but sometimes lower average accuracy. For large numbers of closely related sequences, this option works very well.


If you want the fastest possible speed, then the following example shows the applicable options for proteins.


muscle -in seqs.fa -out seqs.afa -maxiters 1 -diags -sv -distance1 kbit20_3


For nucleotides, use:


muscle -in seqs.fa -out seqs.afa -maxiters 1 -diags


The alignments are not bad, especially when the sequences are closely related. However, as you might expect, this blazing speed comes at the cost of the lowest average accuracy of the options that muscle provides.

2.5 Huge alignments

If you have thousands of sequences, then attempting to create a multiple alignment is dubious for many technical reasons. It may be better to cluster first, then align the reduced set of sequences. Clustering can be done using UCLUST, which is an algorithm implemented in the USEARCH program:



At the time of writing (May 2010), I'm working on methods for leveraging a combination of UCLUST and MUSCLE to create very large but still reasonably accurate alignments. If you're interested, email me and let's discuss.

2.6 Pipelining

Input can be taken from standard input, and output can be written to standard output. This is the default, so our first example would also work like this:


muscle < seqs.fa > seqs.afa

2.7 Refining an existing alignment

You can ask muscle to try to improve an existing alignment by using the –refine option. The input file must then be a FASTA file containing an alignment. All sequences must be of equal length, gaps can be specified using dots "." or dashes "–". For example:


muscle -in seqs.afa -out refined.afa -refine

2.8 Using a pre-computed guide tree

The –usetree option allows you to provide your own guide tree. For example,


muscle -in seqs.fa -out seqs.afa -usetree mytree.phy


The tree must by in Newick format, as used by the Phylip package (hence the .phy extension). The Newick format is described here:



WARNING. Do not use this option just because you believe that you have an accurate evolutionary tree for your sequences. The best guide tree for multiple alignment is not in general the correct evolutionary tree. This can be understood by the following argument. Alignment accuracy decreases with lower sequence identity. It follows that given a set of profiles, the two that can be aligned most accurately will tend to be the pair with the highest identity, i.e. at the shortest evolutionary distance. This is exactly the pair selected by the nearest-neighbor criterion which MUSCLE uses by default. When mutation rates are variable, the evolutionary neighbor may not be the nearest neighbor. This explains why a nearest-neighbor tree may be superior to the true evolutionary tree for guiding a progressive alignment.


You will get a warning if you use the –usetree option. To disable the warning, use ­–usetree_nowarn instead,



muscle -in seqs.fa -out seqs.afa -usetree_nowarn mytree.phy

2.9 Profile-profile alignment

A fundamental step in the MUSCLE algorithm is aligning two multiple sequence alignments. This operation is sometimes called "profile-profile alignment". If you have two existing alignments of related sequences you can use the –profile option of MUSCLE to align those two sequences. Typical usage is:


muscle -profile -in1 one.afa -in2 two.afa -out both.afa


The alignments in one.afa and two.afa, which must be in aligned FASTA format, are aligned to each other, keeping input columns intact and inserting columns of gaps where needed. Output is stored in both.afa.


MUSCLE does not compute a similarity measure or measure of statistical significance (such as an E-value), so this option is not useful for discriminating homologs from unrelated sequences. For this task, I recommend Sadreyev & Grishin's COMPASS program.

2.10 Adding sequences to an existing alignment

To add a sequence to an existing alignment that you wish to keep intact, use profile-profile alignment with the new sequence as a profile. For example, if you have an existing alignment existing_aln.afa and want to add a new sequence in new_seq.fa, use the following commands:


muscle -profile -in1 existing_aln.afa -in2 new_seq.fa -out combined.afa


If you have more than one new sequences, you can align them first then add them, for example:


muscle -in new_seqs.fa -out new_seqs.afa

muscle -profile -in1 existing_aln.afa -in2 new_seqs.afa -out combined.afas

2.11 Specifying a protein substitution matrix

You can specify your own substitution matrix by using the -matrix option. This reads a protein substitution matrix in NCBI or WU-BLAST format. The alphabet is assumed to be amino acid, and sum-of-pairs scoring is used. The ­-gapopen, -gapextend and -center parameters should be specified; normally you will specify a zero value for the center. Note that gap penalties MUST be negative. The environment variable MUSCLE_MXPATH can be used to specify a path where the matrices are stored. For example,


muscle -in seqs.fa -out seqs.afa -matrix /data/matrix/blosum62

    -gapopen -12.0 -gapextend -1.0 -center 0.0


Example matrices can be downloaded from the NCBI FTP site. At the time of writing they are found here:


2.12 Specifying a nucleotide substitution matrix

MUSCLE isn't really designed to support a nucleotide matrix, but you can hack it by pretending that AGCT are amino acids and making a 20x20 matrix out of the original 4x4 matrix. You MUST specify the -seqtype protein option to fool MUSCLE into believing that it is aligning amino acid sequences. For more information, see:

2.13 Refining a long alignment

A long alignment can be refined using the –refinew option, which is primarily designed for refining whole-genome nucleotide alignments. Usage is:


muscle -refinew -in input.afa -out output.afa


MUSCLE divides the input alignment into non-overlapping windows and re-aligns each window from scratch, i.e. all gap characters are discarded. The –refinewindow option may be used to change the window length, which is 200 columns by default.

3 File Formats

MUSCLE uses FASTA format for both input and output. For output only, it also offers CLUSTALW, MSF, HTML, Phylip sequential and Phylip interleaved formats. See the following command-line options: ‑clw, ‑clwstrict, –msf, –html, –phys, –phyi,clwout, ‑clwstrictout, –msfout, –htmlout, –physout and –phyiout.


3.1 Input files

Input files must be in FASTA format. These are plain text files (word processing files such as Word documents are not understood!). Unix, Windows and DOS text files are supported (end-of-line may be NL or CR NL). There is no explicit limit on the length of a sequence, however if you are running a 32-bit version of muscle then the maximum will be very roughly 10,000 letters due to maximum addressable size of tables required in memory. Each sequence starts with an annotation line, which is recognized by having a greater-than symbol ">" as its first character. There is no limit on the length of an annotation line (this is new as of version 3.5), and there is no requirement that the annotation be unique. The sequence itself follows on one or more subsequent lines, and is terminated either by the next annotation line or by the end of the file.

3.1.1 Amino acid sequences

The standard single-letter amino acid alphabet is used. Upper and lower case is allowed, the case is not significant. The special characters X, B, Z and U are understood. X means "unknown amino acid", B is D or N, Z is E or Q. U is understood to be the 21st amino acid Selenocysteine. White space (spaces, tabs and the end-of-line characters CR and NL) is allowed inside sequence data. Dots "." and dashes "–" in sequences are allowed and are discarded unless the input is expected to be aligned (e.g. for the –refine option).

3.1.2 Nucleotide sequences

The usual letters A, G, C, T and U stand for nucleotides. The letters T and U are equivalent as far as MUSCLE is concerned. N is the wildcard meaning "unknown nucleotide". R means A or G, Y means C or T/U. Other wildcards, such as those used by RFAM, are not understood in this version and will be replaced by Ns. If you would like support for other DNA / RNA alphabets, please let me know.

3.1.3 Determining sequence type

By default, MUSCLE looks at the first 100 letters in the input sequence data (excluding gaps). If 95% or more of those letters are valid nucleotides (AGCTUN), then the file is treated as nucleotides, otherwise as amino acids. This method almost always guesses correctly, but you can make sure by specifying the sequence type on the command line. This is done using the –seqtype option, which can take the following values:


        –­seqtype protein                          Amino acid

        –seqtype dna                                        DNA (ACGT alphabet)

        –seqtype rna                                 DNA (ACGT alphabet)

        –seqtype auto                               Automatic detection (default).

3.2 Output files

By default, output is also written in FASTA format. All letters are upper-case and gaps are represented by dashes "–". Output is written to the following destination(s):


        If no other output option is given, then standard output.

        If -out <filename> is given, to the specified file.

        For all of the -xxxout options (e.g. -fastaout, -clwout), to the specified files.

3.2.1 Sequence grouping

By default, MUSCLE re-arranges sequences so that similar sequences are adjacent in the output file. (This is done by ordering sequences according to a prefix traversal of the guide tree). This makes the alignment easier to evaluate by eye. If you want to the sequences to be output in the same order as the input file, you can use the –stable option.




3.2.2 Output to multiple file formats

You can request output to more than one file format by using the -xxxout options. For example, to get both FASTA and CLUSTALW formats:


muscle -in seqs.fa -fastaout seqs.afa -clwout seqs.aln

3.3 CLUSTALW format

You can request CLUSTALW output by using the –clw option. This should be compatible with CLUSTALW, with the exception of the program name in the file header. You can ask MUSCLE to impersonate CLUSTALW by writing "CLUSTAL W (1.81)" as the program name by using –clwstrict or ‑clwstrictout. Note that MUSCLE allows duplicate sequence labels, while CLUSTALW forbids duplicates. If you use the –stable option of muscle, then the order of the input sequences is preserved and sequences can be unambiguously identified even if the labels differ. If you have problems parsing MUSCLE output with scripts designed for CLUSTALW, please let me know and I'll do my best to provide a fix.

3.4 MSF format

MSF format, as used in the GCG package, is requested by using the –msf option. As with CLUSTALW format, this is easier for people to read than FASTA. As of MUSCLE 3.52, the MSF format has been tweaked to be more compatible with GCG. The following differences remain.


(a) MUSCLE truncates at the first white space or after 63 characters, which ever comes first. The GCG package apparently truncates after 10 characters. If this is a problem for you, please let me know and I'll add an option to truncate after 10 in a future version.


(b) MUSCLE allows duplicate sequence labels, while GCG forbids duplicates. If you use the –stable option of muscle, then the order of the input sequences is preserved and sequences can be unambiguously identified even if the labels differ.


Thanks to Eric Martel for help with improving GCG compatibility.

3.5 HTML format

I added an experimental feature starting in version 3.4. To get a Web page as output, use the –html option. The alignment is colored using a color scheme from Eric Sonnhammer's Belvu editor, which is my personal favorite. A drawback of this option is that the Web page typically contains a very large number of HTML tags, which can be slow to display in the Internet Explorer browser. The Netscape browser works much better. If you have any ideas about good ways to make Web pages, please let me know.

3.6 Phylip format

The Phylip package supports two different multiple sequence alignment file formats, called sequential and interleaved respectively.

4 Using MUSCLE

In this section we give more details of the MUSCLE algorithm and the more important options offered by the muscle implementation.

4.1 How the algorithm works

I won't give a complete description of the MUSCLE algorithm here—for that, you will have to read the papers. (See citations on title page above). But hopefully a summary will help explain what some of the command-line options do and how they might be useful in your work.


The first step is to calculate a tree. In CLUSTALW, this is done as follows. Each pair of input sequences is aligned, and used to compute the pair-wise identity of the pair. Identities are converted to a measure of distance. Finally, the distance matrix is converted to a tree using a clustering method (CLUSTALW uses neighbor-joining). If you have 1,000 sequences, there are (1,000 ΄ 999)/2 = 499,500 pairs, so aligning every pair can take a while. MUSCLE uses a much faster, but somewhat more approximate, method to compute distances: it counts the number of short sub-sequences (known as k-mers, k-tuples or words) that two sequences have in common, without constructing an alignment. This is typically around 3,000 times faster that CLUSTALW's method, but the trees will generally be less accurate. We call this step "k-mer clustering".


The second step is to use the tree to construct what is known as a progressive alignment. At each node of the binary tree, a pair-wise alignment is constructed, progressing from the leaves towards the root. The first alignment will be made from two sequences. Later alignments will be one of the three following types: sequence-sequence, profile-sequence or profile-profile, where "profile" means the multiple alignment of the sequences under a given internal node of the tree. This is very similar to what CLUSTALW does once it has built a tree.


Now we have a multiple alignment, which has been built very quickly compared with conventional methods, mainly because of the distance calculation using k-mers rather than alignments. The quality of this alignment is typically pretty good—it will often tie or beat a T-Coffee alignment on our tests. However, on average, we find that it can be improved by proceeding through the following steps.


From the multiple alignment, we can now compute the pair-wise identities of each pair of sequences. This gives us a new distance matrix, from which we estimate a new tree. We compare the old and new trees, and re-align subgroups where needed to produce a progressive multiple alignment from the new tree. If the two trees are identical, there is nothing to do; if there are no subtrees that agree (very unusual), then the whole progressive alignment procedure must be repeated from scratch. Typically we find that the tree is pretty stable near the leaves, but some re-alignments are needed closer the root. This procedure (compute pair-wise identities, estimate new tree, compare trees, re-align) is iterated until the tree stabilizes or until a specified maximum number of iterations has been done. We call this process "tree refinement", although it also tends to improve the alignment.


We now keep the tree fixed and move to a new procedure which is designed to improve the multiple alignment. The set of sequences is divided into two subsets (i.e., we make a bipartition on the set of sequences). A profile is constructed for each of the two subsets based on the current multiple alignment. These two profiles are then re-aligned to each other using the same pair-wise alignment algorithm as used in the progressive stage. If this improves an "objective score" that measures the quality of the alignment, then the new multiple alignment is kept, otherwise it is discarded. By default, the objective score is the classic sum-of-pairs score that takes the (sequence weighted) average of the pair-wise alignment score of every pair of sequences in the alignment. Bipartitions are chosen by deleting an edge in the guide tree, each of the two resulting subtrees defines a subset of sequences. This procedure is called "tree dependent refinement". One iteration of tree dependent refinement tries bipartitions produced by deleting every edge of the tree in depth order moving from the leaves towards the center of the tree. Iterations continue until convergence or up to a specified maximum.


For convenience, the major steps in MUSCLE are described as "iterations", though the first three iterations all do quite different things and may take very different lengths of time to complete. The tree-dependent refinement iterations 3, 4 ... are true iterations and will take similar lengths of time.





Distance matrix by k-mer clustering, estimate tree, progressive alignment according to this tree.



Distance matrix by pair-wise identities from current multiple alignment, estimate tree, progressive alignment according to new tree, repeat until convergence or specified maximum number of times.


3, 4 ...

Tree-dependent refinement. One iteration visits every edge in the tree one time.

4.2 Command-line options

There are two types of command-line options: value options and flag options. Value options are followed by the value of the given parameter, for example –in <filename>; flag options just stand for themselves, such as –msf. All options are a dash (not two dashes!) followed by a long name; there are no single-letter equivalents. Value options must be separated from their values by white space in the command line. Thus, muscle does not follow Unix, Linux or Posix standards, for which we apologize. The order in which options are given is irrelevant unless two options contradict, in which case the right-most option silently wins.

4.3 The maxiters option

You can control the number of iterations that MUSCLE does by specifying the –maxiters option. If you specify 1, 2 or 3, then this is exactly the number of iterations that will be performed. If the value is greater than 3, then muscle will continue up to the maximum you specify or until convergence is reached, which ever happens sooner. The default is 16. If you have a large number of sequences, refinement may be rather slow.

4.4 The maxtrees option

This option controls the maximum number of new trees to create in iteration 2. Our experience suggests that a point of diminishing returns is typically reached after the first tree, so the default value is 1. If a larger value is given, the process will repeat until convergence or until this number of trees has been created, which ever comes first.

4.5 The maxhours option

If you have a large alignment, muscle may take a long time to complete. It is sometimes convenient to say "I want the best alignment I can get in 24 hours" rather than specifying a set of options that will take an unknown length of time. This is done by using –maxhours, which specifies a floating-point number of hours. If this time is exceeded, muscle will write out current alignment and stop. For example,


muscle -in huge.fa -out huge.afa -maxiters 9999 -maxhours 24.0


Note that the actual time may exceed the specified limit by a few minutes while muscle finishes up on a step. It is also possible for no alignment to be produced if the time limit is too small.

4.6 The profile scoring function

Three different protein profile scoring functions are supported, the log-expectation score (–le option) and a sum of pairs score using either the PAM200 matrix (–sp) or the VTML240 matrix (–sv). The log-expectation score is the default as it gives better results on our tests, but is typically somewhere between two or three times slower than the sum-of-pairs score. For nucleotides, –spn is currently the only option (which is of course the default for nucleotide data, so you don't need to specify this option).

4.7 Diagonal optimization

Creating a pair-wise alignment by dynamic programming requires computing an L1 ΄ L2 matrix, where L1 and L2 are the sequence lengths. A trick used in algorithms such as BLAST is to reduce the size of this matrix by using fast methods to find "diagonals", also called "gapless high-scoring segment pairs", i.e. short regions of high similarity between the two sequences. This speeds up the algorithm at the expense of some reduction in accuracy. MUSCLE uses a technique called k-mer extension to find diagonals, which is described in this paper:


Edgar, R.C. (2004) Local homology recognition and distance measures in linear time using compressed amino acid alphabets, Nucleic Acids Res., 32, 1.


It is disabled by default because of the slight reduction in average accuracy and can be turned on by specifying the –diags option. To enable diagonal optimization in the first iteration, use –diags1, to enable diagonal optimization in the second iteration, use –diags2. These are provided separately because it would be a reasonable strategy to enable diagonals in the first iteration but not the second (because the main goal of the first iteration is to construct a multiple alignment quickly in order to improve the distance matrix, which is not very sensitive to alignment quality; whereas the goal of the second iteration is to make the best possible progressive alignment).

4.8 Anchor optimization

Tree-dependent refinement (iterations 3, 4 ... ) can be speeded up by dividing the alignment vertically into blocks. Block boundaries are found by identifying high-scoring columns (e.g., a perfectly conserved column of Cs or Ws would be a candidate). Each vertical block is then refined independently before reassembling the complete alignment, which is faster because of the L2 factor in dynamic programming (e.g., suppose the alignment is split into two vertical blocks, then 2 ΄ 0.52 = 0.5, so the dynamic programming time is roughly halved). The –noanchors option is used to disable this feature. This option has no effect if –maxiters 1 or –maxiters 2 is specified. On benchmark tests, enabling anchors has little or no effect on accuracy, but if you want to be very conservative and are striving for the best possible accuracy then –noanchors is a reasonable choice.

4.9 Log file

You can specify a log file by using –log <filename> or –loga <filename>. Using –log causes any existing file to be deleted, –loga appends to any existing file. A message will be written to the log file when muscle starts and stops. Error and warning messages will also be written to the log. If –verbose is specified, then more information will be written, including the command line used to invoke muscle, the resulting internal parameter settings, and also progress messages. The content and format of verbose log file output is subject to change in future versions.


The use of a log file may seem contrary to Unix conventions for using standard output and standard error. I like these conventions, but never found a fully satisfactory way to use them. I like progress messages (see below), but they mess up a file if you re-direct standard error and there are errors or warning messages too. I could try to detect whether a standard file handle is a tty device or a disk file and change behavior accordingly, but I regard this as too complicated and too hard for the user to understand. On Windows it can be hard to re-direct standard file handles, especially when working in a GUI debugger. Maybe one day I will figure out a better solution (suggestions welcomed).


I highly recommend using –verbose and ­–log[a], especially when running muscle in a batch mode. This enables you to verify whether a particular alignment was completed and to review any errors or warnings that occurred.

4.10 Progress messages

By default, muscle writes progress messages to standard error periodically so that you know it's doing something and get some feedback about the time and memory requirements for the alignment. Here is a typical progress message.


00:00:23     25 Mb (5%)  Iter   2  87.20%  Build guide tree


The fields are as follows.



Elapsed time since muscle started.

25 Mb (5%)

Peak memory use in megabytes (i.e., not the current usage, but the maximum amount of memory used since muscle started). The number in parentheses is the fraction of physical memory (see –maxmb option for more discussion).

Iter 2

Iteration currently in progress.


How much of the current step has been completed (percentage).


A brief description of the current step.


The –quiet command-line option disables writing progress messages to standard error. If the –verbose command-line option is specified, a progress message will be written to the log file when each iteration completes. So –quiet and –verbose are not contradictory.

4.11 Running out of memory

The muscle code tries to deal gracefully with low-memory conditions by using the following technique. A block of "emergency reserve" memory is allocated when muscle starts. If a later request to allocate memory fails, this reserve block is made available, and muscle attempts to save the current alignment. With luck, the reserved memory will be enough to allow muscle to save the alignment and exit gracefully with an informative error message.

4.12 Troubleshooting

Here is some general advice on what to do if muscle fails and you don't understand what happened. The code is designed to fail gracefully with an informative error message when something goes wrong, but there will no doubt be situations I haven't anticipated (not to mention bugs).


Check the MUSCLE web site for updates, bug reports and other relevant information.



Check the input file to make sure it is in valid FASTA format. Try giving it to another sequence analysis program that can accept large FASTA files (e.g., the NCBI formatdb utility) to see if you get an informative error message. Try dividing the file into two halves and using each half individually as input. If one half fails and the other does not, repeat until the problem is localized as far as possible.


Use –log or –loga and –­verbose and check the log file to see if there are any messages that give you a hint about the problem. Look at the peak memory requirements (reported in progress messages) to see if you may be exceeding the physical or virtual memory capacity of your computer.


If muscle crashes without giving an error message, or hangs, then you may need to refer to the source code or use a debugger. A "debug" version, muscled, may be provided. This is built from the same source code but with the DEBUG macro defined and without compiler optimizations. This version runs much more slowly (perhaps by a factor of three or more), but does a lot more internal checking and may be able to catch something that is going wrong in the code. The –­core option specifies that muscle should not catch exceptions. When –core is specified, an exception may result in a debugger trap or a core dump, depending on the execution environment. The –nocore option has the opposite effect. In muscle, –nocore is the default, –­core is the default in muscled.

4.13 Technical support

I am happy to provide support. But I am busy, and am offering this program at no charge, so I ask you to make a reasonable effort to figure things out for yourself before contacting me.

5 Command Line Reference


Value option

Legal values






Minimum spacing between anchor columns.



Floating point


Center parameter. Should be negative.








Clustering method. cluster1 is used in iteration 1 and 2, cluster2 in later iterations.



File name


Write output in CLUSTALW format to given file name.


File name


As -clwout, except that header is strictly compatible with CLUSTALW 1.81.





Maximum distance between two diagonals that allows them to merge into one diagonal.





Minimum length of diagonal.





Discard this many positions at ends of diagonal.










Kmer6_6 (amino) or Kmer4_6 (nucleo)

Distance measure for iteration 1.







Distance measure for iterations 2, 3 ...






File name


Write output in FASTA format to the given file.



Floating point


The gap open score. Must be negative.





Window size for determining whether a region is hydrophobic.



Floating point


Multiplier for gap open/close penalties in hydrophobic regions.



Any file name

standard input

Where to find the input sequences.



Any file name


Where to find an input alignment.



Any file name


Where to find an input alignment.



File name


Log file name (delete existing file).



File name


Log file name (append to existing file).



File name


File name for substitution matrix in NCBI or WU-BLAST format. If you specify your own matrix, you should also specify:


-gapopen <g>, -gapextend <e> -center 0.0


Note that <g> and <e> MUST be negative.



Floating point


Maximum time to run in hours. The actual time may exceed the requested limit by a few minutes. Decimals are allowed, so 1.5 means one hour and 30 minutes.



Integer 1, 2 ...


Maximum number of iterations.





Maximum number of new trees to build in iteration 2.



Floating point


Minimum score a column must have to be an anchor.



Floating point


Minimum smoothed score a column must have to be an anchor.



File name


Write output to given file name in MSF format.










Objective score used by tree dependent refinement.

sp=sum-of-pairs score.

spf=sum-of-pairs score (dimer approximation)

spm=sp for < 100 seqs, otherwise spf

dp=dynamic programming score.

ps=average profile-sequence score.

xp=cross profile score.



File name

standard output

Where to write the alignment.



File name


Write output in Phylip interleaved format to given file name.



File name


Write output in Phylip sequential format to given file name.





Length of window for -refinew.








Method used to root tree; root1 is used in iteration 1 and 2, root2 in later iterations.




File name


File name where to write a score file. This contains one line for each column in the alignment. The line contains the letters in the column followed by the average BLOSUM62 score over pairs of letters in the column.









Sequence type.


Floating point


Maximum value of column score for smoothing purposes.





Window used for anchor column smoothing.



File name


Compute SP objective score of multiple alignment.



Floating point value between 0 and 1.



Constant used in UPGMB clustering. Determines the relative fraction of average linkage (SUEFF) vs. nearest-neighbor linkage (1 – SUEFF).



File name


Save tree produced in first or second iteration to given file in Newick (Phylip-compatible) format.



File name


Use given tree as guide tree. Must by in Newick (Phyip-compatible) format.












Sequence weighting scheme.

weight1 is used in iterations 1 and 2.

weight2 is used for tree-dependent refinement.

none=all sequences have equal weight.

henikoff=Henikoff & Henikoff weighting scheme.

henikoffpb=Modified Henikoff scheme as used in PSI-BLAST.

clustalw=CLUSTALW method.

threeway=Gotoh three-way method.



Flag option

Set by default?




Use anchor optimization in tree dependent refinement iterations.




Use Steven Brenner's method for computing the root alignment.




Perform fast clustering of input sequences. Use the –tree1 option to save the tree.




Use dimer approximation for the SP score (faster, slightly less accurate).




Write output in CLUSTALW format (default is FASTA).




Write output in CLUSTALW format with the "CLUSTAL W (1.81)" header rather than the MUSCLE version. This is useful when a post-processing step is picky about the file header.



yes in muscle,

no in muscled.

Do not catch exceptions.





Use diagonal optimizations. Faster, especially for closely related sequences, but may be less accurate.




Use diagonal optimizations in first iteration.




Use diagonal optimizations in second iteration.




Write output in FASTA format.




Group similar sequences together in the output. This is the default. See also –stable.




Write output in HTML format (default is FASTA).




Use log-expectation profile score (VTML240). Alternatives are to use –sp or –sv. This is the default for amino acid sequences.




Write output in MSF format (default is FASTA). Designed to be compatible with the GCG package.




Disable anchor optimization. Default is –anchors.



no in muscle,

yes in muscled.

Catch exceptions and give an error message if possible.





Write output in Phylip interleaved format.




Write output in Phylip sequential format.




Compute profile-profile alignment. Input alignments must be given using –in1 and –in2 options.




Do not display progress messages.




Input file is already aligned, skip first two iterations and begin tree dependent refinement.




Refine an alignment by dividing it into non-overlapping windows and re-aligning each window. Typically used for whole-genome nucleotide alignments.




Use sum-of-pairs protein profile score (PAM200). Default is –le.




Compute alignment score of profile-profile alignment. Input alignments must be given using –in1 and –in2 options. These must be pre-aligned with gapped columns as needed, i.e. must be of the same length (have same number of columns).





Use sum-of-pairs nucleotide profile score. This is the only option for nucleotides, and is therefore the default. The substitution scores and gap penalty scores are "borrowed" from BLASTZ.




Preserve input order of sequences in output file. Default is to group sequences by similarity (–group).

WARNING THIS OPTION WAS BUGGY AND IS NOT SUPPORTED IN v3.8. Go to this link for more information:




Use sum-of-pairs profile score (VTML240). Default is –le.




Use 4-way test for treatment of terminal gaps. (Cannot be disabled in this version).




Terminal gaps penalized with full penalty.

[1] Not fully supported in this version.




Terminal gaps penalized with half penalty.

[1] Not fully supported in this version.




Terminal gaps penalized with half penalty if gap relative to

longer sequence, otherwise with full penalty.

[1] Not fully supported in this version.




Write parameter settings and progress messages to log file.




Write version string to stdout and exit.



[1] Default depends on the profile scoring function. To determine the default, use –verbose –log and check the log file.