def count_ref_alleles(variant, *traits):
    """Count reference allels for a variant
    
    Parameters
    ----------
    variant : a Variant as from funcgenom
        the variant for which alleles should be counted
    *traits : str
        the traits for which alleles should be counted
    

    Returns
    -------
    int
        the reference allele count
    """

    return (
        ''.join(variant.traits[trait]['alleles'] for trait in traits)
        .replace(',', '.')
        .count('.')
    )