augur.clades
Assign clades to nodes in a tree based on amino-acid or nucleotide signatures.
- augur.clades.assign_clades(clade_designations, all_muts, tree, ref=None)
Ensures all nodes have an entry (or auspice doesn’t display nicely), tests each node to see if it’s the first member of a clade (assigns ‘clade_annotation’), and sets all nodes’s clade_membership to the value of their parent. This will change if later found to be the first member of a clade.
- Parameters:
clade_designations (dict) – clade definitions as
{clade_name:[(gene, site, allele),...]}
all_muts (dict) – mutations in each node
tree (Bio.Phylo.BaseTree.Tree) – phylogenetic tree to process
ref (str or list, optional) – reference sequence to look up state when not mutated
- Returns:
mapping of node to clades
- Return type:
- augur.clades.get_reference_sequence_from_root_node(all_muts, root_name)
- augur.clades.is_node_in_clade(clade_alleles, node, ref)
Determines whether a node matches the clade definition based on sequence For any condition, will first look in mutations stored in node.sequences, then check whether a reference sequence is available, and other reports ‘non-match’
- Parameters:
clade_alleles (list) – list of clade defining alleles
node (Bio.Phylo.BaseTree.Clade) – node to check, assuming sequences (as mutations) are attached to node
- Returns:
True if in clade
- Return type:
- augur.clades.read_in_clade_definitions(clade_file)
Reads in tab-seperated file that defines clades by amino acid or nucleotide mutations
Inheritance is allowed, but needs to be acyclic. Alleles can be overwritten by inheriting clades.
Sites are 1 indexed in the file, and are converted to 0 indexed in the output
Empty lines are ignored, comments after # are ignored
Format:
clade gene site alt Clade_1 ctpE 81 D Clade_2 nuc 30642 T Clade_3 nuc 444296 A Clade_3 S 1 P # Clade_4 inherits from Clade_3 Clade_4 clade Clade_3 Clade_4 pks8 634 T # Inherited allele can be overwritten Clade_4 S 1 L
- augur.clades.register_parser(parent_subparsers)
- augur.clades.run(args)