Skip to content

Commit

Permalink
refact(mi): use inheritance configs for some MI logic
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed Oct 17, 2024
1 parent e59b87d commit 8e89117
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions strkit/mi/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,16 +234,8 @@ def _respects_decimal_ci(self, c_gt, m_gt, f_gt) -> bool:
t = self._decimal_threshold

return any((
# First hypothesis: first allele from mother, second from father
abs(c_gt[0] - m_gt[0]) < t and abs(c_gt[1] - f_gt[0]) < t,
abs(c_gt[0] - m_gt[0]) < t and abs(c_gt[1] - f_gt[1]) < t,
abs(c_gt[0] - m_gt[1]) < t and abs(c_gt[1] - f_gt[0]) < t,
abs(c_gt[0] - m_gt[1]) < t and abs(c_gt[1] - f_gt[1]) < t,

abs(c_gt[1] - m_gt[0]) < t and abs(c_gt[0] - f_gt[0]) < t,
abs(c_gt[1] - m_gt[0]) < t and abs(c_gt[0] - f_gt[1]) < t,
abs(c_gt[1] - m_gt[1]) < t and abs(c_gt[0] - f_gt[0]) < t,
abs(c_gt[1] - m_gt[1]) < t and abs(c_gt[0] - f_gt[1]) < t,
abs(c_gt[ic[0]] - m_gt[ic[2]]) < t and abs(c_gt[ic[1]] - f_gt[ic[3]]) < t
for ic in INHERITANCE_CONFIGS
))

def _respects_mi_ci(self, c_gt_ci, m_gt_ci, f_gt_ci, widen: float) -> Optional[bool]:
Expand Down

0 comments on commit 8e89117

Please sign in to comment.