def select_unique_rand_bcs(rand_bcs, unique_threshold):
 temp_dir = get_qiime_temp_dir()
 (fasta_fd, fasta_tempfile_name) = mkstemp(dir=temp_dir, prefix='tmp', suffix='.fas')
 rand_bcs = set(rand_bcs)
 with open(fasta_tempfile_name, 'w') as fasta_tempfile:
  for rand_bc in rand_bcs:
   fasta_tempfile.write('>{}\n{}\n'.format(rand_bc, rand_bc))
 fasta_tempfile.close()
 (_, _, unique_rand_bcs) = get_clusters_from_fasta_filepath(fasta_tempfile_name, original_fasta_path=None, percent_ID=unique_threshold, save_uc_files=False, output_dir=temp_dir)
 unique_rand_bcs = set(unique_rand_bcs)
 remove_files([fasta_tempfile_name])
 return unique_rand_bcs

def select_unique_rand_bcs ( rand_bcs , unique_threshold ) : temp_dir = get_qiime_temp_dir ( ) ( fasta_fd , fasta_tempfile_name ) = mkstemp ( dir = temp_dir , prefix = 'tmp' , suffix = '.fas' ) rand_bcs = set ( rand_bcs ) with open ( fasta_tempfile_name , 'w' ) as fasta_tempfile : for rand_bc in rand_bcs : fasta_tempfile . write ( '>{}\n{}\n' . format ( rand_bc , rand_bc ) ) fasta_tempfile . close ( ) ( _ , _ , unique_rand_bcs ) = get_clusters_from_fasta_filepath ( fasta_tempfile_name , original_fasta_path = None , percent_ID = unique_threshold , save_uc_files = False , output_dir = temp_dir ) unique_rand_bcs = set ( unique_rand_bcs ) remove_files ( [ fasta_tempfile_name ] ) return unique_rand_bcs
attempts to select true barcodes from set of barcodes i .