def get_vaf_pos(VCF):
    """ Obtains position in VCF format/genotype fields of VAF

        VCF: path to input VCF

        Return value: None if VCF does not contain VAF,
                        otherwise position of VAF
    """
    vaf_check = False
    vaf_pos = None
    field = None
    with open(VCF) as f:
        for line in f:
            if line[0] == '#':
                if 'ID=AF' in line:
                    vaf_check = True
                    field = 'AF'
                elif 'ID=FREQ' in line:
                    vaf_check = True
                    field = 'FREQ'
                elif 'ID=FA' in line:
                    vaf_check = True
                    field = 'FA'
            elif vaf_check:
                tokens = line.strip('\n').split('\t')
                format_field = tokens[8].split(':')
                for i in range(0, len(format_field)):
                    if format_field[i] == field:
                        vaf_pos = i
                        break
    return vaf_pos, field
