biotite icon indicating copy to clipboard operation
biotite copied to clipboard

Feature Request: Option to translate NucleotideSequences with ambiguous alphabets

Open ncoish opened this issue 2 years ago • 0 comments

The translate method on NucleotideSequence is very useful when you have an unambiguous sequence, but if the sequence contains symbols from the extended ambiguous alphabet, calling the translate method results in the following exception:

biotite.sequence.AlphabetError: Translation requires unambiguous alphabet

For my use-case it would be fine if codons containing ambiguity characters simply mapped to an "unknown residue" symbol like "X". Could a keyword argument be added to translate to allow for this behaviour? Maybe it would accept a "default" character to use in the case of failed translation.

ncoish avatar Nov 15 '23 20:11 ncoish