Build a tree using a variety of methods.

exception augur.tree.ConflictingArgumentsException

Bases: Exception

Exception when user-provided tree builder arguments conflict with the requested tree builder’s hardcoded defaults (e.g., the path to the alignment, etc.).

augur.tree.build_fasttree(aln_file, out_file, clean_up=True, nthreads=1, tree_builder_args=None)

build tree using fasttree

augur.tree.build_iqtree(aln_file, out_file, substitution_model='GTR', clean_up=True, nthreads=1, tree_builder_args=None)

build tree using IQ-Tree :param aln_file file name of input aligment: :param out_file file name to write tree to:

augur.tree.build_raxml(aln_file, out_file, clean_up=True, nthreads=1, tree_builder_args=None)

build tree using RAxML

augur.tree.check_conflicting_args(tree_builder_args, defaults)

Checks the given user-provided tree builder arguments for hardcoded default arguments and raise an exception with a list of any that are found.

  • tree_builder_args (str) – User-provided tree builder arguments

  • defaults (list or tuple) – List of hardcoded default arguments (e.g., [‘-nt’])


ConflictingArgumentsException – When any user-provided arguments match those in the defaults.


>>> defaults = ("-ntmax", "-m", "-s")
>>> check_conflicting_args("-czb -n 2", defaults)
>>> check_conflicting_args("-czb -ntmax 2", defaults)
Traceback (most recent call last):
augur.tree.ConflictingArgumentsException: The following tree builder arguments conflict with hardcoded defaults. Remove these arguments and try again: -ntmax
augur.tree.find_executable(names, default=None)

Return the path to the first executable found in PATH from the given list of names.

Raises a (hopefully helpful) error if no executable is found. Provide a value for the “default” parameter to instead return a value.

augur.tree.mask_sites_in_multiple_sequence_alignment(alignment_file, excluded_sites_file)

Creates a new multiple sequence alignment FASTA file from which the given excluded sites have been removed and returns the filename of the new alignment.

  • alignment_file (str) – path to the original multiple sequence alignment file

  • excluded_sites_file (str) – path to a text file containing each nucleotide position to exclude with one position per line


path to the new FASTA file from which sites have been excluded

Return type:


augur.tree.write_out_informative_fasta(compress_seq, alignment, stripFile=None)