def generate_hgnc(genes):
LOG.info("<STR_LIT>")<EOL>hgnc_gene_lines = fetch_hgnc() <EOL>header = None<EOL>genes_found = <NUM_LIT:0><EOL>for i,line in enumerate(hgnc_gene_lines):<EOL><INDENT>line = line.rstrip()<EOL>if not len(line) > <NUM_LIT:0>:<EOL><INDENT>continue<EOL><DEDENT>if i == <NUM_LIT:0>:<EOL><INDENT>header = line.split('<STR_LIT:\t>')<EOL>yield line<EOL>continue<EOL><DEDENT>gene = parse_hgnc_line(line, header)<EOL>if not gene:<EOL><INDENT>continue<EOL><DEDENT>hgnc_id = int(gene['<STR_LIT>'])<EOL>if hgnc_id in genes:<EOL><INDENT>genes_found += <NUM_LIT:1><EOL>yield line<EOL><DEDENT><DEDENT>LOG.info("<STR_LIT>", genes_found)<EOL>
Generate lines from a file with reduced hgnc information

    Args:
        genes(dict): A dictionary with hgnc_id as key and hgnc_symbol as value
        outpath(str): Defaults to hgnc_reduced_path

    Yields:
        print_line(str): Lines from the reduced file