from Bio import SeqIO
import os
import traceback
def fq2fa(my_file,dir_path):
    error_signal = 0
    error_str = ""
    try:

        output_file = dir_path + os.path.basename(my_file) + ".trimmed.fa"
        print("Start "  + my_file + " convert to " + output_file)
        SeqIO.convert(my_file, "fastq", output_file, "fasta")
        print("Finish " + my_file + " convert to " + output_file)
        return error_signal,error_str
    except Exception:
        error_signal += 1
        error_str = traceback.format_exc()
        return error_signal,error_str