def countAlleles(columns):
    """For each alt allele in the 5th column, keep a count of how many times that alt's index
    appears in the genotype columns, for the AC tag in the INFO field.  For the AN tag, tally up
    the genotype columns that don't have '.' (no call).  Return the total number of calls for AN
    and an array of alternate allele counts for AC.
    NOTE: this does not handle multiploid VCF where genotypes can be /- or |-separated."""
    totalCalls = 0
    alts = columns[4]
    altCounts = [ 0 for alt in alts.split(',')]
    for colVal in columns[9:]:
        subVals = colVal.split(':')
        gt = subVals[0]
        if (gt is not '.'):
            totalCalls += 1
            altIx = int(gt)-1
            if (altIx >= 0):
                altCounts[altIx] += 1
    return totalCalls, altCounts