def frequencies(variant_obj):
    """Add frequencies in the correct way for the template

    This function converts the raw annotations to something better to visualize.
    GnomAD is mandatory and will always be shown.

    Args:
        variant_obj(scout.models.Variant)

    Returns:
        frequencies(list(tuple)): A list of frequencies to display
    """
    if variant_obj["category"] == "sv":
        freqs = {
            "gnomad_frequency": {"display_name": "GnomAD", "link": None},
            "clingen_cgh_benign": {
                "display_name": "ClinGen CGH (benign)",
                "link": None,
            },
            "clingen_cgh_pathogenic": {
                "display_name": "ClinGen CGH (pathogenic)",
                "link": None,
            },
            "clingen_ngi": {"display_name": "ClinGen NGI", "link": None},
            "clingen_mip": {"display_name": "ClinGen MIP", "link": None},
            "swegen": {"display_name": "SweGen", "link": None},
            "decipher": {"display_name": "Decipher", "link": None},
            "thousand_genomes_frequency": {"display_name": "1000G", "link": None},
            "thousand_genomes_frequency_left": {
                "display_name": "1000G(left)",
                "link": None,
            },
            "thousand_genomes_frequency_right": {
                "display_name": "1000G(right)",
                "link": None,
            },
        }
    else:
        freqs = {
            "gnomad_frequency": {
                "display_name": "GnomAD",
                "link": variant_obj.get("gnomad_link"),
            },
            "thousand_genomes_frequency": {
                "display_name": "1000G",
                "link": variant_obj.get("thousandg_link"),
            },
            "max_thousand_genomes_frequency": {
                "display_name": "1000G(max)",
                "link": variant_obj.get("thousandg_link"),
            },
            "exac_frequency": {
                "display_name": "ExAC",
                "link": variant_obj.get("exac_link"),
            },
            "max_exac_frequency": {
                "display_name": "ExAC(max)",
                "link": variant_obj.get("exac_link"),
            },
        }

    frequency_list = []
    for freq_key in freqs:
        display_name = freqs[freq_key]["display_name"]
        value = variant_obj.get(freq_key)
        link = freqs[freq_key]["link"]
        # Allways add gnomad
        if freq_key == "gnomad_frequency":
            # If gnomad not found search for exac
            if not value:
                value = variant_obj.get("exac_frequency")
            value = value or "NA"
            frequency_list.append((display_name, value, link))
            continue
        if value:
            frequency_list.append((display_name, value, link))

    return frequency_list