def write_corrected_mapping(output_corrected_fp, header, run_description, corrected_mapping_data):
 out_f = open(output_corrected_fp, 'w')
 out_f.write((('#' + ' DCTB '.join(header).replace('\n', '')) + '\n'))
 for curr_comment in run_description:
  out_f.write((('#' + curr_comment.replace('\n', '')) + '\n'))
 for curr_data in corrected_mapping_data:
  out_f.write((' DCTB '.join(curr_data).replace('\n', '') + '\n'))

def write_corrected_mapping ( output_corrected_fp , header , run_description , corrected_mapping_data ) : out_f = open ( output_corrected_fp , 'w' ) out_f . write ( ( ( '#' + ' DCTB ' . join ( header ) . replace ( '\n' , '' ) ) + '\n' ) ) for curr_comment in run_description : out_f . write ( ( ( '#' + curr_comment . replace ( '\n' , '' ) ) + '\n' ) ) for curr_data in corrected_mapping_data : out_f . write ( ( ' DCTB ' . join ( curr_data ) . replace ( '\n' , '' ) + '\n' ) )
writes corrected mapping file with invalid characters replaced output_corrected_fp: filepath to write corrected mapping file to .