def METHOD_NAME():
    parser = argparse.ArgumentParser( description='Convert FASTQ to FASTA format')
    ## output file to be written
    parser.add_argument('-i', '--input_file', type=str, required=True, help='Path to an input file to be read' )
    parser.add_argument('-o', '--output_file', type=str, required=False, help='Path to an output file to be created' )
    parser.add_argument('-d', '--detect_direction', action='store_true', help='Pass this flag to auto-detect the mate pair direction.  See full documentation for more info' )
    parser.add_argument('-w', '--width', type=int, required=False, help='Defines the width (or number of bases) on each FASTA sequence line' )
    args = parser.parse_args()
    if args.output_file is None:
        ofh = sys.stdout
    else:
        ofh = open( args.output_file, 'wt' )
    line_count = 0
    record_count = 0
    last_header = None
    for line in open(args.input_file, 'rU'):
        line_count += 1
        if line_count % 4 == 1:
            record_count += 1
            if args.detect_direction:
                m = re.search('^\@(.+?) (\d)', line)
                if m:
                    last_header = "{0}/{1}\n".format(m.group(1), m.group(2))
                else:
                    raise Exception("ERROR: FASTQ header line found that didn't match expected format: {0}".format(line))
            else:
                line = line.lstrip('@')
                last_header = line
        elif line_count % 4 == 2:
            if args.width:
                ofh.write(">{0}{1}\n".format(last_header, wrapped(line, args.width)))
            else:
                ofh.write(">{0}{1}".format(last_header, line))
    ofh.close()
    print("{0} records written to the output FASTA file".format(record_count))