<commit_before>
def parse_frequencies(variant):
    """Add the frequencies to a variant

        Args:
            variant(dict): A parsed vcf variant

        Returns:
            frequencies(dict): A dictionary with the relevant frequencies
    """
    frequencies = {}
    frequencies['thousand_g'] = parse_frequency(variant, '1000GAF')
    frequencies['thousand_g_max'] = parse_frequency(variant, '1000G_MAX_AF')
    frequencies['exac'] = parse_frequency(variant, 'EXACAF')
    frequencies['exac_max'] = parse_frequency(variant, 'ExAC_MAX_AF')

    return frequencies


def parse_frequency(variant, info_key):
    """Parse the thousand genomes frequency"""
    raw_annotation = variant['info_dict'].get(info_key)
    raw_annotation = None if raw_annotation == '.' else raw_annotation
    frequency = float(raw_annotation[0]) if raw_annotation else None
    return frequency
<commit_msg>parse left/right freqs<commit_after>
def parse_frequencies(variant):
    """Add the frequencies to a variant

        Args:
            variant(dict): A parsed vcf variant

        Returns:
            frequencies(dict): A dictionary with the relevant frequencies
    """
    frequencies = {}
    frequencies['thousand_g'] = parse_frequency(variant, '1000GAF')
    frequencies['thousand_g_left'] parse_frequency(variant, 'left_1000GAF')
    frequencies['thousand_g_right'] parse_frequency(variant, 'right_1000GAF')
    frequencies['thousand_g_max'] = parse_frequency(variant, '1000G_MAX_AF')
    frequencies['exac'] = parse_frequency(variant, 'EXACAF')
    frequencies['exac_max'] = parse_frequency(variant, 'ExAC_MAX_AF')

    return frequencies


def parse_frequency(variant, info_key):
    """Parse the thousand genomes frequency"""
    raw_annotation = variant['info_dict'].get(info_key)
    raw_annotation = None if raw_annotation == '.' else raw_annotation
    frequency = float(raw_annotation[0]) if raw_annotation else None
    return frequency

{'fraction_non_alphanumeric': 0.1044776119402985, 'fraction_numerical': 0.013381369016984045, 'mean_word_length': 4.34065934065934, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4087212', 'n_tokens_mistral': 571, 'n_tokens_neox': 563, 'n_words': 132}