def get_rev_primer_seqs(mapping_fp):
 (hds, mapping_data, run_description, errors, warnings) = process_id_map(mapping_fp, has_barcodes=False, disable_primer_check=True)
 if errors:
  for curr_err in errors:
   if curr_err.startswith('Duplicate SampleID'):
    raise ValueError((('Errors were found with mapping file, ' + 'please run validate_mapping_file.py to ') + 'identify problems.'))
 id_map = {}
 for curr_data in mapping_data:
  id_map[curr_data[0]] = {}
 for header in range(len(hds)):
  for curr_data in mapping_data:
   id_map[curr_data[0]][hds[header]] = curr_data[header]
 reverse_primers = {}
 for curr_id in id_map.keys():
  try:
   reverse_primers[curr_id] = [str(DNA(curr_rev_primer).rc()) for curr_rev_primer in id_map[curr_id]['ReversePrimer'].split(',')]
  except KeyError:
   raise KeyError(('Reverse primer not found in mapping file, ' + "please include a 'ReversePrimer' column."))
 for curr_err in errors:
  if curr_err.startswith('Invalid DNA sequence detected'):
   raise ValueError(('Problems found with reverse primers, please ' + 'check mapping file with validate_mapping_file.py'))
 return reverse_primers

def get_rev_primer_seqs ( mapping_fp ) : ( hds , mapping_data , run_description , errors , warnings ) = process_id_map ( mapping_fp , has_barcodes = False , disable_primer_check = True ) if errors : for curr_err in errors : if curr_err . startswith ( 'Duplicate SampleID' ) : raise ValueError ( ( ( 'Errors were found with mapping file, ' + 'please run validate_mapping_file.py to ' ) + 'identify problems.' ) ) id_map = { } for curr_data in mapping_data : id_map [ curr_data [ 0 ] ] = { } for header in range ( len ( hds ) ) : for curr_data in mapping_data : id_map [ curr_data [ 0 ] ] [ hds [ header ] ] = curr_data [ header ] reverse_primers = { } for curr_id in id_map . keys ( ) : try : reverse_primers [ curr_id ] = [ str ( DNA ( curr_rev_primer ) . rc ( ) ) for curr_rev_primer in id_map [ curr_id ] [ 'ReversePrimer' ] . split ( ',' ) ] except KeyError : raise KeyError ( ( 'Reverse primer not found in mapping file, ' + "please include a 'ReversePrimer' column." ) ) for curr_err in errors : if curr_err . startswith ( 'Invalid DNA sequence detected' ) : raise ValueError ( ( 'Problems found with reverse primers, please ' + 'check mapping file with validate_mapping_file.py' ) ) return reverse_primers
parses mapping file to get dictionary of sampleid:rev primer mapping_fp: mapping filepath .