Skip to content

Fix wrong loop variable in family trio sample remapping#2518

Open
sirus20x6 wants to merge 1 commit intosamtools:developfrom
sirus20x6:fix/vcfcall-family-index
Open

Fix wrong loop variable in family trio sample remapping#2518
sirus20x6 wants to merge 1 commit intosamtools:developfrom
sirus20x6:fix/vcfcall-family-index

Conversation

@sirus20x6
Copy link
Copy Markdown

Summary

  • Fix use of outer loop variable i instead of inner loop variable j when remapping family trio sample indices in vcfcall.c
  • The inner loop iterates j=0..2 (CHILD, FATHER, MOTHER) but indexed fam->sample[i] instead of fam->sample[j], corrupting family data and causing out-of-bounds access when i >= 3

Test plan

  • Existing test suite passes (1920/1920)
  • Verify trio calling with -G option produces correct family genotype constraints

In the family trio remapping loop, the inner loop iterates with `j`
(0,1,2 for CHILD,FATHER,MOTHER) but fam->sample was indexed by `i`
(the outer family loop variable) instead of `j`. This caused only the
i-th sample slot to be remapped repeatedly, leaving the other two
family members with stale indices.
@sirus20x6 sirus20x6 force-pushed the fix/vcfcall-family-index branch from b15b3bd to 24ce856 Compare March 26, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant