def mendelian_check(tp1, tp2, tpp, is_xlinked=False):
    """
    Compare TRED calls for Parent1, Parent2 and Proband.
    """
    call_to_ints = lambda x: tuple(int(_) for _ in x.split("|") if _ != ".")
    tp1_sex, tp1_call = tp1[:2]
    tp2_sex, tp2_call = tp2[:2]
    tpp_sex, tpp_call = tpp[:2]
    # tp1_evidence = sum(int(x) for x in tp1[2:])
    # tp2_evidence = sum(int(x) for x in tp2[2:])
    # tpp_evidence = sum(int(x) for x in tpp[2:])
    tp1_call = call_to_ints(tp1_call)
    tp2_call = call_to_ints(tp2_call)
    tpp_call = call_to_ints(tpp_call)
    possible_progenies = set(tuple(sorted(x)) \
                    for x in product(tp1_call, tp2_call))
    if is_xlinked and tpp_sex == "Male":
        possible_progenies = set(tuple((x,)) for x in tp1_call)
    if -1 in tp1_call or -1 in tp2_call or -1 in tpp_call:
        tag = "Missing"
    # elif tp1_evidence < 2 or tp2_evidence < 2 or tpp_evidence < 2:
    #    tag = "Missing"
    else:
        tag = "Correct" if tpp_call in possible_progenies else "Error"
    return tag
Compare TRED calls for Parent1, Parent2 and Proband.