def check_fixed_len_bcs_dups(header, mapping_data, errors):
 header_field_to_check = 'BarcodeSequence'
 try:
  check_ix = header.index(header_field_to_check)
 except ValueError:
  return errors
 barcodes = []
 correction = 1
 for curr_data in mapping_data:
  barcodes.append(upper(curr_data[check_ix]))
 dups = duplicates_indices(barcodes)
 for curr_dup in dups:
  for curr_loc in dups[curr_dup]:
   errors.append(('Duplicate barcode %s found. DCTB %d,%d' % (curr_dup, (curr_loc + correction), check_ix)))
 return errors

def check_fixed_len_bcs_dups ( header , mapping_data , errors ) : header_field_to_check = 'BarcodeSequence' try : check_ix = header . index ( header_field_to_check ) except ValueError : return errors barcodes = [ ] correction = 1 for curr_data in mapping_data : barcodes . append ( upper ( curr_data [ check_ix ] ) ) dups = duplicates_indices ( barcodes ) for curr_dup in dups : for curr_loc in dups [ curr_dup ] : errors . append ( ( 'Duplicate barcode %s found. DCTB %d,%d' % ( curr_dup , ( curr_loc + correction ) , check_ix ) ) ) return errors
checks barcodes of same length for duplicates .