Skip to content

Solving VCF-related issues.#267

Merged
joshfactorial merged 1 commit into
developfrom
vcf-fixes
Apr 27, 2026
Merged

Solving VCF-related issues.#267
joshfactorial merged 1 commit into
developfrom
vcf-fixes

Conversation

@keshav-gandhi
Copy link
Copy Markdown
Collaborator

Fixes and tests for issues #256 and #266.

@joshfactorial joshfactorial merged commit 342356c into develop Apr 27, 2026
1 check passed
@joshfactorial joshfactorial deleted the vcf-fixes branch April 27, 2026 04:49
joshfactorial added a commit that referenced this pull request May 3, 2026
…pend

sample_trinucs returns the center (mutated) position, but the trinuc slice
was starting at that position rather than one before it, so trinuc[1] was
the 3' context base instead of the ref base. generate_snv uses trinuc[1] as
the ref base for transition-matrix lookup and REF==ALT zeroing, so the wrong
base was being consulted — Keshav's zeroing fix in #267 only worked when
reference[pos] == reference[pos+1].

Fix: shift the slice to reference[local_location-1: local_location+2] so
trinuc[0]=5' flank, trinuc[1]=ref base, trinuc[2]=3' flank.

Also remove the dead self.all_ins.append(temp_snv) in generate_snv; SNVs
were being accumulated in MutationModel.all_ins (a list that is never read)
rather than nowhere, a copy-paste artifact from generate_deletion.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
joshfactorial added a commit that referenced this pull request May 3, 2026
…pend

sample_trinucs returns the center (mutated) position, but the trinuc slice
was starting at that position rather than one before it, so trinuc[1] was
the 3' context base instead of the ref base. generate_snv uses trinuc[1] as
the ref base for transition-matrix lookup and REF==ALT zeroing, so the wrong
base was being consulted — Keshav's zeroing fix in #267 only worked when
reference[pos] == reference[pos+1].

Fix: shift the slice to reference[local_location-1: local_location+2] so
trinuc[0]=5' flank, trinuc[1]=ref base, trinuc[2]=3' flank.

Also remove the dead self.all_ins.append(temp_snv) in generate_snv; SNVs
were being accumulated in MutationModel.all_ins (a list that is never read)
rather than nowhere, a copy-paste artifact from generate_deletion.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

2 participants