def parse_gene_id(gene_id):
    """Extracts contig identifier and function identifier from gene identifier"""
    (function_id, gene) = gene_id.split('|')
    gene_id_tokens = gene.split('_')
    gene_id = gene_id_tokens[-1]
    contig_id = '_'.join(gene_id_tokens[:-1])
    return function_id, contig_id, gene_id