def check_header_required_fields(header, errors, sample_id_ix, desc_ix, bc_ix, linker_primer_ix, added_demultiplex_field=None):
 header_checks = {sample_id_ix: 'SampleID', desc_ix: 'Description', bc_ix: 'BarcodeSequence', linker_primer_ix: 'LinkerPrimerSequence'}
 for curr_check in header_checks:
  if ((header[curr_check] != header_checks[curr_check]) and (header_checks[curr_check] == 'Description')):
   errors.append((('Found header field %s, last field should be %s' % (header[curr_check], header_checks[curr_check])) + (' DCTB %d,%d' % (0, curr_check))))
  elif ((header[curr_check] != header_checks[curr_check]) and (header_checks[curr_check] != 'Description')):
   errors.append((('Found header field %s, expected field %s' % (header[curr_check], header_checks[curr_check])) + (' DCTB %d,%d' % (0, curr_check))))
 if added_demultiplex_field:
  if (added_demultiplex_field not in header):
   errors.append(('Missing added demultiplex field %s DCTB %d,%d' % (added_demultiplex_field, (-1), (-1))))
 return errors

def check_header_required_fields ( header , errors , sample_id_ix , desc_ix , bc_ix , linker_primer_ix , added_demultiplex_field = None ) : header_checks = { sample_id_ix : 'SampleID' , desc_ix : 'Description' , bc_ix : 'BarcodeSequence' , linker_primer_ix : 'LinkerPrimerSequence' } for curr_check in header_checks : if ( ( header [ curr_check ] != header_checks [ curr_check ] ) and ( header_checks [ curr_check ] == 'Description' ) ) : errors . append ( ( ( 'Found header field %s, last field should be %s' % ( header [ curr_check ] , header_checks [ curr_check ] ) ) + ( ' DCTB %d,%d' % ( 0 , curr_check ) ) ) ) elif ( ( header [ curr_check ] != header_checks [ curr_check ] ) and ( header_checks [ curr_check ] != 'Description' ) ) : errors . append ( ( ( 'Found header field %s, expected field %s' % ( header [ curr_check ] , header_checks [ curr_check ] ) ) + ( ' DCTB %d,%d' % ( 0 , curr_check ) ) ) ) if added_demultiplex_field : if ( added_demultiplex_field not in header ) : errors . append ( ( 'Missing added demultiplex field %s DCTB %d,%d' % ( added_demultiplex_field , ( - 1 ) , ( - 1 ) ) ) ) return errors
checks for required header fields .