When applying the function codon_tables.codon_table_to_codon_map(), the default (deterministic) behavior of the resulting codon map is to choose the first codon from the table. The codon tables available in SeqLike or sourced from Edinburgh Genome Foundry are in codon-alphabetical order, which seems rather arbitrary.
Arguably, the preferred/expected behavior is for the deterministic default to choose the most frequent codon from the table.
I propose that the function always sorts the codon table entries in order of most-to-least-frequent codons when deterministic = True. Alternatively, we could add an argument option to sort the codon table entries.
A third option would be to pre-sort the available codon tables by codon frequency such that the deterministic codon map chooses the most frequent codon without additional sorting.
When applying the function
codon_tables.codon_table_to_codon_map()
, the default (deterministic) behavior of the resulting codon map is to choose the first codon from the table. The codon tables available in SeqLike or sourced from Edinburgh Genome Foundry are in codon-alphabetical order, which seems rather arbitrary.Arguably, the preferred/expected behavior is for the deterministic default to choose the most frequent codon from the table.
I propose that the function always sorts the codon table entries in order of most-to-least-frequent codons when
deterministic = True
. Alternatively, we could add an argument option to sort the codon table entries.