I believe youāre referring to this:
mt = mt.annotate_entries(is_untransmitted=
hl.all(
hl.any(
hl.all(mt.father_entry.GT.is_hom_ref(),
~mt.mother_entry.GT.is_hom_ref()),
hl.all(~mt.father_entry.GT.is_hom_ref(),
mt.mother_entry.GT.is_hom_ref())
),
mt.proband_entry.GT.is_hom_ref()
)
)
If the proband is homozygous reference and the parents are both heterozygous, then that entry will have is_untransmitted=False
.
FWIW, if you want to consider this case, Iād probably do it in pieces. I find this a bit easier to reason about when Iām coming into new code or coming back to code I wrote a while ago.
mt = mt.annotate_entries(
kid_hom_one_parent_hom=...
kid_hom_both_parents_het=hl.all(
mt.father_entry.GT.is_het(),
mt.mother_entry.GT.is_het(),
hl.any(
mt.proband_entry.GT.is_hom_ref(),
mt.proband_entry.GT.is_hom_alt()))
...
)
mt = mt.annotate_entries(
is_untransmitted = hl.any(
mt.kid_hom_one_parent_hom,
mt.kid_hom_both_parents_het,
...
)
For future readers with slightly different expressions, hereās how I would confirm this for myself by evaluating it step-wise. The parents are both heterozygous so is_hom_ref()
will return false:
hl.all(
hl.any(
hl.all(False,
~False),
hl.all(~False,
False)
),
mt.proband_entry.GT.is_hom_ref()
)
hl.all
is like hl.and
: if even one value is False, it is False:
hl.all(
hl.any(False, False),
mt.proband_entry.GT.is_hom_ref()
)
Likewise, any
is like or
it needs at least one True to be True:
hl.all(
False,
mt.proband_entry.GT.is_hom_ref()
)
And, again, this resolves to False.