def get_pileup_vect(alignments, contig, pos, ref, alt):
    'Create feature vector for selected variant\n\n     Args:\n        alignments(pysam.AlignmentFile) : Handle to alignmentfile\n        contig(str) : contig to perform pileup\n        pos(int) : zeros based position of variant to pileup\n        ref(str) : reference base\n        alt(str) : alternative base\n\n    Returns\n        total(int) : Total amount of bases overlapping with selected location\n        ref_calls  : Total amount of bases matching ref\n        alt_calls : Total amount of bases matching alt\n        other_calls : Total amount of bases matching neither ref nor alt\n    '
    total = 0
    ref_calls = 0
    alt_calls = 0
    other_calls = 0
    start = pos
    stop = (pos + 1)
    for pileupcolumn in pileup_truncated(alignments, contig, start, stop, stepper='all'):
        for (i, pileupread) in enumerate(pileupcolumn.pileups):
            if ((not pileupread.is_del) and (not pileupread.is_refskip)):
                call = pileupread.alignment.query_sequence[pileupread.query_position]
                if (call == ref):
                    ref_calls += 1
                elif (call == alt):
                    alt_calls += 1
                else:
                    other_calls += 1
                other_calls += 1
    return (total, ref_calls, alt_calls, other_calls)
Create feature vector for selected variant

 Args:
    alignments(pysam.AlignmentFile) : Handle to alignmentfile
    contig(str) : contig to perform pileup
    pos(int) : zeros based position of variant to pileup
    ref(str) : reference base
    alt(str) : alternative base

Returns
    total(int) : Total amount of bases overlapping with selected location
    ref_calls  : Total amount of bases matching ref
    alt_calls : Total amount of bases matching alt
    other_calls : Total amount of bases matching neither ref nor alt
def get_pileup_vect(alignments, contig, pos, ref, alt):
    'Create feature vector for selected variant\n\n     Args:\n        alignments(pysam.AlignmentFile) : Handle to alignmentfile\n        contig(str) : contig to perform pileup\n        pos(int) : zeros based position of variant to pileup\n        ref(str) : reference base\n        alt(str) : alternative base\n\n    Returns\n        total(int) : Total amount of bases overlapping with selected location\n        ref_calls  : Total amount of bases matching ref\n        alt_calls : Total amount of bases matching alt\n        other_calls : Total amount of bases matching neither ref nor alt\n    '
    total = 0
    ref_calls = 0
    alt_calls = 0
    other_calls = 0
    start = pos
    stop = (pos + 1)
    for pileupcolumn in pileup_truncated(alignments, contig, start, stop, stepper='all'):
        for (i, pileupread) in enumerate(pileupcolumn.pileups):
            if ((not pileupread.is_del) and (not pileupread.is_refskip)):
                call = pileupread.alignment.query_sequence[pileupread.query_position]
                if (call == ref):
                    ref_calls += 1
                elif (call == alt):
                    alt_calls += 1
                else:
                    other_calls += 1
                other_calls += 1
    return (total, ref_calls, alt_calls, other_calls)