[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EF5W4CY9RV78MS3WA2D4VM":3,"skill-same:01M7EF5W4CY9RV78MS3WA2D4VM":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7EF5W4CY9RV78MS3WA2D4VM","bio-read-qc-adapter-trimming",null,"Removes sequencing adapters from FASTQ reads with Cutadapt and Trimmomatic, including paired-end read-through, small-RNA 3' adapters, amplicon primers, and anchored\u002Flinked adapters. Use when FastQC shows adapter content climbing toward the 3' end, when inserts are shorter than the read length (small-RNA, cfDNA, FFPE), or before assembly\u002Fk-mer analysis. For all-in-one trimming use fastp-workflow; for quality\u002Flength filtering use quality-filtering.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-read-qc-adapter-trimming\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-read-qc-adapter-trimming\ndescription: Removes sequencing adapters from FASTQ reads with Cutadapt and Trimmomatic, including paired-end read-through, small-RNA 3' adapters, amplicon primers, and anchored\u002Flinked adapters. Use when FastQC shows adapter content climbing toward the 3' end, when inserts are shorter than the read length (small-RNA, cfDNA, FFPE), or before assembly\u002Fk-mer analysis. For all-in-one trimming use fastp-workflow; for quality\u002Flength filtering use quality-filtering.\ntool_type: cli\nprimary_tool: cutadapt\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"read-qc\u002Fadapter-trimming\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference examples tested with: Cutadapt 4.4+, Trimmomatic 0.39+, fastp 0.23+, FastQC 0.12+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- CLI: `\u003Ctool> --version` then `\u003Ctool> --help` to confirm flags\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# Adapter Trimming -- adapter content IS the insert-size distribution\n\nRemove adapter sequence that the polymerase read INTO once it ran off the end of a short insert, using Cutadapt (precise, the correctness reference) or Trimmomatic (palindrome mode for paired read-through).\n\n**\"Trim adapters from my reads\"** -> Detect and remove 3' adapter introduced by read-through, then length-filter the survivors.\n- CLI: `cutadapt -a AGATCGGAAGAGC -A AGATCGGAAGAGC -m 20 -o R1.fq -p R2.fq in_R1.fq in_R2.fq`\n- All-in-one alternative: `fastp` (PE overlap analysis needs no adapter sequence) -> read-qc\u002Ffastp-workflow\n\nScope: this skill OWNS adapter\u002Fprimer removal. Quality and length filtering -> read-qc\u002Fquality-filtering. Single-pass trim+QC -> read-qc\u002Ffastp-workflow. Contaminant\u002FPhiX k-mer removal -> read-qc\u002Fcontamination-screening. OUT OF SCOPE: quality-score trimming as a standalone goal (usually unnecessary before soft-clipping aligners; see insight 2).\n\n## The Single Most Important Modern Insight\n\n1. **Adapter appears only when the insert is shorter than the read, so adapter content is a direct readout of the insert-size distribution -- and adapter trimming is 3'-only for standard Illumina.** The library is `[P5]-[insert]-[P7]`; a read primes at the insert boundary and reads 5'->3' into the insert, running into the 3'\u002FP7-side adapter only if it runs out of insert. Short-insert libraries (small-RNA ~22 nt, cfDNA ~167 bp, FFPE, degraded RNA, ancient DNA) are read-through-dominated; long-insert WGS may show almost none. The FastQC adapter-content curve climbing toward the 3' end IS that insert-size signal.\n\n2. **Adapter trimming is the one near-universal preprocessing step; quality trimming usually is not.** Local aligners (BWA-MEM, STAR, Bowtie2 local, HISAT2) SOFT-CLIP low-quality tails, so quality trimming is redundant or harmful for alignment-based DNA\u002FRNA (MacManes 2014, Williams 2016; GATK discourages it before BQSR). But aligners do NOT reliably remove ADAPTER -- adapter is foreign sequence with genuine base quality, so the aligner may try to align it and anchor a wrong placement. Trim adapter; leave quality trimming to the cases that need it (assembly, k-mer\u002Fpseudo-alignment, small-RNA, amplicon, no-BQSR variant calling).\n\n3. **Small-RNA inverts the logic: the adapter is on EVERY read, so DISCARD reads with no adapter.** A ~22 nt miRNA insert is far shorter than a 50-75 nt read, so read-through is universal; a read with no detectable adapter is an adapter dimer, a too-long contaminant, or junk. Use `--discard-untrimmed` plus a tight length gate (`-m 18 -M 30`). This is the OPPOSITE of genomic DNA, where the no-adapter reads are the good full-length inserts.\n\nTwo-color trap: on NextSeq\u002FNovaSeq, a high-quality poly-G tail is NOT adapter and is not removed by adapter trimming -- it needs a chemistry-aware poly-G trim (`cutadapt --nextseq-trim=20`, or fastp's auto poly-G). See read-qc\u002Fquality-reports and read-qc\u002Ffastp-workflow.\n\n## Verified Adapter Sequences\n\n| Kit | Read | Sequence |\n|-----|------|----------|\n| Illumina TruSeq | R1 3' | AGATCGGAAGAGCACACGTCTGAACTCCAGTCA |\n| Illumina TruSeq | R2 3' | AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGT |\n| TruSeq (shared stem -- catches both) | -- | AGATCGGAAGAGC |\n| Nextera \u002F Tn5 | transposase | CTGTCTCTTATACACATCT |\n| TruSeq small-RNA | 3' | TGGAATTCTCGGGTGCCAAGG |\n\nThe R1 3' adapter is the reverse complement of the R2-side region; trimming the shared 13 bp stem `AGATCGGAAGAGC` on both mates catches TruSeq read-through.\n\n## Tool Taxonomy\n\n| Tool | Mechanism | When it wins |\n|------|-----------|--------------|\n| Cutadapt | Error-tolerant semiglobal alignment of a supplied adapter | PRECISION: small-RNA 3' adapter, amplicon\u002F16S primers, anchored\u002Flinked adapters, demultiplexing. The correctness reference. |\n| Trimmomatic | ILLUMINACLIP simple + palindrome modes; ordered step pipeline | Legacy\u002Freproducibility pipelines; palindrome PE read-through detection |\n| fastp | PE overlap analysis (no adapter sequence needed) + auto poly-G | DEFAULT general-purpose trim; one fast pass (route OUT -> fastp-workflow) |\n| Trim Galore | Cutadapt + FastQC wrapper with adapter auto-detect | Bisulfite\u002FRRBS (`--rrbs`), Bismark pipelines |\n| BBDuk | k-mer match against an adapter\u002Fcontaminant reference | Contaminant\u002FPhiX removal in the same pass (route OUT -> contamination-screening) |\n\n## Decision Tree by Scenario\n\n| Scenario | Use | Why |\n|----------|-----|-----|\n| General Illumina PE WGS\u002FWES\u002FRNA | fastp, or cutadapt with the TruSeq stem | Overlap analysis needs no sequence; cutadapt for explicit control |\n| Small-RNA \u002F miRNA | cutadapt `-a TGGAATTCTCGGGTGCCAAGG -m 18 -M 30 --discard-untrimmed` | Adapter on every read; gate length and drop no-adapter reads |\n| Amplicon \u002F 16S primers | cutadapt linked\u002Fanchored adapters | Primers are at fixed positions; needs precise placement |\n| PE read-through, no adapter sequence known | fastp overlap, or Trimmomatic palindrome | Both detect read-through from the R1\u002FR2 overlap |\n| Bisulfite \u002F RRBS | Trim Galore `--rrbs` | Handles MspI fill-in and Bismark conventions |\n| NextSeq\u002FNovaSeq with poly-G tails | fastp (auto) or cutadapt `--nextseq-trim` | Poly-G is high-Q; quality trim alone misses it |\n\nDefault when uncertain: fastp for bulk PE, cutadapt with the TruSeq stem for explicit single-tool control.\n\n## Cutadapt\n\nThe algorithm is semiglobal (overlap) alignment, so a partial 3' adapter at the read end is detected. Two defaults drive behavior: `-e` (error rate, default 0.1) is computed against the LENGTH OF THE MATCHED REGION, not the whole adapter (an 8 bp match with 1 error is rate 0.125 and is rejected at the default); `-O` (minimum overlap, default 3) costs only ~0.07 bases lost per read by chance.\n\n```bash\n# Single-end 3' adapter\ncutadapt -a AGATCGGAAGAGC -m 20 -o trimmed.fq.gz in.fq.gz\n\n# Paired-end TruSeq (shared stem on both mates); both reads of a pair are discarded together\ncutadapt -a AGATCGGAAGAGC -A AGATCGGAAGAGC -m 20:20 \\\n         -o R1.fq.gz -p R2.fq.gz in_R1.fq.gz in_R2.fq.gz\n\n# Small-RNA: adapter on every read -> discard untrimmed, gate length\ncutadapt -a TGGAATTCTCGGGTGCCAAGG -m 18 -M 30 --discard-untrimmed -j 8 \\\n         -o mirna.fq.gz raw.fq.gz\n\n# Amplicon: linked 5'...3' primers (anchor with ^ to require the 5' primer)\ncutadapt -g ^FWDPRIMER...REVPRIMER -o trimmed.fq.gz in.fq.gz\n\n# 2-color poly-G aware (treats G as low quality so high-Q poly-G is trimmed)\ncutadapt --nextseq-trim=20 -a AGATCGGAAGAGC -m 20 -o out.fq.gz in.fq.gz\n\n# Higher error tolerance \u002F longer required overlap when matches are missed \u002F spurious\ncutadapt -a ADAPTER -e 0.15 -O 5 -m 20 -o out.fq.gz in.fq.gz\n```\n\nKey flags: `-a\u002F-g\u002F-b` (3'\u002F5'\u002Fanywhere, R1), `-A\u002F-G\u002F-B` (R2), `-q` (quality trim, BWA running-sum, runs BEFORE adapter removal), `--pair-filter {any,both,first}` (default any), `--max-n`, `--action {trim,mask,lowercase,none}`. When a filtering option discards reads in PE mode, both files MUST be processed together or they fall out of sync.\n\n## Trimmomatic\n\n`ILLUMINACLIP:\u003Cadapters.fa>:\u003CseedMismatches>:\u003CpalindromeClip>:\u003CsimpleClip>:\u003CminAdapterLen>:\u003CkeepBothReads>`\n\n- seedMismatches: mismatches tolerated in the initial seed (commonly 2).\n- palindromeClip (~30): log-odds threshold for the PE palindrome alignment; ~30 needs ~50 matched bases.\n- simpleClip (~10): log-odds threshold for an adapter-vs-read match; ~10 needs ~16 bases.\n- keepBothReads: DEFAULT False -- after palindrome detects read-through, R2 is redundant (reverse complement of R1) and is DROPPED; set True if a downstream tool needs both mates.\n\nSIMPLE mode tests each adapter against each read. PALINDROME mode (PE-only) aligns R1+adapter against the reverse complement of R2+adapter, so it detects read-through even when only a few adapter bases remain or the adapter is entirely past the read end. Steps run in COMMAND-LINE ORDER; put ILLUMINACLIP first and MINLEN last so the length check reflects all prior trimming.\n\n```bash\n# Paired-end, palindrome-capable adapter file, MINLEN last\ntrimmomatic PE -phred33 -threads 8 \\\n    in_R1.fq.gz in_R2.fq.gz \\\n    R1_paired.fq.gz R1_unpaired.fq.gz R2_paired.fq.gz R2_unpaired.fq.gz \\\n    ILLUMINACLIP:TruSeq3-PE-2.fa:2:30:10:2:keepBothReads MINLEN:36\n\n# Built-in adapter files ship with the install\nls $CONDA_PREFIX\u002Fshare\u002Ftrimmomatic-*\u002Fadapters\u002F\n```\n\nPE mode emits FOUR files: paired (both mates survived) and unpaired\u002Forphan (mate dropped). Feed the paired files to the aligner; the orphans stay synchronized out of the way.\n\n## Common Errors\n\n| Symptom | Cause | Solution |\n|---------|-------|----------|\n| FastQC still shows adapter after trimming | Wrong adapter, too-low `-e`, or only partial stem used | Use the shared stem AGATCGGAAGAGC; raise `-e` to 0.15; BLAST the overrepresented sequence |\n| Reads truncated \u002F many lose a few bp | `-O` too low -> random 3-mer matches | Raise `-O` (e.g. 5); the default loses ~0.07 bp\u002Fread by chance |\n| Aligner reports R1\u002FR2 out of sync | Mates trimmed\u002Ffiltered independently | Process pairs together (cutadapt `-p`; Trimmomatic paired outputs) |\n| Small-RNA yields huge \"reads\" | Forgot `--discard-untrimmed` \u002F length gate | Add `--discard-untrimmed -m 18 -M 30` |\n| 3' G-content rise persists after trimming | 2-color poly-G is high-quality, not adapter | `cutadapt --nextseq-trim` or fastp auto poly-G |\n| Half of R2 disappears in Trimmomatic | keepBothReads default False drops redundant R2 | Add `keepBothReads` (True) if both mates are needed downstream |\n\n## References\n\nMartin M. 2011. Cutadapt removes adapter sequences from high-throughput sequencing reads. EMBnet.journal 17(1):10-12.\nBolger AM, Lohse M, Usadel B. 2014. Trimmomatic: a flexible trimmer for Illumina sequence data. Bioinformatics 30(15):2114-2120.\nMacManes MD. 2014. On the optimal trimming of high-throughput mRNA sequence data. Frontiers in Genetics 5:13.\nWilliams CR, Baccarella A, Parrish JZ, Kim CC. 2016. Trimming of sequence reads alters RNA-Seq gene expression estimates. BMC Bioinformatics 17:103.\nChen S, Zhou Y, Chen Y, Gu J. 2018. fastp: an ultra-fast all-in-one FASTQ preprocessor. Bioinformatics 34(17):i884-i890.\n\n## Related Skills\n\nread-qc\u002Fquality-reports - Read the adapter-content panel that triggers trimming\nread-qc\u002Fquality-filtering - Quality and length filtering after adapter removal\nread-qc\u002Ffastp-workflow - All-in-one adapter + quality trim with auto poly-G\nread-qc\u002Fcontamination-screening - k-mer removal of PhiX\u002Fvector\u002Fcontaminant sequence\nsmall-rna-seq\u002Fsmrna-preprocessing - Full small-RNA adapter + length workflow\nread-alignment\u002Fbwa-alignment - Soft-clipping aligner that handles low-quality tails without trimming\n","## Version Compatibility\n\nReference examples tested with: Cutadapt 4.4+, Trimmomatic 0.39+, fastp 0.23+, FastQC 0.12+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- CLI: `\u003Ctool> --version` then `\u003Ctool> --help` to confirm flags\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# Adapter Trimming -- adapter content IS the insert-size distribution\n\nRemove adapter sequence that the polymerase read INTO once it ran off the end of a short insert, using Cutadapt (precise, the correctness reference) or Trimmomatic (palindrome mode for paired read-through).\n\n**\"Trim adapters from my reads\"** -> Detect and remove 3' adapter introduced by read-through, then length-filter the survivors.\n- CLI: `cutadapt -a AGATCGGAAGAGC -A AGATCGGAAGAGC -m 20 -o R1.fq -p R2.fq in_R1.fq in_R2.fq`\n- All-in-one alternative: `fastp` (PE overlap analysis needs no adapter sequence) -> read-qc\u002Ffastp-workflow\n\nScope: this skill OWNS adapter\u002Fprimer removal. Quality and length filtering -> read-qc\u002Fquality-filtering. Single-pass trim+QC -> read-qc\u002Ffastp-workflow. Contaminant\u002FPhiX k-mer removal -> read-qc\u002Fcontamination-screening. OUT OF SCOPE: quality-score trimming as a standalone goal (usually unnecessary before soft-clipping aligners; see insight 2).\n\n## The Single Most Important Modern Insight\n\n1. **Adapter appears only when the insert is shorter than the read, so adapter content is a direct readout of the insert-size distribution -- and adapter trimming is 3'-only for standard Illumina.** The library is `[P5]-[insert]-[P7]`; a read primes at the insert boundary and reads 5'->3' into the insert, running into the 3'\u002FP7-side adapter only if it runs out of insert. Short-insert libraries (small-RNA ~22 nt, cfDNA ~167 bp, FFPE, degraded RNA, ancient DNA) are read-through-dominated; long-insert WGS may show almost none. The FastQC adapter-content curve climbing toward the 3' end IS that insert-size signal.\n\n2. **Adapter trimming is the one near-universal preprocessing step; quality trimming usually is not.** Local aligners (BWA-MEM, STAR, Bowtie2 local, HISAT2) SOFT-CLIP low-quality tails, so quality trimming is redundant or harmful for alignment-based DNA\u002FRNA (MacManes 2014, Williams 2016; GATK discourages it before BQSR). But aligners do NOT reliably remove ADAPTER -- adapter is foreign sequence with genuine base quality, so the aligner may try to align it and anchor a wrong placement. Trim adapter; leave quality trimming to the cases that need it (assembly, k-mer\u002Fpseudo-alignment, small-RNA, amplicon, no-BQSR variant calling).\n\n3. **Small-RNA inverts the logic: the adapter is on EVERY read, so DISCARD reads with no adapter.** A ~22 nt miRNA insert is far shorter than a 50-75 nt read, so read-through is universal; a read with no detectable adapter is an adapter dimer, a too-long contaminant, or junk. Use `--discard-untrimmed` plus a tight length gate (`-m 18 -M 30`). This is the OPPOSITE of genomic DNA, where the no-adapter reads are the good full-length inserts.\n\nTwo-color trap: on NextSeq\u002FNovaSeq, a high-quality poly-G tail is NOT adapter and is not removed by adapter trimming -- it needs a chemistry-aware poly-G trim (`cutadapt --nextseq-trim=20`, or fastp's auto poly-G). See read-qc\u002Fquality-reports and read-qc\u002Ffastp-workflow.\n\n## Verified Adapter Sequences\n\n| Kit | Read | Sequence |\n|-----|------|----------|\n| Illumina TruSeq | R1 3' | AGATCGGAAGAGCACACGTCTGAACTCCAGTCA |\n| Illumina TruSeq | R2 3' | AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGT |\n| TruSeq (shared stem -- catches both) | -- | AGATCGGAAGAGC |\n| Nextera \u002F Tn5 | transposase | CTGTCTCTTATACACATCT |\n| TruSeq small-RNA | 3' | TGGAATTCTCGGGTGCCAAGG |\n\nThe R1 3' adapter is the reverse complement of the R2-side region; trimming the shared 13 bp stem `AGATCGGAAGAGC` on both mates catches TruSeq read-through.\n\n## Tool Taxonomy\n\n| Tool | Mechanism | When it wins |\n|------|-----------|--------------|\n| Cutadapt | Error-tolerant semiglobal alignment of a supplied adapter | PRECISION: small-RNA 3' adapter, amplicon\u002F16S primers, anchored\u002Flinked adapters, demultiplexing. The correctness reference. |\n| Trimmomatic | ILLUMINACLIP simple + palindrome modes; ordered step pipeline | Legacy\u002Freproducibility pipelines; palindrome PE read-through detection |\n| fastp | PE overlap analysis (no adapter sequence needed) + auto poly-G | DEFAULT general-purpose trim; one fast pass (route OUT -> fastp-workflow) |\n| Trim Galore | Cutadapt + FastQC wrapper with adapter auto-detect | Bisulfite\u002FRRBS (`--rrbs`), Bismark pipelines |\n| BBDuk | k-mer match against an adapter\u002Fcontaminant reference | Contaminant\u002FPhiX removal in the same pass (route OUT -> contamination-screening) |\n\n## Decision Tree by Scenario\n\n| Scenario | Use | Why |\n|----------|-----|-----|\n| General Illumina PE WGS\u002FWES\u002FRNA | fastp, or cutadapt with the TruSeq stem | Overlap analysis needs no sequence; cutadapt for explicit control |\n| Small-RNA \u002F miRNA | cutadapt `-a TGGAATTCTCGGGTGCCAAGG -m 18 -M 30 --discard-untrimmed` | Adapter on every read; gate length and drop no-adapter reads |\n| Amplicon \u002F 16S primers | cutadapt linked\u002Fanchored adapters | Primers are at fixed positions; needs precise placement |\n| PE read-through, no adapter sequence known | fastp overlap, or Trimmomatic palindrome | Both detect read-through from the R1\u002FR2 overlap |\n| Bisulfite \u002F RRBS | Trim Galore `--rrbs` | Handles MspI fill-in and Bismark conventions |\n| NextSeq\u002FNovaSeq with poly-G tails | fastp (auto) or cutadapt `--nextseq-trim` | Poly-G is high-Q; quality trim alone misses it |\n\nDefault when uncertain: fastp for bulk PE, cutadapt with the TruSeq stem for explicit single-tool control.\n\n## Cutadapt\n\nThe algorithm is semiglobal (overlap) alignment, so a partial 3' adapter at the read end is detected. Two defaults drive behavior: `-e` (error rate, default 0.1) is computed against the LENGTH OF THE MATCHED REGION, not the whole adapter (an 8 bp match with 1 error is rate 0.125 and is rejected at the default); `-O` (minimum overlap, default 3) costs only ~0.07 bases lost per read by chance.\n\n```bash\n# Single-end 3' adapter\ncutadapt -a AGATCGGAAGAGC -m 20 -o trimmed.fq.gz in.fq.gz\n\n# Paired-end TruSeq (shared stem on both mates); both reads of a pair are discarded together\ncutadapt -a AGATCGGAAGAGC -A AGATCGGAAGAGC -m 20:20 \\\n         -o R1.fq.gz -p R2.fq.gz in_R1.fq.gz in_R2.fq.gz\n\n# Small-RNA: adapter on every read -> discard untrimmed, gate length\ncutadapt -a TGGAATTCTCGGGTGCCAAGG -m 18 -M 30 --discard-untrimmed -j 8 \\\n         -o mirna.fq.gz raw.fq.gz\n\n# Amplicon: linked 5'...3' primers (anchor with ^ to require the 5' primer)\ncutadapt -g ^FWDPRIMER...REVPRIMER -o trimmed.fq.gz in.fq.gz\n\n# 2-color poly-G aware (treats G as low quality so high-Q poly-G is trimmed)\ncutadapt --nextseq-trim=20 -a AGATCGGAAGAGC -m 20 -o out.fq.gz in.fq.gz\n\n# Higher error tolerance \u002F longer required overlap when matches are missed \u002F spurious\ncutadapt -a ADAPTER -e 0.15 -O 5 -m 20 -o out.fq.gz in.fq.gz\n```\n\nKey flags: `-a\u002F-g\u002F-b` (3'\u002F5'\u002Fanywhere, R1), `-A\u002F-G\u002F-B` (R2), `-q` (quality trim, BWA running-sum, runs BEFORE adapter removal), `--pair-filter {any,both,first}` (default any), `--max-n`, `--action {trim,mask,lowercase,none}`. When a filtering option discards reads in PE mode, both files MUST be processed together or they fall out of sync.\n\n## Trimmomatic\n\n`ILLUMINACLIP:\u003Cadapters.fa>:\u003CseedMismatches>:\u003CpalindromeClip>:\u003CsimpleClip>:\u003CminAdapterLen>:\u003CkeepBothReads>`\n\n- seedMismatches: mismatches tolerated in the initial seed (commonly 2).\n- palindromeClip (~30): log-odds threshold for the PE palindrome alignment; ~30 needs ~50 matched bases.\n- simpleClip (~10): log-odds threshold for an adapter-vs-read match; ~10 needs ~16 bases.\n- keepBothReads: DEFAULT False -- after palindrome detects read-through, R2 is redundant (reverse complement of R1) and is DROPPED; set True if a downstream tool needs both mates.\n\nSIMPLE mode tests each adapter against each read. PALINDROME mode (PE-only) aligns R1+adapter against the reverse complement of R2+adapter, so it detects read-through even when only a few adapter bases remain or the adapter is entirely past the read end. Steps run in COMMAND-LINE ORDER; put ILLUMINACLIP first and MINLEN last so the length check reflects all prior trimming.\n\n```bash\n# Paired-end, palindrome-capable adapter file, MINLEN last\ntrimmomatic PE -phred33 -threads 8 \\\n    in_R1.fq.gz in_R2.fq.gz \\\n    R1_paired.fq.gz R1_unpaired.fq.gz R2_paired.fq.gz R2_unpaired.fq.gz \\\n    ILLUMINACLIP:TruSeq3-PE-2.fa:2:30:10:2:keepBothReads MINLEN:36\n\n# Built-in adapter files ship with the install\nls $CONDA_PREFIX\u002Fshare\u002Ftrimmomatic-*\u002Fadapters\u002F\n```\n\nPE mode emits FOUR files: paired (both mates survived) and unpaired\u002Forphan (mate dropped). Feed the paired files to the aligner; the orphans stay synchronized out of the way.\n\n## Common Errors\n\n| Symptom | Cause | Solution |\n|---------|-------|----------|\n| FastQC still shows adapter after trimming | Wrong adapter, too-low `-e`, or only partial stem used | Use the shared stem AGATCGGAAGAGC; raise `-e` to 0.15; BLAST the overrepresented sequence |\n| Reads truncated \u002F many lose a few bp | `-O` too low -> random 3-mer matches | Raise `-O` (e.g. 5); the default loses ~0.07 bp\u002Fread by chance |\n| Aligner reports R1\u002FR2 out of sync | Mates trimmed\u002Ffiltered independently | Process pairs together (cutadapt `-p`; Trimmomatic paired outputs) |\n| Small-RNA yields huge \"reads\" | Forgot `--discard-untrimmed` \u002F length gate | Add `--discard-untrimmed -m 18 -M 30` |\n| 3' G-content rise persists after trimming | 2-color poly-G is high-quality, not adapter | `cutadapt --nextseq-trim` or fastp auto poly-G |\n| Half of R2 disappears in Trimmomatic | keepBothReads default False drops redundant R2 | Add `keepBothReads` (True) if both mates are needed downstream |\n\n## References\n\nMartin M. 2011. Cutadapt removes adapter sequences from high-throughput sequencing reads. EMBnet.journal 17(1):10-12.\nBolger AM, Lohse M, Usadel B. 2014. Trimmomatic: a flexible trimmer for Illumina sequence data. Bioinformatics 30(15):2114-2120.\nMacManes MD. 2014. On the optimal trimming of high-throughput mRNA sequence data. Frontiers in Genetics 5:13.\nWilliams CR, Baccarella A, Parrish JZ, Kim CC. 2016. Trimming of sequence reads alters RNA-Seq gene expression estimates. BMC Bioinformatics 17:103.\nChen S, Zhou Y, Chen Y, Gu J. 2018. fastp: an ultra-fast all-in-one FASTQ preprocessor. Bioinformatics 34(17):i884-i890.\n\n## Related Skills\n\nread-qc\u002Fquality-reports - Read the adapter-content panel that triggers trimming\nread-qc\u002Fquality-filtering - Quality and length filtering after adapter removal\nread-qc\u002Ffastp-workflow - All-in-one adapter + quality trim with auto poly-G\nread-qc\u002Fcontamination-screening - k-mer removal of PhiX\u002Fvector\u002Fcontaminant sequence\nsmall-rna-seq\u002Fsmrna-preprocessing - Full small-RNA adapter + length workflow\nread-alignment\u002Fbwa-alignment - Soft-clipping aligner that handles low-quality tails without trimming\n",{"name":5,"source":24,"license":15,"tool_type":25,"description":7,"imported_at":26,"source_path":27,"primary_tool":28,"source_repository":29},"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills","cli","2026-09-20","read-qc\u002Fadapter-trimming\u002FSKILL.md","cutadapt","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fbiology\u002Fbio-read-qc-adapter-trimming","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-read-qc-adapter-trimming",{"tool":42,"command":43},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-read-qc-adapter-trimming",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-read-qc-adapter-trimming","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-read-qc-adapter-trimming\u002FSKILL.md",true,[50,56],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Ftrim_adapters.sh","SCRIPT","脚本",1189,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-read-qc-adapter-trimming\u002Fexamples\u002Ftrim_adapters.sh",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"usage-guide.md","REFERENCE","参考文档",3898,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-read-qc-adapter-trimming\u002Fusage-guide.md",[63,71,78,85,92,99],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":70},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":70},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":70},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":70},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":70},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":70},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]