def get_first_id(lines):
 result = set()
 for line in lines:
  if line.startswith('>'):
   result.add(line[1:].split()[0])
 return result

def get_first_id ( lines ) : result = set ( ) for line in lines : if line . startswith ( '>' ) : result . add ( line [ 1 : ] . split ( ) [ 0 ] ) return result
gets first fasta id from each line in lines .