Skip to content

fix: DBS across codon boundary correctly classified as nonsense (#84)#96

Open
jmg421 wants to merge 3 commits into
Bioconductor:develfrom
jmg421:fix/84-dbs-nonsense
Open

fix: DBS across codon boundary correctly classified as nonsense (#84)#96
jmg421 wants to merge 3 commits into
Bioconductor:develfrom
jmg421:fix/84-dbs-nonsense

Conversation

@jmg421

@jmg421 jmg421 commented Jun 30, 2026

Copy link
Copy Markdown

Summary

A dinucleotide base substitution (DBS) that spans a codon boundary and produces a stop codon in one of the two resulting amino acids was misclassified as nonsynonymous instead of nonsense.

Example from the issue: GG→AA on the - strand produces VARAA='P*' (proline + stop), but was reported as nonsynonymous because the check only matched when VARAA was exactly '*'.

Root Cause

Line 184 of methods-predictCoding.R:

consequence[nonsynonymous & (as.character(varAA) %in% "*")] <- "nonsense"

%in% "*" requires the entire string to equal *. For a DBS spanning two codons, varAA is two characters (e.g. P*), so the check fails.

Fix

consequence[nonsynonymous & grepl("*", as.character(varAA), fixed=TRUE)] <- "nonsense"

grepl detects a stop codon anywhere in the translated variant sequence. Any premature stop truncates the protein — it doesn't matter what precedes it.

Testing

Added test_predictCoding_dbs_nonsense verifying that:

  • P* → nonsense (stop after one residue)
  • * → nonsense (classic single-codon stop)
  • PQ → nonsynonymous (no stop)
  • *L → nonsense (stop at first position)

Fixes #84

vjcitn and others added 3 commits July 17, 2026 21:15
Convert \itemize blocks that used \item{label}{desc} syntax to \describe,
and replace empty \item{}{} labels in \describe blocks with the function
signature from the body, resolving all checkRd warnings in isSNV-methods,
PolyPhenDb-class, readVcf-methods, SIFTDb-class, summarizeVariants-methods,
VariantType-class, VCF-class, VcfFile-class, VCFHeader-class, VRanges-class,
and VRangesList-class Rd files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…onductor#84)

A dinucleotide base substitution (DBS) spanning a codon boundary that
produces a stop codon in one of the two affected amino acids (e.g.
VARAA='P*') was misclassified as 'nonsynonymous' instead of 'nonsense'.

Root cause: the nonsense check used `as.character(varAA) %in% "*"`
which only matches when the entire VARAA string is '*'. For multi-codon
DBS, VARAA is multi-character (e.g. 'P*') and the check fails.

Fix: use `grepl("*", ..., fixed=TRUE)` to detect stop codons anywhere
in the translated variant amino acid sequence. Any premature stop
truncates the protein regardless of flanking residues.

Fixes Bioconductor#84
@jmg421
jmg421 force-pushed the fix/84-dbs-nonsense branch from c8a9ee0 to 4b38629 Compare July 18, 2026 03:17
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.

nonsense mutations from DBS across two codons misclassified as nonsynonymous?

2 participants