def final_repset_from_iteration_repsets(repset_fasta_fs):
 observed = {}
 for repset_fasta_f in repset_fasta_fs:
  for (otu_id, seq) in parse_fasta(repset_fasta_f):
   o = otu_id.split()[0]
   if (not (o in observed)):
    (yield (otu_id, seq))
    observed[o] = None
   else:
    pass

def final_repset_from_iteration_repsets ( repset_fasta_fs ) : observed = { } for repset_fasta_f in repset_fasta_fs : for ( otu_id , seq ) in parse_fasta ( repset_fasta_f ) : o = otu_id . split ( ) [ 0 ] if ( not ( o in observed ) ) : ( yield ( otu_id , seq ) ) observed [ o ] = None else : pass
the first observation of each otu is chosen as the representative - this ensures that the representative sequence is the centroid of the cluster .