Parse the input phlat file to pull out the alleles it contains
    :param phlatfile: Open file descriptor for a phlat output sum file
    :param mhc_alleles: dictionary of alleles.

def parse_phlat_file(phlatfile, mhc_alleles):
    """
    Parse the input phlat file to pull out the alleles it contains
    :param phlatfile: Open file descriptor for a phlat output sum file
    :param mhc_alleles: dictionary of alleles.
    """
    for line in phlatfile:
        if line.startswith('Locus'):
            continue
        line = line.strip().split()
        if line[0].startswith('HLA_D'):
            line[0] = line[0][:-1]  # strip the last character
        # Sometimes we get an error saying there was insufficient read
        # converage. We need to drop that line.
        # E.g. HLA_DQB1 no call due to insufficient reads at this locus
        if line[1] == 'no':
            continue
        if line[4] != 'NA':
            split_field = line[1].split(':')
            if len(split_field) >= 2 and not split_field[1] == 'xx':
                mhc_alleles[line[0]].append((line[1], line[4]))
        if line[5] != 'NA':
            split_field = line[2].split(':')
            if len(split_field) >= 2 and not split_field[1] == 'xx':
                mhc_alleles[line[0]].append((line[2], line[5]))
    return mhc_alleles