Skip to content

Commit

Permalink
chore(mi): rounded allele length for TRGT
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed Nov 12, 2024
1 parent 2d671ae commit cdcd5b8
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions strkit/mi/trgt.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ def _parse_allele(a: Union[int, str, None]) -> int | None:
def _unzip_gt(
vals, motif_len: int
) -> Union[
tuple[tuple[float, ...], tuple[tuple[float, ...], tuple[float, ...]]],
tuple[tuple[int, ...], tuple[tuple[int, ...], tuple[int, ...]]],
tuple[tuple[None, None], tuple[None, None]],
]:
try:
return (
(
_parse_allele(vals[0][0]) / motif_len,
_parse_allele(vals[1][0]) / motif_len,
round(_parse_allele(vals[0][0]) / motif_len),
round(_parse_allele(vals[1][0]) / motif_len),
),
(
tuple(map(lambda x: x / motif_len, parse_ci(vals[0][1]))),
tuple(map(lambda x: x / motif_len, parse_ci(vals[1][1]))),
tuple(map(lambda x: round(x / motif_len), parse_ci(vals[0][1]))),
tuple(map(lambda x: round(x / motif_len), parse_ci(vals[1][1]))),
),
)
except (ValueError, TypeError):
Expand Down Expand Up @@ -101,8 +101,6 @@ def calculate_contig(self, contig: str) -> MIContigResult:

child_gt=c_gt, mother_gt=m_gt, father_gt=f_gt,
child_gt_95_ci=c_gt_95_ci, mother_gt_95_ci=m_gt_95_ci, father_gt_95_ci=f_gt_95_ci,

decimal=True,
))

return cr

0 comments on commit cdcd5b8

Please sign in to comment.