def get_codon_alphabet(alphabet, gap='-', stop='*'):
 from Bio.Alphabet import NucleotideAlphabet
 if isinstance(alphabet, NucleotideAlphabet):
  alpha = alphabet
  if gap:
   alpha = Gapped(alpha, gap_char=gap)
  if stop:
   alpha = HasStopCodon(alpha, stop_symbol=stop)
 else:
  raise TypeError('Only Nuclteotide Alphabet is accepted!')
 return alpha

def get_codon_alphabet ( alphabet , gap = '-' , stop = '*' ) : from Bio . Alphabet import NucleotideAlphabet if isinstance ( alphabet , NucleotideAlphabet ) : alpha = alphabet if gap : alpha = Gapped ( alpha , gap_char = gap ) if stop : alpha = HasStopCodon ( alpha , stop_symbol = stop ) else : raise TypeError ( 'Only Nuclteotide Alphabet is accepted!' ) return alpha
gets alignment alphabet for codon alignment .