fix(dev): correct ITS primers to gITS7/ITS4; add the ITS case to the prep page - #116
Merged
Conversation
…prep page
dev/cutadapt_ITS.sh was a copy of the V3-V4 script with ITS1f/ITS2 pasted in on
the strength of the NCBI annotation ("Design: ITS1FI2-ITS2 (ITS2)"). Verified
against the reads, neither named primer is present:
R1 gITS7 GTGARTCATCGARTCTTTG 92.5%, offset 0, no pad
R2 ITS4 TCCTCCGCTTATTGATATGC 90.9%, offset 4 behind a constant GATA pad
ITS1F / ITS1FI2 / ITS1 / ITS1F_KYO2: 0%
As written the script would have stripped nothing. Corrected, it removes both
primers to 0.00% residual at 97.6% pair retention, leaving R1 median 231 nt
(250-19) and R2 226 nt (250-24) as expected.
gITS7+ITS4 amplifies the ITS2 region, so unlike the 16S arm the REGION label is
right and the PRIMER NAMES are wrong -- the inverse failure in the same deposit.
"ITS2" names both a region and a primer, and ITS1FI2 + the ITS2 primer would
amplify ITS1, so the annotation contradicts itself.
Two ITS-specific hazards now documented in the script's next-steps and on the
findings page: ITS length varies by hundreds of nt across taxa, so any
--trunc-len is a taxonomic filter rather than a quality one, and short amplicons
read through into the far primer so -a/-A are load-bearing. Also notes the
offsets here are constant (a fixed --trim-left would work), unlike the 16S arm --
spacer layout is a property of a prep, not a platform.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
dev/subsample_fastq.py rarefies a run to several fractions at once for depth-ladder experiments (how does inference move as coverage per variant falls?). seqkit is the preferred tool where available and the docstring says so -- `seqkit sample -p F -s SEED` was verified reproducible, pair-synced and nested across fractions at fixed seed. This script covers the two cases seqkit does not guarantee by construction: its nesting is emergent from per-record PRNG draws rather than documented, and its pair sync is positional so it desynchronises silently if a mate is reordered. Here the keep/drop decision is a hash of the read NAME, so nesting and pair safety hold by definition regardless of file order, and a mate mismatch is a hard error. Whole ladder in one decompression pass; realized counts to TSV. Also fixes a stale cutadapt_v3v4.sh usage string in cutadapt_ITS.sh. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
dev/cutadapt_ITS.shwas a copy of the V3–V4 script with ITS1f/ITS2 pasted in, taken on the strength of the NCBI annotationDesign: ITS1FI2-ITS2 (ITS2). Verified against the reads (two samples, 50k reads, 5' end), neither named primer is present:GTGARTCATCGARTCTTTGTCCTCCGCTTATTGATATGCGATApad)ITS86F is the non-degenerate form of gITS7 and matches only the subset where the degenerate base is A — confirmed by base composition at that position (53.4% A / 46.6% G, i.e. real degenerate synthesis).
As written the script would have stripped nothing. Corrected, it removes both primers to 0.00% residual at 97.6% pair retention, leaving R1 median 231 nt (250−19) and R2 226 nt (250−24), exactly as predicted.
The inverse failure
gITS7+ITS4 amplifies the ITS2 region, so here the region label is right and the primer names are wrong — the opposite of the 16S arm in the same deposit. The trap is that "ITS2" names both a region and a primer:
ITS1FI2+ theITS2primer would amplify ITS1, so the annotation contradicts its own region label. Reading either half as authoritative sends you somewhere different.Two ITS-specific hazards now documented
--trunc-lenis a taxonomic filter, not a quality one — it systematically deletes every fungus above the cutoff. Same asymmetry at the merge step: long-ITS taxa may fail to overlap and drop out, so an ITS merge rate is not taxonomically neutral the way a 16S one is.-a/-Aare load-bearing here rather than belt-and-braces.Neither hazard exists on a fixed-insert 16S amplicon, so 16S habits do not transfer.
Also worth noting: the offsets here are constant (R1 at 0, R2 at 4), so a fixed
--trim-leftwould work on this arm — unlike the 16S arm. Spacer layout is a property of a prep, not a platform, and has to be measured per dataset rather than assumed in either direction. The script's diagnostic now prints offset distributions for both primers and says which reading implies which.Adds a section to
docs/findings/reading-the-prep.mdrecording the ITS case as the second example.