def gene(result):
    """
    Convert the gene name into a standarized format.
    """

    if result["database"] == "ENSEMBL":
        return result["optional_id"]

    if result["rna_type"] == "piRNA" and result["database"] == "ENA":
        return result["product"]

    name = result["gene"] or ""
    name = name.replace("\t", " ")
    return name