def METHOD_NAME(filename, curs, id_cache):
    accession = None
    gene_symbol = None
    ec_numbers = list()
    for line in open(filename):
        try:
            line = line.rstrip()
        except UnicodeDecodeError:
            continue
        if line.startswith('AC  '):
            m = re.match('AC\s+(\S+)', line)
            if m:
                accession = m.group(1)
            else:
                raise Exception("ERROR: Unexpected format of AC line in file {0}".format(filename))
        elif line.startswith('EC  '):
            m = re.match('EC  (.+)', line)
            if m:
                for ec in m.group(1).split(' '):
                    ec_numbers.append(ec)
            else:
                raise Exception("ERROR: Unexpected format of EC line in file {0}".format(filename))
        elif line.startswith('GS  '):
            m = re.match('GS\s+(\S+)', line)
            if m:
                gene_symbol = m.group(1)
            else:
                raise Exception("ERROR: Unexpected format of GS line in file {0}".format(filename))
    #print("File: {0}\n\taccession: {1}\n\tgene_symbol: {2}\n\tec_numbers: {3}".format(filename, accession, gene_symbol, ec_numbers))
    if accession in id_cache:
        if gene_symbol is not None:
            curs.execute("""UPDATE hmm SET gene_symbol = ? WHERE accession = ?""", (gene_symbol, accession) )
        for ec_number in ec_numbers:
            #print("INFO: Inserting into hmm_ec: {0}, {1}".format(id_cache[accession], ec_number))
            curs.execute("""INSERT INTO hmm_ec (hmm_id, ec_id) VALUES (?, ?)""", (id_cache[accession], ec_number) )