API documentation

Main library

class mutalyzer_backtranslate.backtranslate.BackTranslate(table_id=1)

Back translation.

Parameters

table_id (int) – Translation table id.

improvable()

Calculate all pairs of amino acid substututions that can be improved by looking at the underlying codon.

Returns list

List of improvable substitutions.

with_dna(reference_codon, amino_acid)

Find single nucleotide substitutions that given a reference codon explains an observed amino acid.

Parameters
  • reference_codon (str) – Original codon.

  • amino_acid (str) – Observed amino acid.

Returns dict

Set of single nucleotide substitutions indexed by position.

without_dna(reference_amino_acid, amino_acid)

Find single nucleotide substitutions that given a reference amino acid explains an observed amino acid.

Parameters
  • reference_amino_acid (str) – Original amino acid.

  • amino_acid (str) – Observed amino acid.

Returns dict

Set of single nucleotide substitutions indexed by position.

mutalyzer_backtranslate.backtranslate.cmp_subst(subst_1, subst_2)

Compare two substitution sets.

Parameters
  • subst_1 (dict) – Substitution set.

  • subst_2 (dict) – Substitution set.

Returns bool

True if subst_1 equals subst2, False otherwise.

mutalyzer_backtranslate.backtranslate.reverse_translation_table(table_id=1)

Calculate a reverse translation table.

Parameters

table_id (int) – Translation table id.

Returns dict

Set of possible codons indexed by amino acid.

Utils

mutalyzer_backtranslate.util.subst_to_cds(substitutions, offset)

Convert a set of substitutions to CDS coordinates.

Parameters
  • substitutions (dict) – Set of single nucleotide substitutions indexed by position.

  • offset (int) – Codon position in the CDS.

Returns set

Substitutions in CDS coordinates.