[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EGV9X82PTC5F9REPE67RAA":3,"skill-same:01M7EGV9X82PTC5F9REPE67RAA":78},{"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":47,"commitSha":48,"skillDirectory":49,"forksCount":14,"repositoryHtmlUrl":50,"repositoryHomepageUrl":50,"ownerHtmlUrl":51,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":52,"install":53,"resources":65},"01M7EGV9X82PTC5F9REPE67RAA","bio-workflows-smrna-pipeline",null,"Orchestrates the end-to-end small RNA-seq pipeline from FASTQ to differential miRNAs and expression-filtered targets, chaining kit-aware cutadapt trimming (adapter on every read, UMI\u002F4N handling), miRge3 known+isomiR quantification or miRDeep2 novel discovery, compositionally-aware DESeq2, and miRanda target prediction. Use when committing the library-kit adapter\u002FUMI handling once, choosing the NORMALIZER (which drives which miRNAs are called DE more than the DE model does), deciding known quantification vs novel discovery, handling biofluid\u002Fplasma libraries that lack a trustworthy endogenous normalizer, routing tRF\u002FpiRNA reads to their own profiling, or feeding RAW (not RPM) counts with size-factor inspection into DE. Hands mechanism to the small-rna-seq component skills; not a re-teach of any single step.","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-workflows-smrna-pipeline\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-workflows-smrna-pipeline\ndescription: Orchestrates the end-to-end small RNA-seq pipeline from FASTQ to differential miRNAs and expression-filtered targets, chaining kit-aware cutadapt trimming (adapter on every read, UMI\u002F4N handling), miRge3 known+isomiR quantification or miRDeep2 novel discovery, compositionally-aware DESeq2, and miRanda target prediction. Use when committing the library-kit adapter\u002FUMI handling once, choosing the NORMALIZER (which drives which miRNAs are called DE more than the DE model does), deciding known quantification vs novel discovery, handling biofluid\u002Fplasma libraries that lack a trustworthy endogenous normalizer, routing tRF\u002FpiRNA reads to their own profiling, or feeding RAW (not RPM) counts with size-factor inspection into DE. Hands mechanism to the small-rna-seq component skills; not a re-teach of any single step.\ntool_type: mixed\nprimary_tool: miRge3.0\nworkflow: true\ndepends_on:\n  - small-rna-seq\u002Fsmrna-preprocessing\n  - small-rna-seq\u002Fmirge3-analysis\n  - small-rna-seq\u002Fmirdeep2-analysis\n  - small-rna-seq\u002Fdifferential-mirna\n  - small-rna-seq\u002Ftarget-prediction\n  - small-rna-seq\u002Ftrf-pirna-profiling\nqc_checkpoints:\n  - after_trim: \"Read-length peak 21-23 nt (30+ smear = degradation\u002FtRNA\u002FrRNA; 26-32 peak = piRNA)\"\n  - after_quant: \"RNA-class composition checked (miRNA vs tRF\u002FrRF\u002FpiRNA); abundant non-miRNA = different story\"\n  - before_de: \"RAW counts confirmed (not RPM); size factors inspected for compositional distortion\"\n  - after_de: \"baseMean reported with every call (significant FC on a ~5-count miRNA is noise)\"\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"workflows\u002Fsmrna-pipeline\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference examples tested with: cutadapt 4.4+, miRge3.0 0.1.4+, miRDeep2 2.0.1.3+, DESeq2 1.42+, apeglm 1.24+, miRanda 3.3a, umi_tools 1.1+, miRTrace 1.0+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- R: `packageVersion('\u003Cpkg>')` then `?function_name` to verify parameters\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\nNote: the correct 3' adapter sequence and the UMI\u002F4N scheme are KIT-specific (TruSeq vs NEXTflex vs QIAseq) — confirm against the kit before trimming. The normalizer that best fits compositional miRNA data drifts with the method literature; treat the table below as a decision aid to validate, not a fixed rule.\n\n# Small RNA-seq Pipeline\n\n**\"Analyze my small RNA-seq data from FASTQ to differential miRNAs\"** -> Chain kit-aware trimming, known-miRNA quantification (or novel discovery), a compositionally-aware DE test, and expression-filtered target prediction.\n- CLI + R: cutadapt -> (miRge3.0 | miRDeep2) -> DESeq2 (inspect size factors) -> miRanda (filter by anti-correlated mRNA)\n\nThis is a workflow skill: it owns the chaining decisions and hand-offs, not the internals of any one step. Every step below cross-references the component skill that teaches its mechanism.\n\n## The governing principle\n\nA small RNA-seq result turns on two things the mRNA pipeline never faces — the adapter is on every read, and the counts are compositional — so the trustworthy result is decided at these seams.\n\n1. **The library kit fixes adapter + UMI\u002F4N handling, committed once at trimming and un-reversible.** The insert (~22 nt) is far shorter than the read, so the 3' adapter is on EVERY real read and `--discard-untrimmed` correctly drops no-insert junk (the inverse of genomic DNA). NEXTflex 4N random bases are stripped AFTER adapter removal; QIAseq UMIs are extracted and deduped. NEVER position-dedup a non-UMI small-RNA library — abundant miRNAs legitimately share start positions, so position-dedup destroys real signal.\n2. **The normalizer is the dominant analytic commitment — more than the DE model.** miRNA counts are few-featured and compositional; a handful of miRNAs can dominate the library. Global scaling (TMM's 30%\u002F5% trimming, median-of-ratios) is built for ~20k mRNAs and is harmful among hundreds of miRNAs (Garmire 2012). The normalizer choice CHANGES which miRNAs are called DE. Commit and report it; do not default silently.\n3. **RAW counts (not RPM) flow into DESeq2, and size factors must be inspected.** A large rise in one abundant miRNA mechanically deflates all others (the closed-composition artifact), manufacturing spurious \"down\" calls. Confirm the input is raw integer counts and inspect `sizeFactors(dds)` before trusting any call.\n4. **Targets are hypotheses, not findings.** miRanda output must be intersected with anti-correlated mRNA DE and validated databases before interpretation.\n\n## Pipeline map\n\n```\nFASTQ (single-end small RNA)\n  | [1] Trim (kit-aware) --------> cutadapt (+ umi_tools \u002F 4N)   (small-rna-seq\u002Fsmrna-preprocessing)\n  v     ^-- commitment: kit adapter + UMI\u002F4N; --discard-untrimmed; NO position-dedup w\u002Fo UMI\n  | [2] Quantify OR discover ----> miRge3.0 (known+isomiR) | miRDeep2 (novel)  (small-rna-seq\u002Fmirge3-analysis, mirdeep2-analysis)\n  v\n  | [3] Differential expression -> DESeq2 on RAW counts; INSPECT size factors   (small-rna-seq\u002Fdifferential-mirna)\n  v     ^-- commitment: the NORMALIZER (drives which miRNAs are DE)\n  | [4] Target prediction -------> miRanda, filtered by anti-correlated mRNA DE  (small-rna-seq\u002Ftarget-prediction)\n  v\nDifferential miRNAs + expression-supported targets\n   (tRF\u002FpiRNA reads -> small-rna-seq\u002Ftrf-pirna-profiling)\n```\n\n## Made-once commitments\n\n| Commitment | Choice | Consequence inherited downstream |\n|------------|--------|----------------------------------|\n| Library kit adapter + UMI\u002F4N | TruSeq \u002F NEXTflex-4N \u002F QIAseq-UMI handling, set at trimming | Wrong adapter or missed 4N\u002FUMI corrupts every count; non-UMI position-dedup destroys real miRNAs |\n| Quantification target | Known-miRNA + isomiR (miRge3) vs novel discovery (miRDeep2) | Discovery is high-FP and needs a genome + bowtie1; quantification is the common curated case |\n| Normalizer | median-of-ratios\u002FTMM vs quantile\u002Floess vs RUVg vs CoDA\u002FALDEx2 | Which miRNAs are DE (more than the DE model choice) |\n| Biofluid vs tissue | plasma\u002Fserum has NO trustworthy endogenous normalizer | DE may be uninterpretable without spike-ins + hemolysis modeling |\n\n## The canonical order and why\n\n1. **Trim (kit-aware)** — adapter removal with `--discard-untrimmed`; 4N\u002FUMI handling before or during collapse. Order-trap: position-deduping a non-UMI library removes real high-abundance miRNAs.\n2. **miRTrace QC** — length\u002Fcomplexity, RNA-class composition, cross-clade contamination BEFORE quantification (a good mapping rate hides sample swaps and reagent contamination).\n3. **Quantify (miRge3) or discover (miRDeep2)** — to raw integer counts. For miRDeep2, choose the score cutoff from `survey.pl` signal-to-noise, not a fixed rule.\n4. **Low-count filter** (`rowSums >= 10`, lower than mRNA) BEFORE normalization.\n5. **DE with the committed normalizer** — raw counts into DESeq2; inspect `sizeFactors`. Order-trap: feeding RPM\u002FCPM bakes compositional distortion into an invalid model.\n6. **Target prediction** — intersect miRanda predictions with anti-correlated mRNA DE (order-trap: enrichment on raw predictions is false-positive-laden).\n\n## Fork\u002Fdecision points\n\nPipeline-level selection only; mechanism lives in the component skills.\n\n| Fork | Lean toward | Hand off to |\n|------|-------------|-------------|\n| Quantify vs discover | miRge3.0 (known + isomiR, curated, common) vs miRDeep2 (novel only; high FP, genome + bowtie1, survey.pl cutoff) | small-rna-seq\u002Fmirge3-analysis, small-rna-seq\u002Fmirdeep2-analysis |\n| Normalizer | median-of-ratios\u002FTMM (risky under composition shift) vs quantile\u002Floess (better on skewed miRNA) vs RUVg (control\u002Fempirical miRNAs) vs CoDA\u002FALDEx2 (compositional sensitivity check) | small-rna-seq\u002Fdifferential-mirna |\n| Biofluid\u002Fplasma | no trustworthy endogenous normalizer (miR-16 is hemolysis-sensitive, U6 degrades); cel-miR-39 spike controls EXTRACTION not biological scale; model batch\u002Fhemolysis explicitly | small-rna-seq\u002Fdifferential-mirna |\n| RNA class | miRNA vs tRF\u002FpiRNA (26-32 nt peak) -> route to trf-pirna-profiling (MINTmap\u002Funitas) | small-rna-seq\u002Ftrf-pirna-profiling |\n\n## Primary path: cutadapt -> miRge3.0 -> DESeq2 -> miRanda\n\n**Goal:** turn kit-specific FASTQ into differential miRNAs with expression-supported targets.\n\n**Approach:** trim to the kit, quantify known miRNAs\u002FisomiRs, test RAW counts with size-factor inspection, then filter targets by anti-correlation. (The runnable script in examples\u002F shows the miRDeep2 novel-discovery route below; the miRge3.0 commands are shown here.)\n\n```bash\n# Kit-aware trim: adapter on EVERY read, so --discard-untrimmed drops no-insert junk (inverse of gDNA).\n# NEXTflex 4N: cutadapt -u 4 -u -4 AFTER adapter. QIAseq UMIs: umi_tools. NEVER position-dedup non-UMI.\ncutadapt -a TGGAATTCTCGGGTGCCAAGG --minimum-length 18 --maximum-length 30 --discard-untrimmed \\\n    -o trimmed.fastq.gz reads.fastq.gz\n\n# Known-miRNA + isomiR quantification (the common case). NOTE: v3 has NO 'annotate' subcommand\n# (that was miRge2); it is `miRge3.0 -s ...`. Reads are already cutadapt-trimmed, so -a is OMITTED\n# (v3 has no 'none' keyword; passing one makes cutadapt treat it as an adapter sequence and fail).\n# isomiRs are annotated by default; -gff emits the isomiR GFF.\n# (-ai would instead compute A-to-I editing, a separate analysis, not isomiR reporting.)\nmiRge3.0 -s trimmed.fastq.gz -lib \u002Fpath\u002Fto\u002FmiRge3_Lib -on human -db mirbase \\\n    -gff -cpu 8 -o mirge_out\n```\n\n```r\nlibrary(DESeq2)\n# RAW counts (miR.Counts.csv), NOT RPM. A few miRNAs can dominate, so inspect sizeFactors first.\n# miRge3.0 writes into a timestamped subfolder (mirge_out\u002FmiRge.YYYY-M-D_h-m-s\u002F), not directly into -o\ncounts \u003C- read.csv(Sys.glob('mirge_out\u002FmiRge.*\u002FmiR.Counts.csv')[1], row.names = 1)\ndds \u003C- DESeqDataSetFromMatrix(round(counts), colData, ~condition)\ndds \u003C- dds[rowSums(counts(dds)) >= 10, ]      # lower prefilter than mRNA\ndds \u003C- DESeq(dds)\nprint(sizeFactors(dds))                       # a dominant-miRNA shift distorts these -> spurious calls\nres \u003C- lfcShrink(dds, coef = 'condition_treated_vs_control', type = 'apeglm')\n```\n\n```bash\n# Targets are a hypothesis: intersect with anti-correlated mRNA DE before trusting them.\n# -sc 140: miRanda default alignment-score floor; -en -20: keep duplexes with MFE \u003C= -20 kcal\u002Fmol (stable binding)\nmiranda mature_mirnas.fa target_3utrs.fa -sc 140 -en -20 -strict -out targets.txt\n```\n\n## Novel discovery alternative: miRDeep2\n\n**Goal:** discover previously unannotated miRNAs (only when that is the question).\n\n**Approach:** collapse reads, map to the genome with bowtie1, run miRDeep2, and pick the score cutoff from the signal-to-noise survey — not a fixed threshold. Full runnable script: `examples\u002Fsmrna_full_pipeline.sh`.\n\n```bash\ngunzip -kc trimmed.fastq.gz > trimmed.fastq            # mapper.pl reads plain-text FASTQ, not gzip\nmapper.pl trimmed.fastq -e -h -i -j -l 18 -m -p genome_index \\\n    -s reads_collapsed.fa -t reads_collapsed_vs_genome.arf\nmiRDeep2.pl reads_collapsed.fa genome.fa reads_collapsed_vs_genome.arf \\\n    mature_ref.fa none hairpin_ref.fa -t Human      # score cutoff from survey.pl signal-to-noise\n```\n\n## QC checkpoints between steps\n\n| After | Gate | Interpretation |\n|-------|------|----------------|\n| Trim | Read-length peak 21-23 nt | 30+ nt smear = degradation\u002FtRNA\u002FrRNA; 26-32 nt peak = piRNA (route to trf-pirna-profiling) |\n| miRTrace\u002Falign | RNA-class composition (miRNA vs tRF\u002FrRF\u002FpiRNA); cross-clade contamination | Abundant non-miRNA classes mean this is a tRF\u002FpiRNA story, not a miRNA one |\n| Before DE | RAW counts (not RPM); size factors inspected | A dominant-miRNA shift distorts size factors and manufactures spurious \"down\" calls |\n| After DE | baseMean reported with every call | A significant fold-change on a ~5-count miRNA is noise |\n| Targets | filtered by anti-correlated mRNA DE + validated DBs | Raw miRanda predictions are hypotheses, not findings |\n\nLigation bias means absolute cross-miRNA abundance WITHIN a sample is untrustworthy; compare the same miRNA across samples, never across kits. For a fully reproducible run, nf-core\u002Fsmrnaseq chains these steps (workflow-management\u002Fnf-core-pipelines).\n\n## Common Errors\n\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| Real high-abundance miRNAs vanish | Position-deduped a non-UMI library | Dedup ONLY with UMIs (umi_tools); non-UMI libraries are not position-deduped |\n| Invalid model \u002F distorted calls | Fed RPM\u002FCPM to DESeq2 | Use RAW integer counts; RPM bakes in composition |\n| Many spurious \"down\" miRNAs | One abundant miRNA rose and deflated the rest (closed composition) | Inspect size factors; consider quantile\u002FRUVg\u002FALDEx2 as a sensitivity check |\n| DE looks strong but is noise | Fold-change on a ~5-count miRNA | Report and gate on baseMean |\n| Plasma miRNA DE uninterpretable | No trustworthy endogenous normalizer; hemolysis confound | Spike-ins for extraction control + model hemolysis\u002Fbatch explicitly |\n| \"miRNA\" library is mostly tRF\u002FpiRNA | 26-32 nt peak \u002F broad tRF distribution | Route to trf-pirna-profiling (MINTmap\u002Funitas) |\n\n## Pipeline map (hand-offs)\n\n- small-rna-seq\u002Fsmrna-preprocessing - kit-specific adapter, UMI, and 4N handling\n- small-rna-seq\u002Fmirge3-analysis - known-miRNA and isomiR quantification\n- small-rna-seq\u002Fmirdeep2-analysis - novel miRNA discovery and survey.pl cutoff\n- small-rna-seq\u002Fdifferential-mirna - compositionally-aware DE and normalizer selection\n- small-rna-seq\u002Ftarget-prediction - seed prediction filtered by expression\n- small-rna-seq\u002Ftrf-pirna-profiling - tRF and piRNA profiling\n\nThe runnable miRDeep2 discovery-route script is in this skill's examples\u002F (`smrna_full_pipeline.sh`).\n\n## Related Skills\n\n- small-rna-seq\u002Fsmrna-preprocessing - Kit-specific adapter, UMI, and 4N handling\n- small-rna-seq\u002Fmirdeep2-analysis - Novel miRNA discovery\n- small-rna-seq\u002Fmirge3-analysis - Known-miRNA and isomiR quantification\n- small-rna-seq\u002Fdifferential-mirna - Compositionally-aware DE\n- small-rna-seq\u002Ftarget-prediction - Seed prediction filtered by expression\n- small-rna-seq\u002Ftrf-pirna-profiling - tRF and piRNA profiling\n- differential-expression\u002Fdeseq2-basics - DESeq2 model, contrasts, shrinkage\n- workflow-management\u002Fnf-core-pipelines - Run nf-core\u002Fsmrnaseq as a curated, reproducible pipeline\n\n## References\n\n- Garmire LX, Subramaniam S (2012) Evaluation of normalization methods in mammalian microRNA-Seq data. *RNA* 18:1279-1288. DOI 10.1261\u002Frna.030916.111. (normalization, not the DE model, drives miRNA DE results.)\n- Risso D, Ngai J, Speed TP, Dudoit S (2014) Normalization of RNA-seq data using factor analysis of control genes or samples. *Nature Biotechnology* 32:896-902. DOI 10.1038\u002Fnbt.2931. (RUVg for miRNA\u002Funwanted variation.)\n- Friedländer MR, Mackowiak SD, Li N, Chen W, Rajewsky N (2012) miRDeep2 accurately identifies known and hundreds of novel microRNA genes in seven animal clades. *Nucleic Acids Research* 40:37-52. DOI 10.1093\u002Fnar\u002Fgkr688.\n","## Version Compatibility\n\nReference examples tested with: cutadapt 4.4+, miRge3.0 0.1.4+, miRDeep2 2.0.1.3+, DESeq2 1.42+, apeglm 1.24+, miRanda 3.3a, umi_tools 1.1+, miRTrace 1.0+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- R: `packageVersion('\u003Cpkg>')` then `?function_name` to verify parameters\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\nNote: the correct 3' adapter sequence and the UMI\u002F4N scheme are KIT-specific (TruSeq vs NEXTflex vs QIAseq) — confirm against the kit before trimming. The normalizer that best fits compositional miRNA data drifts with the method literature; treat the table below as a decision aid to validate, not a fixed rule.\n\n# Small RNA-seq Pipeline\n\n**\"Analyze my small RNA-seq data from FASTQ to differential miRNAs\"** -> Chain kit-aware trimming, known-miRNA quantification (or novel discovery), a compositionally-aware DE test, and expression-filtered target prediction.\n- CLI + R: cutadapt -> (miRge3.0 | miRDeep2) -> DESeq2 (inspect size factors) -> miRanda (filter by anti-correlated mRNA)\n\nThis is a workflow skill: it owns the chaining decisions and hand-offs, not the internals of any one step. Every step below cross-references the component skill that teaches its mechanism.\n\n## The governing principle\n\nA small RNA-seq result turns on two things the mRNA pipeline never faces — the adapter is on every read, and the counts are compositional — so the trustworthy result is decided at these seams.\n\n1. **The library kit fixes adapter + UMI\u002F4N handling, committed once at trimming and un-reversible.** The insert (~22 nt) is far shorter than the read, so the 3' adapter is on EVERY real read and `--discard-untrimmed` correctly drops no-insert junk (the inverse of genomic DNA). NEXTflex 4N random bases are stripped AFTER adapter removal; QIAseq UMIs are extracted and deduped. NEVER position-dedup a non-UMI small-RNA library — abundant miRNAs legitimately share start positions, so position-dedup destroys real signal.\n2. **The normalizer is the dominant analytic commitment — more than the DE model.** miRNA counts are few-featured and compositional; a handful of miRNAs can dominate the library. Global scaling (TMM's 30%\u002F5% trimming, median-of-ratios) is built for ~20k mRNAs and is harmful among hundreds of miRNAs (Garmire 2012). The normalizer choice CHANGES which miRNAs are called DE. Commit and report it; do not default silently.\n3. **RAW counts (not RPM) flow into DESeq2, and size factors must be inspected.** A large rise in one abundant miRNA mechanically deflates all others (the closed-composition artifact), manufacturing spurious \"down\" calls. Confirm the input is raw integer counts and inspect `sizeFactors(dds)` before trusting any call.\n4. **Targets are hypotheses, not findings.** miRanda output must be intersected with anti-correlated mRNA DE and validated databases before interpretation.\n\n## Pipeline map\n\n```\nFASTQ (single-end small RNA)\n  | [1] Trim (kit-aware) --------> cutadapt (+ umi_tools \u002F 4N)   (small-rna-seq\u002Fsmrna-preprocessing)\n  v     ^-- commitment: kit adapter + UMI\u002F4N; --discard-untrimmed; NO position-dedup w\u002Fo UMI\n  | [2] Quantify OR discover ----> miRge3.0 (known+isomiR) | miRDeep2 (novel)  (small-rna-seq\u002Fmirge3-analysis, mirdeep2-analysis)\n  v\n  | [3] Differential expression -> DESeq2 on RAW counts; INSPECT size factors   (small-rna-seq\u002Fdifferential-mirna)\n  v     ^-- commitment: the NORMALIZER (drives which miRNAs are DE)\n  | [4] Target prediction -------> miRanda, filtered by anti-correlated mRNA DE  (small-rna-seq\u002Ftarget-prediction)\n  v\nDifferential miRNAs + expression-supported targets\n   (tRF\u002FpiRNA reads -> small-rna-seq\u002Ftrf-pirna-profiling)\n```\n\n## Made-once commitments\n\n| Commitment | Choice | Consequence inherited downstream |\n|------------|--------|----------------------------------|\n| Library kit adapter + UMI\u002F4N | TruSeq \u002F NEXTflex-4N \u002F QIAseq-UMI handling, set at trimming | Wrong adapter or missed 4N\u002FUMI corrupts every count; non-UMI position-dedup destroys real miRNAs |\n| Quantification target | Known-miRNA + isomiR (miRge3) vs novel discovery (miRDeep2) | Discovery is high-FP and needs a genome + bowtie1; quantification is the common curated case |\n| Normalizer | median-of-ratios\u002FTMM vs quantile\u002Floess vs RUVg vs CoDA\u002FALDEx2 | Which miRNAs are DE (more than the DE model choice) |\n| Biofluid vs tissue | plasma\u002Fserum has NO trustworthy endogenous normalizer | DE may be uninterpretable without spike-ins + hemolysis modeling |\n\n## The canonical order and why\n\n1. **Trim (kit-aware)** — adapter removal with `--discard-untrimmed`; 4N\u002FUMI handling before or during collapse. Order-trap: position-deduping a non-UMI library removes real high-abundance miRNAs.\n2. **miRTrace QC** — length\u002Fcomplexity, RNA-class composition, cross-clade contamination BEFORE quantification (a good mapping rate hides sample swaps and reagent contamination).\n3. **Quantify (miRge3) or discover (miRDeep2)** — to raw integer counts. For miRDeep2, choose the score cutoff from `survey.pl` signal-to-noise, not a fixed rule.\n4. **Low-count filter** (`rowSums >= 10`, lower than mRNA) BEFORE normalization.\n5. **DE with the committed normalizer** — raw counts into DESeq2; inspect `sizeFactors`. Order-trap: feeding RPM\u002FCPM bakes compositional distortion into an invalid model.\n6. **Target prediction** — intersect miRanda predictions with anti-correlated mRNA DE (order-trap: enrichment on raw predictions is false-positive-laden).\n\n## Fork\u002Fdecision points\n\nPipeline-level selection only; mechanism lives in the component skills.\n\n| Fork | Lean toward | Hand off to |\n|------|-------------|-------------|\n| Quantify vs discover | miRge3.0 (known + isomiR, curated, common) vs miRDeep2 (novel only; high FP, genome + bowtie1, survey.pl cutoff) | small-rna-seq\u002Fmirge3-analysis, small-rna-seq\u002Fmirdeep2-analysis |\n| Normalizer | median-of-ratios\u002FTMM (risky under composition shift) vs quantile\u002Floess (better on skewed miRNA) vs RUVg (control\u002Fempirical miRNAs) vs CoDA\u002FALDEx2 (compositional sensitivity check) | small-rna-seq\u002Fdifferential-mirna |\n| Biofluid\u002Fplasma | no trustworthy endogenous normalizer (miR-16 is hemolysis-sensitive, U6 degrades); cel-miR-39 spike controls EXTRACTION not biological scale; model batch\u002Fhemolysis explicitly | small-rna-seq\u002Fdifferential-mirna |\n| RNA class | miRNA vs tRF\u002FpiRNA (26-32 nt peak) -> route to trf-pirna-profiling (MINTmap\u002Funitas) | small-rna-seq\u002Ftrf-pirna-profiling |\n\n## Primary path: cutadapt -> miRge3.0 -> DESeq2 -> miRanda\n\n**Goal:** turn kit-specific FASTQ into differential miRNAs with expression-supported targets.\n\n**Approach:** trim to the kit, quantify known miRNAs\u002FisomiRs, test RAW counts with size-factor inspection, then filter targets by anti-correlation. (The runnable script in examples\u002F shows the miRDeep2 novel-discovery route below; the miRge3.0 commands are shown here.)\n\n```bash\n# Kit-aware trim: adapter on EVERY read, so --discard-untrimmed drops no-insert junk (inverse of gDNA).\n# NEXTflex 4N: cutadapt -u 4 -u -4 AFTER adapter. QIAseq UMIs: umi_tools. NEVER position-dedup non-UMI.\ncutadapt -a TGGAATTCTCGGGTGCCAAGG --minimum-length 18 --maximum-length 30 --discard-untrimmed \\\n    -o trimmed.fastq.gz reads.fastq.gz\n\n# Known-miRNA + isomiR quantification (the common case). NOTE: v3 has NO 'annotate' subcommand\n# (that was miRge2); it is `miRge3.0 -s ...`. Reads are already cutadapt-trimmed, so -a is OMITTED\n# (v3 has no 'none' keyword; passing one makes cutadapt treat it as an adapter sequence and fail).\n# isomiRs are annotated by default; -gff emits the isomiR GFF.\n# (-ai would instead compute A-to-I editing, a separate analysis, not isomiR reporting.)\nmiRge3.0 -s trimmed.fastq.gz -lib \u002Fpath\u002Fto\u002FmiRge3_Lib -on human -db mirbase \\\n    -gff -cpu 8 -o mirge_out\n```\n\n```r\nlibrary(DESeq2)\n# RAW counts (miR.Counts.csv), NOT RPM. A few miRNAs can dominate, so inspect sizeFactors first.\n# miRge3.0 writes into a timestamped subfolder (mirge_out\u002FmiRge.YYYY-M-D_h-m-s\u002F), not directly into -o\ncounts \u003C- read.csv(Sys.glob('mirge_out\u002FmiRge.*\u002FmiR.Counts.csv')[1], row.names = 1)\ndds \u003C- DESeqDataSetFromMatrix(round(counts), colData, ~condition)\ndds \u003C- dds[rowSums(counts(dds)) >= 10, ]      # lower prefilter than mRNA\ndds \u003C- DESeq(dds)\nprint(sizeFactors(dds))                       # a dominant-miRNA shift distorts these -> spurious calls\nres \u003C- lfcShrink(dds, coef = 'condition_treated_vs_control', type = 'apeglm')\n```\n\n```bash\n# Targets are a hypothesis: intersect with anti-correlated mRNA DE before trusting them.\n# -sc 140: miRanda default alignment-score floor; -en -20: keep duplexes with MFE \u003C= -20 kcal\u002Fmol (stable binding)\nmiranda mature_mirnas.fa target_3utrs.fa -sc 140 -en -20 -strict -out targets.txt\n```\n\n## Novel discovery alternative: miRDeep2\n\n**Goal:** discover previously unannotated miRNAs (only when that is the question).\n\n**Approach:** collapse reads, map to the genome with bowtie1, run miRDeep2, and pick the score cutoff from the signal-to-noise survey — not a fixed threshold. Full runnable script: `examples\u002Fsmrna_full_pipeline.sh`.\n\n```bash\ngunzip -kc trimmed.fastq.gz > trimmed.fastq            # mapper.pl reads plain-text FASTQ, not gzip\nmapper.pl trimmed.fastq -e -h -i -j -l 18 -m -p genome_index \\\n    -s reads_collapsed.fa -t reads_collapsed_vs_genome.arf\nmiRDeep2.pl reads_collapsed.fa genome.fa reads_collapsed_vs_genome.arf \\\n    mature_ref.fa none hairpin_ref.fa -t Human      # score cutoff from survey.pl signal-to-noise\n```\n\n## QC checkpoints between steps\n\n| After | Gate | Interpretation |\n|-------|------|----------------|\n| Trim | Read-length peak 21-23 nt | 30+ nt smear = degradation\u002FtRNA\u002FrRNA; 26-32 nt peak = piRNA (route to trf-pirna-profiling) |\n| miRTrace\u002Falign | RNA-class composition (miRNA vs tRF\u002FrRF\u002FpiRNA); cross-clade contamination | Abundant non-miRNA classes mean this is a tRF\u002FpiRNA story, not a miRNA one |\n| Before DE | RAW counts (not RPM); size factors inspected | A dominant-miRNA shift distorts size factors and manufactures spurious \"down\" calls |\n| After DE | baseMean reported with every call | A significant fold-change on a ~5-count miRNA is noise |\n| Targets | filtered by anti-correlated mRNA DE + validated DBs | Raw miRanda predictions are hypotheses, not findings |\n\nLigation bias means absolute cross-miRNA abundance WITHIN a sample is untrustworthy; compare the same miRNA across samples, never across kits. For a fully reproducible run, nf-core\u002Fsmrnaseq chains these steps (workflow-management\u002Fnf-core-pipelines).\n\n## Common Errors\n\n| Symptom | Cause | Fix |\n|---------|-------|-----|\n| Real high-abundance miRNAs vanish | Position-deduped a non-UMI library | Dedup ONLY with UMIs (umi_tools); non-UMI libraries are not position-deduped |\n| Invalid model \u002F distorted calls | Fed RPM\u002FCPM to DESeq2 | Use RAW integer counts; RPM bakes in composition |\n| Many spurious \"down\" miRNAs | One abundant miRNA rose and deflated the rest (closed composition) | Inspect size factors; consider quantile\u002FRUVg\u002FALDEx2 as a sensitivity check |\n| DE looks strong but is noise | Fold-change on a ~5-count miRNA | Report and gate on baseMean |\n| Plasma miRNA DE uninterpretable | No trustworthy endogenous normalizer; hemolysis confound | Spike-ins for extraction control + model hemolysis\u002Fbatch explicitly |\n| \"miRNA\" library is mostly tRF\u002FpiRNA | 26-32 nt peak \u002F broad tRF distribution | Route to trf-pirna-profiling (MINTmap\u002Funitas) |\n\n## Pipeline map (hand-offs)\n\n- small-rna-seq\u002Fsmrna-preprocessing - kit-specific adapter, UMI, and 4N handling\n- small-rna-seq\u002Fmirge3-analysis - known-miRNA and isomiR quantification\n- small-rna-seq\u002Fmirdeep2-analysis - novel miRNA discovery and survey.pl cutoff\n- small-rna-seq\u002Fdifferential-mirna - compositionally-aware DE and normalizer selection\n- small-rna-seq\u002Ftarget-prediction - seed prediction filtered by expression\n- small-rna-seq\u002Ftrf-pirna-profiling - tRF and piRNA profiling\n\nThe runnable miRDeep2 discovery-route script is in this skill's examples\u002F (`smrna_full_pipeline.sh`).\n\n## Related Skills\n\n- small-rna-seq\u002Fsmrna-preprocessing - Kit-specific adapter, UMI, and 4N handling\n- small-rna-seq\u002Fmirdeep2-analysis - Novel miRNA discovery\n- small-rna-seq\u002Fmirge3-analysis - Known-miRNA and isomiR quantification\n- small-rna-seq\u002Fdifferential-mirna - Compositionally-aware DE\n- small-rna-seq\u002Ftarget-prediction - Seed prediction filtered by expression\n- small-rna-seq\u002Ftrf-pirna-profiling - tRF and piRNA profiling\n- differential-expression\u002Fdeseq2-basics - DESeq2 model, contrasts, shrinkage\n- workflow-management\u002Fnf-core-pipelines - Run nf-core\u002Fsmrnaseq as a curated, reproducible pipeline\n\n## References\n\n- Garmire LX, Subramaniam S (2012) Evaluation of normalization methods in mammalian microRNA-Seq data. *RNA* 18:1279-1288. DOI 10.1261\u002Frna.030916.111. (normalization, not the DE model, drives miRNA DE results.)\n- Risso D, Ngai J, Speed TP, Dudoit S (2014) Normalization of RNA-seq data using factor analysis of control genes or samples. *Nature Biotechnology* 32:896-902. DOI 10.1038\u002Fnbt.2931. (RUVg for miRNA\u002Funwanted variation.)\n- Friedländer MR, Mackowiak SD, Li N, Chen W, Rajewsky N (2012) miRDeep2 accurately identifies known and hundreds of novel microRNA genes in seven animal clades. *Nucleic Acids Research* 40:37-52. DOI 10.1093\u002Fnar\u002Fgkr688.\n",{"name":5,"source":24,"license":15,"workflow":25,"tool_type":26,"depends_on":27,"description":7,"imported_at":34,"source_path":35,"primary_tool":36,"qc_checkpoints":37,"source_repository":46},"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills",true,"mixed",[28,29,30,31,32,33],"small-rna-seq\u002Fsmrna-preprocessing","small-rna-seq\u002Fmirge3-analysis","small-rna-seq\u002Fmirdeep2-analysis","small-rna-seq\u002Fdifferential-mirna","small-rna-seq\u002Ftarget-prediction","small-rna-seq\u002Ftrf-pirna-profiling","2026-09-20","workflows\u002Fsmrna-pipeline\u002FSKILL.md","miRge3.0",[38,40,42,44],{"after_trim":39},"Read-length peak 21-23 nt (30+ smear = degradation\u002FtRNA\u002FrRNA; 26-32 peak = piRNA)",{"after_quant":41},"RNA-class composition checked (miRNA vs tRF\u002FrRF\u002FpiRNA); abundant non-miRNA = different story",{"before_de":43},"RAW counts confirmed (not RPM); size factors inspected for compositional distortion",{"after_de":45},"baseMean reported with every call (significant FC on a ~5-count miRNA is noise)","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fbiology\u002Fbio-workflows-smrna-pipeline","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":54,"prompt":64,"zipAvailable":25},[55,58,61],{"tool":56,"command":57},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-workflows-smrna-pipeline",{"tool":59,"command":60},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-workflows-smrna-pipeline",{"tool":62,"command":63},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-workflows-smrna-pipeline","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-workflows-smrna-pipeline\u002FSKILL.md",[66,72],{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},"examples\u002Fsmrna_full_pipeline.sh","SCRIPT","脚本",2953,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-workflows-smrna-pipeline\u002Fexamples\u002Fsmrna_full_pipeline.sh",{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"usage-guide.md","REFERENCE","参考文档",3633,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-workflows-smrna-pipeline\u002Fusage-guide.md",[79,87,94,101,108,115],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":86},"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":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":86},"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":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":86},"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":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":86},"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":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":86},"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":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":86},"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",[],[]]