Repository navigation
Stop adapter readthrough from repeating the adapter (#865) - #866
Merged
Merged
Conversation
append_adapter_readthrough sourced adapter bases as adapter[i % adapter.len()], so any read whose tail was longer than the adapter looped back into a second copy of it. Same defect as ncsa/NEAT#344. Presets are now the whole construct a read runs through: stem, a placeholder index, then P7 (read 1) or P5 (read 2), same sequences as NEAT#345. Past the construct the read is filled per the new adapters.overrun key: polyg (default, two-color no-signal) or random (four-color). Fill bases take quality scores and soft clips but no substitution errors. Custom adapters are used as given. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 30, 2026
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.
Closes #865. Same defect as ncsa/NEAT#344; this ports ncsa/NEAT#345.
Problem
append_adapter_readthroughfilled a short-insert read's tail withadapter[i % adapter.len()]. A tail longer than the 33 bp TruSeq or 19 bp Nextera stem looped back into a second copy of it. On the new integration fixture (150 bp reads, ~40 bp inserts) with the cyclic code put back, 2527 of 2630 reads carried the stem more than once. No molecule has that sequence.Adapters are off by default, so default runs were never affected.
Change
ATCACG.GCGATCTA.adapters.overrunkey,polyg(default) orrandom. It sets what fills a read past the end of the construct.adaptersblock.Semver: a new config key means a MINOR bump. Seeded adapter runs whose tails pass the stem will produce different sequence, which is the fix. Reads whose tail ends inside the stem keep the same sequence and rng draws; the unit test asserts
polygandrandomagree there.Evidence
Unit tests (
fastq_tools.rs):randomfill comes out within 0.22–0.28 for each base, and does not reproduce the adapter.Integration test (
tests/adapter_readthrough_sequence.rs, H1N1, 30x, 2×150, inserts 40 ± 5):polyg.random.Mutation checks (each confirmed applied;
fastq_tools.rsrestored and verified with cmp):i % adapter.len()randomreturns GThe workspace suite, clippy
-D warningsand fmt all pass locally.Not verified
--trim_poly_gand cutadapt are the obvious checks.ADAPTERS=truseqshould have unchanged clip lengths, because the aligner clips everything past the insert either way. That is reasoning, not a measurement.🤖 Generated with Claude Code