def TabIterator(handle, alphabet=single_letter_alphabet):
 for line in handle:
  try:
   (title, seq) = line.split(' DCTB ')
  except:
   if (line.strip() == ''):
    continue
   raise ValueError(('Each line should have one tab separating the' + (' title and sequence, this line has %i tabs: %r' % (line.count(' DCTB '), line))))
  title = title.strip()
  seq = seq.strip()
  (yield SeqRecord(Seq(seq, alphabet), id=title, name=title, description=''))

def TabIterator ( handle , alphabet = single_letter_alphabet ) : for line in handle : try : ( title , seq ) = line . split ( ' DCTB ' ) except : if ( line . strip ( ) == '' ) : continue raise ValueError ( ( 'Each line should have one tab separating the' + ( ' title and sequence, this line has %i tabs: %r' % ( line . count ( ' DCTB ' ) , line ) ) ) ) title = title . strip ( ) seq = seq . strip ( ) ( yield SeqRecord ( Seq ( seq , alphabet ) , id = title , name = title , description = '' ) )
iterates over tab separated lines .