Skip to content

Release 4.5.3 - #310

Merged
joshfactorial merged 4 commits into
mainfrom
develop
Jun 8, 2026
Merged

Release 4.5.3#310
joshfactorial merged 4 commits into
mainfrom
develop

Conversation

@joshfactorial

Copy link
Copy Markdown
Collaborator

joshfactorial and others added 4 commits June 8, 2026 16:50
GRCh38 and other assemblies carry IUPAC ambiguity codes (R, Y, S, W, K,
M, B, D, H, V). NEAT previously had no handling for them:
- they survived reference load (convert_masking only neutralized non-ACGT
  bases when an N was also present in the segment, and skipped bases
  before the first N), and
- a surviving code at a sequencing-error site hit NUC_IND[base] and
  raised KeyError, crashing the run.

Fix: resolve ambiguity codes to a concrete base at reference load.
- common: add IUPAC_CODES map + resolve_iupac_bases(), which replaces
  each code with one of the bases it represents using the run's seeded
  RNG (reproducible). Vectorized; the no-codes common case is a single
  scan, so genome-scale references aren't penalized. 'N' is left for its
  existing low-quality masking.
- split_inputs: resolve right after the existing upper(), so every
  downstream consumer (reads, BAM, golden VCF, error/trinucleotide
  lookups) only ever sees A/C/G/T/N. Logs a warning with the count.
- error_models: defense-in-depth — NUC_IND lookup now skips a non-ACGT
  base instead of raising, so nothing can crash even if a code slips
  through.

Tests: resolver unit tests (every code, counts, reproducibility, N left
alone, length preserved) and an end-to-end runner test on a reference
containing all ten codes plus an N run, asserting FASTQ output is clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Bump version to 4.5.3 and add the ChangeLog entry for the IUPAC
ambiguity-code handling fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Handle IUPAC ambiguity codes in the reference (#291)
@joshfactorial
joshfactorial merged commit 2545201 into main Jun 8, 2026
2 checks passed
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