def get_curr_bc_added_field(curr_bc, ids_bcs_added_field, fasta_label, all_bcs, barcode_type='golay_12', disable_bc_correction=False, added_demultiplex_field=None):
 if added_demultiplex_field:
  added_field = get_added_demultiplex_field(ids_bcs_added_field, fasta_label, added_demultiplex_field)
 else:
  added_field = None
 if disable_bc_correction:
  num_errors = 0
  corrected_bc = get_exact_bc_matches(curr_bc, all_bcs)
 else:
  (corrected_bc, num_errors) = attempt_bc_correction(curr_bc, all_bcs, barcode_type)
 return (corrected_bc, num_errors, added_field)

def get_curr_bc_added_field ( curr_bc , ids_bcs_added_field , fasta_label , all_bcs , barcode_type = 'golay_12' , disable_bc_correction = False , added_demultiplex_field = None ) : if added_demultiplex_field : added_field = get_added_demultiplex_field ( ids_bcs_added_field , fasta_label , added_demultiplex_field ) else : added_field = None if disable_bc_correction : num_errors = 0 corrected_bc = get_exact_bc_matches ( curr_bc , all_bcs ) else : ( corrected_bc , num_errors ) = attempt_bc_correction ( curr_bc , all_bcs , barcode_type ) return ( corrected_bc , num_errors , added_field )
attempts to correct barcode .