def get_ids_bcs_added_field(header, mapping_data, barcode_type='golay_12', added_demultiplex_field=None):
 sample_id_ix = header.index('SampleID')
 bc_ix = header.index('BarcodeSequence')
 if added_demultiplex_field:
  added_demultiplex_ix = header.index(added_demultiplex_field)
 ids_bcs_added_field = {}
 for line in mapping_data:
  if (barcode_type == 0):
   curr_bc = ''
  else:
   curr_bc = line[bc_ix]
  if added_demultiplex_field:
   curr_added_field = line[added_demultiplex_ix]
  else:
   curr_added_field = ''
  ids_bcs_added_field[(upper(curr_bc), curr_added_field)] = line[sample_id_ix]
 return ids_bcs_added_field

def get_ids_bcs_added_field ( header , mapping_data , barcode_type = 'golay_12' , added_demultiplex_field = None ) : sample_id_ix = header . index ( 'SampleID' ) bc_ix = header . index ( 'BarcodeSequence' ) if added_demultiplex_field : added_demultiplex_ix = header . index ( added_demultiplex_field ) ids_bcs_added_field = { } for line in mapping_data : if ( barcode_type == 0 ) : curr_bc = '' else : curr_bc = line [ bc_ix ] if added_demultiplex_field : curr_added_field = line [ added_demultiplex_ix ] else : curr_added_field = '' ids_bcs_added_field [ ( upper ( curr_bc ) , curr_added_field ) ] = line [ sample_id_ix ] return ids_bcs_added_field
creates dict of data for sampleid .