test: cover chrX haploid-male counting and MNV overlap branches#95
Conversation
|
Warning Review limit reached
More reviews will be available in 1 minute and 42 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Extract _haploid_adjusted_call from compute_haplotypes and unit-test that a chrX non-PAR male alt-carrier contributes a single allele to call_stats (AN), while females and autosome calls stay diploid (#78). - Log the collected variant count in _compute_locus_groups so a driver-memory spike at that collect/broadcast is attributable in the logs (#77). - Cover the MNV classify_pair branches (same_position_other, other_overlap), and unify the haplo_coordinates sort key with get_haplo_sequence's to remove the latent divergence (#83). Closes #77 Closes #78 Closes #83 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
7a09a0c to
12c7d19
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
Test coverage and observability for the haplotype core, plus a small readability fix. No behavior change (the
_haploid_adjusted_callextraction and thehaplo_coordinatessort-key unification are both behavior-preserving).Changes
#78 — chrX haploid-male test. Extracted the inline chrX non-PAR haploid adjustment into
_haploid_adjusted_call(locus, gt, sex_karyotype)(the subtlest correctness logic incompute_haplotypes, previously only guarded by opaque end-to-end counts). Added a focused test on a 2×2 synthetic MatrixTable: a chrX non-PAR male alt-carrier contributes one allele tocall_stats(AN 3 = male haploid + female diploid), while the autosome locus stays diploid (AN 4).#77 — observability.
_compute_locus_groupsnow logs the number of variants it collects to the driver, so a memory spike at that (currently un-mitigated) collect +hl.literalbroadcast is attributable — matching the existingattach_component_info/containment_dedupcollect-site logs.#83 — nits.
classify_pairbranches (same_position_other,other_overlap) to the parametrized table.haplo_coordinates's sort key withget_haplo_sequence's(position, len(ref))(only the minimum position is read, and_max_reference_endis order-independent, so this is behavior-preserving) and added a comment noting the two must stay in lockstep.Verification
uv run --directory divref poe fix-and-check-all— 184 passed; ruff (check + format) and mypy clean.Closes #77
Closes #78
Closes #83
🤖 Generated with Claude Code