augur.ancestral module

Infer ancestral sequences based on a tree.

augur.ancestral.ancestral_sequence_inference(tree=None, aln=None, ref=None, infer_gtr=True, marginal=False, fill_overhangs=True, infer_tips=False)

infer ancestral sequences using TreeTime

Parameters
  • tree (Bio.Phylo tree or str) – tree or filename of tree

  • aln (Bio.Align.MultipleSeqAlignment or str) – alignment or filename of alignment

  • infer_gtr (bool, optional) – Description

  • marginal (bool, optional) – Description

  • fill_overhangs (bool) – In some cases, the missing data on both ends of the alignment is filled with the gap character (β€˜-β€˜). If set to True, these end-gaps are converted to β€œambiguous” characters (β€˜N’ for nucleotides, β€˜X’ for aminoacids). Otherwise, the alignment is treated as-is

  • infer_tips (bool) – Since v0.7, TreeTime does not reconstruct tip states by default. This is only relevant when tip-state are not exactly specified, e.g. via characters that signify ambiguous states. To replace those with the most-likely state, set infer_tips=True

Returns

treetime.TreeAnc instance

Return type

TreeAnc

augur.ancestral.collect_mutations_and_sequences(tt, infer_tips=False, full_sequences=False, character_map=None, mask_ambiguous=True)

iterates of the tree and produces dictionaries with mutations and sequences for each node.

Parameters
  • tt (treetime) – instance of treetime with valid ancestral reconstruction

  • infer_tips (bool, optional) – if true, request the reconstructed tip sequences from treetime, otherwise retain input ambiguities

  • full_sequences (bool, optional) – if true, add the full sequences

  • character_map (None, optional) – optional dictionary to map characters to a custom set.

Returns

dictionary of mutations and sequences

Return type

dict

augur.ancestral.register_arguments(parser)
augur.ancestral.run(args)