def seq3(seq, custom_map=None, undef_code='Xaa'):
 if (custom_map is None):
  custom_map = {'*': 'Ter'}
 threecode = dict((list(IUPACData.protein_letters_1to3_extended.items()) + list(custom_map.items())))
 return ''.join((threecode.get(aa, undef_code) for aa in seq))

def seq3 ( seq , custom_map = None , undef_code = 'Xaa' ) : if ( custom_map is None ) : custom_map = { '*' : 'Ter' } threecode = dict ( ( list ( IUPACData . protein_letters_1to3_extended . items ( ) ) + list ( custom_map . items ( ) ) ) ) return '' . join ( ( threecode . get ( aa , undef_code ) for aa in seq ) )
turn a one letter code protein sequence into one with three letter codes .