Skip to content

Key MNV codon corrections by allele, not position - #29

Merged
jpalmer37 merged 1 commit into
mainfrom
bug/fix-mnv-codon-keying
Oct 20, 2026
Merged

jpalmer37 merged 1 commit into
mainfrom
bug/fix-mnv-codon-keying

Conversation

@jpalmer37

Copy link
Copy Markdown
Collaborator

fix_mnv_codons.py joined its two passes on (chrom, pos), so a deletion anchored on a corrected SNV, or a second allele at that position, had its HGVS.p overwritten with the codon correction and was tagged MNV_CORRECTED (or MNV_UNRESOLVED). Both passes now key on (chrom, pos, ref, alt). Affects PAFTOOLS and SHORT_READ; NEXTCLADE does not use this script.

New tests/test_fix_mnv_codons.py covers the corrected SNVs, a deletion and a minor allele at a corrected position, and an unresolved group. The last three fail on main.

Real data: main and this branch give identical output on 152 PAFTOOLS VCFs (14,852 records, 472 MNV-corrected) and 208 SHORT_READ __anno.vcf (21,433 records). None of those files has an indel or second allele at a corrected position, so the bug has not fired in data on hand; this is a latent fix.

🤖 Generated with Claude Code

https://claude.ai/code/session_01A64XHGNZMSco3L8CbejfVw

A deletion or second allele sharing a POS with a corrected SNV inherited
its codon correction or MNV_UNRESOLVED flag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A64XHGNZMSco3L8CbejfVw
@jpalmer37
jpalmer37 marked this pull request as ready for review October 20, 2026 17:50
@jpalmer37
jpalmer37 merged commit d0f3b0e into main Oct 20, 2026
1 check failed
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