def merge_clusters_chimeras(de_novo_clusters, chimeras):
 expanded_chimeras = []
 expanded_non_chimeras = []
 for curr_cluster in de_novo_clusters:
  curr_seq_ids = []
  matches_chimera = False
  for curr_seq in de_novo_clusters[curr_cluster]:
   if (curr_seq in chimeras):
    matches_chimera = True
   curr_seq_ids.append(curr_seq)
  if matches_chimera:
   expanded_chimeras += curr_seq_ids
  else:
   expanded_non_chimeras += curr_seq_ids
 return (expanded_chimeras, expanded_non_chimeras)

def merge_clusters_chimeras ( de_novo_clusters , chimeras ) : expanded_chimeras = [ ] expanded_non_chimeras = [ ] for curr_cluster in de_novo_clusters : curr_seq_ids = [ ] matches_chimera = False for curr_seq in de_novo_clusters [ curr_cluster ] : if ( curr_seq in chimeras ) : matches_chimera = True curr_seq_ids . append ( curr_seq ) if matches_chimera : expanded_chimeras += curr_seq_ids else : expanded_non_chimeras += curr_seq_ids return ( expanded_chimeras , expanded_non_chimeras )
merges results of chimeras/clusters into list of chimeras .