augur.tree module

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 with parameters “-nt”

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 with parameters “-fast” :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 with parameters ‘-f d -m GTRCAT -c 25 -p 235813 -n tre”

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.

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

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

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

  • >>> defaults = ("-nt", "-m", "-s")

  • >>> check_conflicting_args("-czb -n 2", defaults)

  • >>> check_conflicting_args("-czb -nt 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: -nt:

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.

Parameters
  • 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

Returns

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

Return type

str

augur.tree.register_arguments(parser)
augur.tree.run(args)
augur.tree.write_out_informative_fasta(compress_seq, alignment, stripFile=None)