cbrc
MAFFT version 6

Multiple alignment program for amino acid or nucleotide sequences

How to put a user-defined guide tree

By default, MAFFT automatically generates a guide tree with the all-to-all comparison.  This tree can be replaced with a user-defined tree.  This function can be used to construct a multiple alignment assuming a phylogenetic relationship among the sequences.
  1. Prepare a newick tree file, tree.  For example,
    ((1:0.1,2:0.1):0.3,(3:0.3,(4:0.2,5:0.2):0.1):0.1)
    
    • It has to be a rooted tree.
    • Branch lengths must be given.  The unit is 'substitition/site'. 
    • In the tree file, the name of each leaf must be a number (1,2,..).  '1' corresponds to the first sequence in the input sequence file, and '2' corresponds to the second sequence, and so on.
  2. Convert the tree to the native tree format of MAFFT.
    % ruby newick2mafft.rb tree > tree.mafft
    
    • The Ruby interpreter and the newick2mafft.rb script (Updated 2015/Dec) are required.
  3. Run mafft with the --treein argument.
    % mafft --auto --treein tree.mafft input > output