def compute_hp(block):
    """
    Compute the H_p
    """
    header = block.pop(0).split(" ")[0]
    header = header[1:]  # Trim the >
    header = header.split(":")
    chromosome, position = header[0:2]
    sum_major = 0
    sum_minor = 0

    for line in block:

        if not line:
            break

        line = line.strip().split("\t")
        genotypes = map(int, line[4:8])
        genotypes = sorted(genotypes, reverse=True)
        major, minor, *_ = genotypes
        sum_major += major
        sum_minor += minor

    pooledh = "NA"

    if sum_major > 0 and sum_minor > 0:
        pooledh = 2 * sum_major * sum_minor / (sum_major + sum_minor)**2

    result_string = f"{chromosome}\t{position}\t{pooledh}\n"

    return result_string