def calcuInbreedCoeff(gt):
    """
    Calculating the inbreeding coefficient by GT fields of VCF.

    Args:
        `gt`: A list. Genotype fields of all the samples.
    """
    ref_count, het_count, hom_count, n = 0, 0, 0, 0
    for g in gt:
        gs = g.split('/') if '/' in g else g.split('|')
        if '.' not in g:
            n += 1
        if '.' in g:
            pass
        elif g == '0/0' or g == '0|0':
            ref_count += 1
        elif gs[0] == gs[1]:
            hom_count += 1
        else:
            het_count += 1
    if n == 0:
        n = 1
    p = (2.0 * ref_count + het_count) / (2.0 * n)
    q = 1.0 - p
    expected_het_count = 2.0 * p * q * n if p * q > 0 else 1
    inbf = 1.0 - het_count / expected_het_count
    return inbf
