augur.translate moduleο
Translate gene regions from nucleotides to amino acids.
- exception augur.translate.MismatchNodeErrorο
Bases:
Exception
- exception augur.translate.MissingNodeErrorο
Bases:
Exception
- augur.translate.assign_aa_fasta(tree, translations)ο
- augur.translate.assign_aa_vcf(tree, translations)ο
- augur.translate.construct_mut(start, pos, end)ο
- augur.translate.get_genes_from_file(fname)ο
- augur.translate.register_arguments(parser)ο
- augur.translate.run(args)ο
- augur.translate.safe_translate(sequence, report_exceptions=False)ο
Returns an amino acid translation of the given nucleotide sequence accounting for gaps in the given sequence.
Optionally, returns a tuple of the translated sequence and whether an exception was raised during initial translation.
>>> safe_translate("ATG") 'M' >>> safe_translate("ATGGT-") 'MX' >>> safe_translate("ATG---") 'M-' >>> safe_translate("ATGTAG") 'M*' >>> safe_translate("") '' >>> safe_translate("ATGT") 'MX' >>> safe_translate("ATG", report_exceptions=True) ('M', False) >>> safe_translate("ATGA-G", report_exceptions=True) ('MX', True)
- augur.translate.translate_feature(aln, feature)ο
Translates a subsequence of input nucleotide sequences.
- Parameters
aln (dict) β sequences indexed by node name
feature (Bio.Seq.Seq) β BioPython sequence feature
- Returns
translated sequences indexed by node name
- Return type
dict
- augur.translate.translate_vcf_feature(sequences, ref, feature)ο
Translates a subsequence of input nucleotide sequences.
- Parameters
sequences (dict) β TreeTime format dictionary from VCF-input of sequences indexed by node name
ref β reference alignment the VCF was mapped to
feature (Bio.Seq.Seq) β BioPython sequence feature
- Returns
translated reference gene, positions of AA differences, and AA differences indexed by node name
- Return type
dict