def alleles_supported(record, sample_pos, n, include_ref = True):
    """Return alleles supported by at least n reads
    Args:
        record (pyvcf record object)
        sample_pos (int): position of the desired sample in the vcf (0-based)
        n (int): return allele if it is supported by at least n reads
        include_ref (bool): if True, return the reference allele if it is supported by n reads
    Returns:
        list of numeric positions of alleles that are supported by at least n reads (strings)
        i.e. ref = '0', first nonref = '1'
    """
    # Get numeric representation of the alleles i.e. ref = 0, first alt = 1
    all_alleles = [str(x) for x in range(len(record.alleles))]
    allelic_depths = record.samples[sample_pos]['AD']
    if not include_ref:
        all_alleles = all_alleles[1:]
        allelic_depths = allelic_depths[1:]
    supported_alleles = [all_alleles[i] for i in range(len(all_alleles)) if allelic_depths[i] >= n]
    return(supported_alleles)