Fix csq consequence prediction: sref offset, OOB codon, stop codon, splice#2527
Open
sirus20x6 wants to merge 3 commits intosamtools:developfrom
Open
Fix csq consequence prediction: sref offset, OOB codon, stop codon, splice#2527sirus20x6 wants to merge 3 commits intosamtools:developfrom
sirus20x6 wants to merge 3 commits intosamtools:developfrom
Conversation
When a reverse-strand compound variant has ibeg forced to HAP_SSS (due to frameshift + start_lost), csq->pos was set from ref_node (=iend) but csq_push was called with ibeg's record. Since they are at different genomic positions, the vbuf lookup at iend's position could not find ibeg's record, triggering: "This should not happen.. <chr>:<pos> <variant>" Fix by setting csq->pos to ibeg's position in the SSS branch so the position and record are consistent for the vbuf lookup.
1. tscript_splice_ref: Fix trailing pad copy offset to start after the last CDS exon (was incorrectly copying from the beginning of it). 2. dna2aa/cdna2aa/dna2stop/cdna2stop macros: Guard against out-of-bounds access when non-ACGT bases (e.g. 'N') produce codon indices > 63. Return 'X' (unknown amino acid) or 0 (not a stop) instead. 3. hap_add_csq and test_cds_local: After searching tseq_stop for '*', compare the found index against tseq_stop.l (not tseq.l), matching the string that was actually iterated. 4. test_splice: Use loop variable rec->d.allele[i] instead of hardcoded rec->d.allele[1] when checking for symbolic/missing alleles.
This was referenced Mar 26, 2026
d1f8563 to
a799875
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tseq.linstead oftseq_stop.l(2 occurrences)test_splicechecking hardcodedallele[1]instead of loop variableallele[i]Fixes #2478. Relates to #2393.
Test plan