Release 4.5.3 - #310
Merged
Merged
Conversation
joshfactorial
commented
Jun 8, 2026
Collaborator
- Handle IUPAC ambiguity codes in the reference (Deal with difficulties hg38 #291)
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)
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.