def read_gene2acc(file_path, logger):
gene2acc = {}<EOL>with misc.smart_open_read(file_path, mode='<STR_LIT:rb>', try_gzip=True) as fh:<EOL><INDENT>reader = csv.reader(fh, dialect='<STR_LIT>')<EOL>next(reader)  <EOL>for i, l in enumerate(reader):<EOL><INDENT>id_ = int(l[<NUM_LIT:1>])<EOL>symbol = l[<NUM_LIT:15>]<EOL>try:<EOL><INDENT>gene2acc[id_].append(symbol)<EOL><DEDENT>except KeyError:<EOL><INDENT>gene2acc[id_] = [symbol]<EOL><DEDENT><DEDENT><DEDENT>n = len(gene2acc)<EOL>for k, v in gene2acc.items():<EOL><INDENT>symbols = sorted(set(v))<EOL>assert len(symbols) == <NUM_LIT:1><EOL>gene2acc[k] = symbols[<NUM_LIT:0>]<EOL><DEDENT>all_symbols = sorted(set(gene2acc.values()))<EOL>m = len(all_symbols)<EOL>logger.info('<STR_LIT>',<EOL>n, m)<EOL>return gene2acc<EOL>
Extracts Entrez ID -> gene symbol mapping from gene2accession.gz file.

    Parameters
    ----------
    file_path: str
        The path of the gene2accession.gz file (or a filtered version thereof).
        The file may be gzip'ed.

    Returns
    -------
    dict
        A mapping of Entrez IDs to gene symbols.