[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AS13RDH8BZX2WPFBYBYQ4X":3,"skill-same:01M7AS13RDH8BZX2WPFBYBYQ4X":75},{"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":27,"commitSha":28,"skillDirectory":29,"forksCount":14,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7AS13RDH8BZX2WPFBYBYQ4X","bulk-rnaseq",null,"End-to-end bulk RNA-seq orchestrator — takes raw FASTQ reads through QC and trimming (FastQC, fastp\u002FTrim Galore), alignment and quantification (STAR, Salmon, featureCounts), assembles a gene-level counts matrix, then hands off to differential expression (pydeseq2), pathway\u002FGSEA enrichment (pathway-enrichment), and publication figures (scientific-visualization). Use whenever the user has bulk RNA-seq reads or quant output and wants a complete, reproducible differential-expression workflow — e.g. \"analyze my RNA-seq\", \"FASTQ to DESeq2\", \"run nf-core\u002Frnaseq\", \"STAR\u002FSalmon quantification\", \"build a counts matrix for DESeq2\", or \"go from reads to differentially expressed genes and enriched pathways\". Routes between an nf-core\u002Frnaseq (Nextflow) path and a standalone STAR\u002FSalmon path, and covers experimental design, strandedness, and QC gates. For single-cell RNA-seq use the scanpy skill instead.","nikhilesh-s\u002Fclaude-toolkit","nikhilesh-s","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F123913414?v=4","01M7ARX6NXB6DFY1CCP91599KE","Nikhilesh Suravarjjala","01M7ARX6PFTQKR6ME1K2S4AZ9K",0,"MIT","https:\u002F\u002Fgithub.com\u002Fnikhilesh-s\u002Fclaude-toolkit\u002Fblob\u002Fnik-claude-toolkit\u002Fskills\u002Fbulk-rnaseq\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bulk-rnaseq\ndescription: End-to-end bulk RNA-seq orchestrator — takes raw FASTQ reads through QC and trimming (FastQC, fastp\u002FTrim Galore), alignment and quantification (STAR, Salmon, featureCounts), assembles a gene-level counts matrix, then hands off to differential expression (pydeseq2), pathway\u002FGSEA enrichment (pathway-enrichment), and publication figures (scientific-visualization). Use whenever the user has bulk RNA-seq reads or quant output and wants a complete, reproducible differential-expression workflow — e.g. \"analyze my RNA-seq\", \"FASTQ to DESeq2\", \"run nf-core\u002Frnaseq\", \"STAR\u002FSalmon quantification\", \"build a counts matrix for DESeq2\", or \"go from reads to differentially expressed genes and enriched pathways\". Routes between an nf-core\u002Frnaseq (Nextflow) path and a standalone STAR\u002FSalmon path, and covers experimental design, strandedness, and QC gates. For single-cell RNA-seq use the scanpy skill instead.\nlicense: MIT\nmetadata:\n  version: \"1.0\"\n  skill-author: K-Dense Inc.\n---\n\n# Bulk RNA-seq\n\n## Overview\n\nThis skill orchestrates a complete, **defensible** bulk RNA-seq differential-expression study, from raw sequencing reads to enriched pathways and figures. It is a router, not a reimplementation: most stages already have dedicated skills in this repo, and this skill connects them in the right order, fills the one real gap (raw reads → a gene-level counts matrix), and enforces the design and QC decisions that determine whether the final result is trustworthy.\n\n\"Defensible\" means three things, applied throughout:\n- **Reproducible** — pinned pipeline\u002Ftool versions, containers where possible, recorded parameters, fixed random seeds.\n- **Quality-gated** — QC is inspected and acted on before, during, and after quantification, not skipped.\n- **Statistically sound** — adequate replication, a design that matches the biology, counts handled correctly, and FDR-controlled testing.\n\nThe pipeline is: **FastQC\u002Ftrim → align\u002Fquant (STAR\u002FSalmon) → counts → DE (pydeseq2) → enrichment (pathway-enrichment) → figures**.\n\n## When to Use This Skill\n\nUse this skill when the user wants to:\n- Go from FASTQ files (or a sequencing run) to differentially expressed genes and pathways.\n- Run or configure `nf-core\u002Frnaseq`, or align\u002Fquantify with STAR, Salmon, or featureCounts.\n- Turn Salmon\u002FSTAR\u002FfeatureCounts output into a counts matrix ready for DESeq2\u002FPyDESeq2.\n- Design or sanity-check a bulk RNA-seq experiment (replicates, batch, strandedness) before committing compute.\n- Scope an end-to-end RNA-seq analysis and decide which tools and skills to chain.\n\nThis is **bulk** RNA-seq (samples = biological specimens). For single-cell\u002Fnuclei data use `scanpy`; for the DE statistics alone use `pydeseq2`; for enrichment alone use `pathway-enrichment`.\n\n## The Pipeline at a Glance\n\n```mermaid\nflowchart TD\n    fastq[\"Raw FASTQ + samplesheet\"] --> qc[\"FastQC + MultiQC\"]\n    qc --> trim[\"Trim: fastp \u002F Trim Galore\"]\n    trim --> align[\"Align + quant: STAR and\u002For Salmon\"]\n    align --> counts[\"Gene-level counts matrix\"]\n    counts --> de[\"Differential expression\"]\n    de --> enrich[\"Pathway \u002F GSEA enrichment\"]\n    de --> fig[\"Figures\"]\n    enrich --> fig\n    nfcore[\"nf-core\u002Frnaseq via nextflow skill\"] -.->|\"path A\"| align\n    manual[\"Standalone recipes (this skill)\"] -.->|\"path B\"| align\n    bridge[\"build_counts_matrix.py (this skill)\"] -.-> counts\n    pydeseq2skill[\"pydeseq2 skill\"] -.-> de\n    pwskill[\"pathway-enrichment skill\"] -.-> enrich\n    vizskill[\"scientific-visualization skill\"] -.-> fig\n```\n\n## Two Upstream Paths — Pick One\n\nThe reads → counts stage can be run two ways. They produce equivalent gene counts; choose by context, then stay on that path.\n\n| Use **Path A — `nf-core\u002Frnaseq`** when… | Use **Path B — standalone tools** when… |\n|------------------------------------------|------------------------------------------|\n| You want the field-standard, audited, citable pipeline with one command | You have a few samples and want to learn\u002Finspect each step |\n| Many samples, or you'll scale to HPC\u002Fcloud | No Nextflow\u002Fcontainers available, or a constrained environment |\n| Reproducibility and a full MultiQC report matter most | You need a non-standard step the pipeline doesn't expose |\n| → Drive it through the **`nextflow`** skill | → Follow `references\u002Fupstream-manual.md` |\n\nWhen unsure, prefer **Path A**: `nf-core\u002Frnaseq` already wires together FastQC → trimming → STAR\u002FSalmon → quantification → tximport → MultiQC with sensible, reviewed defaults, which is the most defensible option. Path B exists for transparency and constrained setups.\n\nBoth paths converge on a **gene-level counts matrix**, after which the workflow is identical.\n\n## Setup\n\n```bash\n# This skill's glue (bridge + handoffs) — Python\nuv pip install pytximport pandas\n\n# Downstream skills install their own deps:\n#   pydeseq2 skill           -> uv pip install pydeseq2\n#   pathway-enrichment skill -> uv pip install gseapy gprofiler-official\n\n# Path A (nf-core): only Nextflow + a container engine are needed — see the `nextflow` skill.\n\n# Path B (standalone tools): install via bioconda. Pin versions for reproducibility.\nconda create -n rnaseq -c bioconda -c conda-forge \\\n  fastqc fastp trim-galore \"star=2.7.11b\" \"salmon=1.10.3\" subread multiqc\n```\n\nRecord the exact versions you use (pipeline revision, tool versions, reference genome + annotation release) — they belong in the methods section and make the analysis reproducible.\n\n## Quick Start\n\n### Path A — nf-core\u002Frnaseq (recommended)\n\n```bash\n# 0. Validate the samplesheet first (catches the most common failures early)\npython scripts\u002Fvalidate_samplesheet.py --samplesheet samplesheet.csv\n\n# 1. Smoke-test the environment with tiny bundled data\nnextflow run nf-core\u002Frnaseq -r 3.26.0 -profile test,docker --outdir test_results\n\n# 2. Real run: pin the revision, pick an aligner, pass a samplesheet + reference\nnextflow run nf-core\u002Frnaseq -r 3.26.0 \\\n  -profile docker \\\n  --input samplesheet.csv \\\n  --genome GRCh38 \\\n  --aligner star_salmon \\\n  --outdir results \\\n  -resume\n```\n\n`nf-core\u002Frnaseq` runs tximport internally, so gene counts come out **already merged** — no bridge script needed. Use `results\u002Fstar_salmon\u002Fsalmon.merged.gene_counts_length_scaled.tsv` for DE. Samplesheet format, aligner choice, and outputs: `references\u002Fupstream-nfcore.md`. For engine\u002FHPC\u002Fcloud\u002Fcontainer detail, use the **`nextflow`** skill.\n\n### Path B — standalone STAR\u002FSalmon (abbreviated)\n\n```bash\nfastqc -o qc\u002F reads\u002F*.fastq.gz                      # 1. QC raw reads\nfastp -i s1_R1.fq.gz -I s1_R2.fq.gz \\\n      -o s1_R1.trim.fq.gz -O s1_R2.trim.fq.gz \\\n      --thread 4 -j s1.fastp.json                   # 2. Trim adapters\u002Flow-quality\nsalmon quant -i salmon_index -l A \\\n      -1 s1_R1.trim.fq.gz -2 s1_R2.trim.fq.gz \\\n      --gcBias --seqBias -p 8 -o quant\u002Fs1            # 3. Quantify (per sample)\n```\n\nFull recipes (FastQC, fastp\u002FTrim Galore, STAR index+align+`--quantMode GeneCounts`, Salmon decoy-aware index, featureCounts, strandedness): `references\u002Fupstream-manual.md`.\n\n### Counts → DE → enrichment (both paths)\n\n```bash\n# Path B only: assemble a gene x sample counts matrix + metadata template for PyDESeq2\npython scripts\u002Fbuild_counts_matrix.py --from salmon \\\n  --quant-dir quant\u002F --tx2gene tx2gene.tsv --output-dir counts\u002F\n\n# Then hand off (see the dedicated skills):\n#   pydeseq2:           counts.csv + metadata.csv -> DE table (log2FC, padj, stat)\n#   pathway-enrichment: rank by `stat` (GSEA) or padj+|LFC| hit list (ORA)\n#   scientific-visualization \u002F matplotlib: volcano, MA, heatmap, PCA, enrichment dotplot\n```\n\n## Stage-by-Stage Workflow\n\nWork top to bottom. Each stage names the skill or file that owns the detail. Don't skip the design\u002FQC stages — they are where bulk RNA-seq studies most often go wrong.\n\n1. **Design & sample sheet.** Confirm ≥3 biological replicates per group, identify batch\u002Fconfounders, and choose the comparison(s). Build the samplesheet and validate it with `scripts\u002Fvalidate_samplesheet.py`. Rationale and rules: `references\u002Fdesign-and-qc.md`.\n2. **Raw-read QC.** FastQC per file; aggregate with MultiQC. Check per-base quality, adapter content, duplication, and over-representation. Thresholds: `references\u002Fdesign-and-qc.md`.\n3. **Trimming.** Remove adapters and low-quality tails (via `fastp` or `Trim Galore`). Re-run FastQC to confirm. Recipes: `references\u002Fupstream-manual.md` (Path A does this for you).\n4. **Align \u002F quantify.** STAR (genome alignment + `--quantMode GeneCounts`) and\u002For Salmon (transcript quasi-mapping, decoy-aware). Determine strandedness — it is easy to get wrong and silently halves your counts. Detail: `references\u002Fupstream-manual.md`; pipeline params: `references\u002Fupstream-nfcore.md`.\n5. **Build the counts matrix.** Turn quant output into a gene × sample integer matrix and a metadata template (`scripts\u002Fbuild_counts_matrix.py`). The estimated-count and gene-ID-mapping nuances live in `references\u002Fcounts-and-handoff.md`.\n6. **Differential expression → `pydeseq2` skill.** Load `counts.csv` + `metadata.csv`, set the design (e.g. `~batch + condition`), fit, and test with FDR control. Inspect the PCA and p-value histogram as QC.\n7. **Enrichment → `pathway-enrichment` skill.** For GSEA, rank the *full* gene list by the DESeq2 `stat`; for ORA, pass the thresholded hit list (padj \u003C 0.05, optionally |log2FC| > 1). Map gene IDs to symbols first.\n8. **Figures → `scientific-visualization` skill.** Volcano, MA, sample-distance heatmap, PCA, and enrichment dotplots, plus the MultiQC report for the QC narrative.\n\n## The counts → DE bridge (the key glue)\n\nThis is the one stage with no upstream\u002Fdownstream skill, so this skill owns it. `scripts\u002Fbuild_counts_matrix.py` converts quant output into exactly what `pydeseq2` expects:\n\n- **Salmon** (`--from salmon`): aggregates per-sample `quant.sf` to gene level with `pytximport` using `counts_from_abundance=\"length_scaled_tpm\"` (the right choice for gene-level DE), needs a `tx2gene` map.\n- **STAR** (`--from star`): reads each `ReadsPerGene.out.tab`, selecting the column for your `--strandedness` (unstranded\u002Fforward\u002Freverse).\n- **featureCounts** (`--from featurecounts`): parses the combined `featureCounts` matrix.\n\nIt writes `counts.csv` (genes × samples, integers) and `metadata_template.csv` (one row per sample) for you to fill in. **Salmon\u002FRSEM counts are estimates (non-integer); they are rounded to integers** because PyDESeq2 requires integer counts — see `references\u002Fcounts-and-handoff.md` for why this is acceptable with `length_scaled_tpm` and how it differs from the offset-based DESeq2+tximport route. That reference also covers Ensembl→symbol mapping (needed before enrichment) and the exact orientation PyDESeq2 wants.\n\n## Common Pitfalls\n\nThese cause most wrong or irreproducible bulk RNA-seq results:\n\n1. **Too few replicates.** \u003C3 biological replicates per group gives almost no power and unstable dispersion estimates. More replicates beat deeper sequencing.\n2. **Confounded batch and condition.** If every treated sample was processed on a different day\u002Flane than controls, the effect is unrecoverable. Randomize, and model known batches (`~batch + condition`). See `references\u002Fdesign-and-qc.md`.\n3. **Wrong strandedness.** Choosing the wrong STAR column or featureCounts `-s`\u002FSalmon library type silently discards ~half the reads. Use Salmon `-l A` or infer strandedness, and verify the assigned-reads fraction.\n4. **Feeding TPM\u002FFPKM to DESeq2.** DESeq2 needs raw (or length-scaled) **counts**, never TPM\u002FFPKM\u002Fnormalized values. The bridge handles this.\n5. **Non-integer counts.** PyDESeq2 requires integers; round Salmon estimates (the bridge does this).\n6. **Gene-ID mismatch into enrichment.** DESeq2 output is often Ensembl IDs; Enrichr\u002FMSigDB want symbols. Map IDs before `pathway-enrichment` or \"nothing is significant\".\n7. **Skipping post-quant QC.** Always look at the PCA and sample-distance heatmap before trusting DE — they expose swapped labels, outliers, and hidden batches.\n8. **Mixing aligners across samples.** Quantify every sample with the same tool, version, reference, and parameters.\n9. **Unpinned versions.** \"latest\" pipelines\u002Fgenomes make results unreproducible; pin `-r`, tool versions, and the genome\u002Fannotation release.\n\n## Integration with Other Skills\n\n- **Upstream execution:** `nextflow` (runs `nf-core\u002Frnaseq`, Path A; HPC\u002Fcloud\u002Fcontainers).\n- **Reference data \u002F gene IDs:** `gget` (`gget ref` for genome+GTF, `gget info`\u002F`gget search` for ID mapping), `database-lookup` (Ensembl\u002FNCBI), `biopython`\u002F`pysam` (FASTA\u002FBAM handling).\n- **Differential expression:** `pydeseq2` (the DE engine this skill hands counts to).\n- **Enrichment:** `pathway-enrichment` (ORA + GSEA; its `scripts\u002Frun_enrichment.py` reads a DESeq2 results CSV directly).\n- **Figures & reporting:** `scientific-visualization`, `matplotlib`, `seaborn`; `scientific-writing` for the methods\u002Fresults narrative.\n- **Related but distinct:** `scanpy` (single-cell), `statistical-analysis` (multiple-testing depth).\n\n## Reference Files\n\nRead the relevant file when you need depth — each is self-contained:\n\n- `references\u002Fupstream-nfcore.md` — Path A: samplesheet format, `--aligner`\u002F`--pseudo_aligner` choice, key params, the `salmon.merged.gene_counts*.tsv` outputs, MultiQC, and what to hand to `pydeseq2`.\n- `references\u002Fupstream-manual.md` — Path B: FastQC, fastp\u002FTrim Galore, STAR genome index + alignment + `--quantMode GeneCounts`, Salmon decoy-aware index + `quant`, featureCounts, and how to determine strandedness.\n- `references\u002Fcounts-and-handoff.md` — turning quant output into PyDESeq2-ready `counts.csv`\u002F`metadata.csv` (pytximport, STAR column selection, featureCounts), the integer\u002Festimated-count nuance, Ensembl→symbol mapping, and the DE→enrichment rank\u002Fhit-list recipe.\n- `references\u002Fdesign-and-qc.md` — experimental design (replication, batch, confounding, design formulas) and QC-metric interpretation (mapping rate, duplication, rRNA, complexity, PCA\u002Foutliers) — the defensible-pipeline backbone.\n\n## Resources\n\n- nf-core\u002Frnaseq: https:\u002F\u002Fnf-co.re\u002Frnaseq · STAR: https:\u002F\u002Fgithub.com\u002Falexdobin\u002FSTAR · Salmon: https:\u002F\u002Fsalmon.readthedocs.io\n- fastp: https:\u002F\u002Fgithub.com\u002FOpenGene\u002Ffastp · Trim Galore: https:\u002F\u002Fgithub.com\u002FFelixKrueger\u002FTrimGalore · MultiQC: https:\u002F\u002Fmultiqc.info\n- pytximport: https:\u002F\u002Fpytximport.complextissue.com · featureCounts (Subread): https:\u002F\u002Fsubread.sourceforge.net\n- Method background: Love et al. 2014 (DESeq2) DOI 10.1186\u002Fs13059-014-0550-8 · Soneson et al. 2015 (tximport) DOI 10.12688\u002Ff1000research.7563.2\n","# Bulk RNA-seq\n\n## Overview\n\nThis skill orchestrates a complete, **defensible** bulk RNA-seq differential-expression study, from raw sequencing reads to enriched pathways and figures. It is a router, not a reimplementation: most stages already have dedicated skills in this repo, and this skill connects them in the right order, fills the one real gap (raw reads → a gene-level counts matrix), and enforces the design and QC decisions that determine whether the final result is trustworthy.\n\n\"Defensible\" means three things, applied throughout:\n- **Reproducible** — pinned pipeline\u002Ftool versions, containers where possible, recorded parameters, fixed random seeds.\n- **Quality-gated** — QC is inspected and acted on before, during, and after quantification, not skipped.\n- **Statistically sound** — adequate replication, a design that matches the biology, counts handled correctly, and FDR-controlled testing.\n\nThe pipeline is: **FastQC\u002Ftrim → align\u002Fquant (STAR\u002FSalmon) → counts → DE (pydeseq2) → enrichment (pathway-enrichment) → figures**.\n\n## When to Use This Skill\n\nUse this skill when the user wants to:\n- Go from FASTQ files (or a sequencing run) to differentially expressed genes and pathways.\n- Run or configure `nf-core\u002Frnaseq`, or align\u002Fquantify with STAR, Salmon, or featureCounts.\n- Turn Salmon\u002FSTAR\u002FfeatureCounts output into a counts matrix ready for DESeq2\u002FPyDESeq2.\n- Design or sanity-check a bulk RNA-seq experiment (replicates, batch, strandedness) before committing compute.\n- Scope an end-to-end RNA-seq analysis and decide which tools and skills to chain.\n\nThis is **bulk** RNA-seq (samples = biological specimens). For single-cell\u002Fnuclei data use `scanpy`; for the DE statistics alone use `pydeseq2`; for enrichment alone use `pathway-enrichment`.\n\n## The Pipeline at a Glance\n\n```mermaid\nflowchart TD\n    fastq[\"Raw FASTQ + samplesheet\"] --> qc[\"FastQC + MultiQC\"]\n    qc --> trim[\"Trim: fastp \u002F Trim Galore\"]\n    trim --> align[\"Align + quant: STAR and\u002For Salmon\"]\n    align --> counts[\"Gene-level counts matrix\"]\n    counts --> de[\"Differential expression\"]\n    de --> enrich[\"Pathway \u002F GSEA enrichment\"]\n    de --> fig[\"Figures\"]\n    enrich --> fig\n    nfcore[\"nf-core\u002Frnaseq via nextflow skill\"] -.->|\"path A\"| align\n    manual[\"Standalone recipes (this skill)\"] -.->|\"path B\"| align\n    bridge[\"build_counts_matrix.py (this skill)\"] -.-> counts\n    pydeseq2skill[\"pydeseq2 skill\"] -.-> de\n    pwskill[\"pathway-enrichment skill\"] -.-> enrich\n    vizskill[\"scientific-visualization skill\"] -.-> fig\n```\n\n## Two Upstream Paths — Pick One\n\nThe reads → counts stage can be run two ways. They produce equivalent gene counts; choose by context, then stay on that path.\n\n| Use **Path A — `nf-core\u002Frnaseq`** when… | Use **Path B — standalone tools** when… |\n|------------------------------------------|------------------------------------------|\n| You want the field-standard, audited, citable pipeline with one command | You have a few samples and want to learn\u002Finspect each step |\n| Many samples, or you'll scale to HPC\u002Fcloud | No Nextflow\u002Fcontainers available, or a constrained environment |\n| Reproducibility and a full MultiQC report matter most | You need a non-standard step the pipeline doesn't expose |\n| → Drive it through the **`nextflow`** skill | → Follow `references\u002Fupstream-manual.md` |\n\nWhen unsure, prefer **Path A**: `nf-core\u002Frnaseq` already wires together FastQC → trimming → STAR\u002FSalmon → quantification → tximport → MultiQC with sensible, reviewed defaults, which is the most defensible option. Path B exists for transparency and constrained setups.\n\nBoth paths converge on a **gene-level counts matrix**, after which the workflow is identical.\n\n## Setup\n\n```bash\n# This skill's glue (bridge + handoffs) — Python\nuv pip install pytximport pandas\n\n# Downstream skills install their own deps:\n#   pydeseq2 skill           -> uv pip install pydeseq2\n#   pathway-enrichment skill -> uv pip install gseapy gprofiler-official\n\n# Path A (nf-core): only Nextflow + a container engine are needed — see the `nextflow` skill.\n\n# Path B (standalone tools): install via bioconda. Pin versions for reproducibility.\nconda create -n rnaseq -c bioconda -c conda-forge \\\n  fastqc fastp trim-galore \"star=2.7.11b\" \"salmon=1.10.3\" subread multiqc\n```\n\nRecord the exact versions you use (pipeline revision, tool versions, reference genome + annotation release) — they belong in the methods section and make the analysis reproducible.\n\n## Quick Start\n\n### Path A — nf-core\u002Frnaseq (recommended)\n\n```bash\n# 0. Validate the samplesheet first (catches the most common failures early)\npython scripts\u002Fvalidate_samplesheet.py --samplesheet samplesheet.csv\n\n# 1. Smoke-test the environment with tiny bundled data\nnextflow run nf-core\u002Frnaseq -r 3.26.0 -profile test,docker --outdir test_results\n\n# 2. Real run: pin the revision, pick an aligner, pass a samplesheet + reference\nnextflow run nf-core\u002Frnaseq -r 3.26.0 \\\n  -profile docker \\\n  --input samplesheet.csv \\\n  --genome GRCh38 \\\n  --aligner star_salmon \\\n  --outdir results \\\n  -resume\n```\n\n`nf-core\u002Frnaseq` runs tximport internally, so gene counts come out **already merged** — no bridge script needed. Use `results\u002Fstar_salmon\u002Fsalmon.merged.gene_counts_length_scaled.tsv` for DE. Samplesheet format, aligner choice, and outputs: `references\u002Fupstream-nfcore.md`. For engine\u002FHPC\u002Fcloud\u002Fcontainer detail, use the **`nextflow`** skill.\n\n### Path B — standalone STAR\u002FSalmon (abbreviated)\n\n```bash\nfastqc -o qc\u002F reads\u002F*.fastq.gz                      # 1. QC raw reads\nfastp -i s1_R1.fq.gz -I s1_R2.fq.gz \\\n      -o s1_R1.trim.fq.gz -O s1_R2.trim.fq.gz \\\n      --thread 4 -j s1.fastp.json                   # 2. Trim adapters\u002Flow-quality\nsalmon quant -i salmon_index -l A \\\n      -1 s1_R1.trim.fq.gz -2 s1_R2.trim.fq.gz \\\n      --gcBias --seqBias -p 8 -o quant\u002Fs1            # 3. Quantify (per sample)\n```\n\nFull recipes (FastQC, fastp\u002FTrim Galore, STAR index+align+`--quantMode GeneCounts`, Salmon decoy-aware index, featureCounts, strandedness): `references\u002Fupstream-manual.md`.\n\n### Counts → DE → enrichment (both paths)\n\n```bash\n# Path B only: assemble a gene x sample counts matrix + metadata template for PyDESeq2\npython scripts\u002Fbuild_counts_matrix.py --from salmon \\\n  --quant-dir quant\u002F --tx2gene tx2gene.tsv --output-dir counts\u002F\n\n# Then hand off (see the dedicated skills):\n#   pydeseq2:           counts.csv + metadata.csv -> DE table (log2FC, padj, stat)\n#   pathway-enrichment: rank by `stat` (GSEA) or padj+|LFC| hit list (ORA)\n#   scientific-visualization \u002F matplotlib: volcano, MA, heatmap, PCA, enrichment dotplot\n```\n\n## Stage-by-Stage Workflow\n\nWork top to bottom. Each stage names the skill or file that owns the detail. Don't skip the design\u002FQC stages — they are where bulk RNA-seq studies most often go wrong.\n\n1. **Design & sample sheet.** Confirm ≥3 biological replicates per group, identify batch\u002Fconfounders, and choose the comparison(s). Build the samplesheet and validate it with `scripts\u002Fvalidate_samplesheet.py`. Rationale and rules: `references\u002Fdesign-and-qc.md`.\n2. **Raw-read QC.** FastQC per file; aggregate with MultiQC. Check per-base quality, adapter content, duplication, and over-representation. Thresholds: `references\u002Fdesign-and-qc.md`.\n3. **Trimming.** Remove adapters and low-quality tails (via `fastp` or `Trim Galore`). Re-run FastQC to confirm. Recipes: `references\u002Fupstream-manual.md` (Path A does this for you).\n4. **Align \u002F quantify.** STAR (genome alignment + `--quantMode GeneCounts`) and\u002For Salmon (transcript quasi-mapping, decoy-aware). Determine strandedness — it is easy to get wrong and silently halves your counts. Detail: `references\u002Fupstream-manual.md`; pipeline params: `references\u002Fupstream-nfcore.md`.\n5. **Build the counts matrix.** Turn quant output into a gene × sample integer matrix and a metadata template (`scripts\u002Fbuild_counts_matrix.py`). The estimated-count and gene-ID-mapping nuances live in `references\u002Fcounts-and-handoff.md`.\n6. **Differential expression → `pydeseq2` skill.** Load `counts.csv` + `metadata.csv`, set the design (e.g. `~batch + condition`), fit, and test with FDR control. Inspect the PCA and p-value histogram as QC.\n7. **Enrichment → `pathway-enrichment` skill.** For GSEA, rank the *full* gene list by the DESeq2 `stat`; for ORA, pass the thresholded hit list (padj \u003C 0.05, optionally |log2FC| > 1). Map gene IDs to symbols first.\n8. **Figures → `scientific-visualization` skill.** Volcano, MA, sample-distance heatmap, PCA, and enrichment dotplots, plus the MultiQC report for the QC narrative.\n\n## The counts → DE bridge (the key glue)\n\nThis is the one stage with no upstream\u002Fdownstream skill, so this skill owns it. `scripts\u002Fbuild_counts_matrix.py` converts quant output into exactly what `pydeseq2` expects:\n\n- **Salmon** (`--from salmon`): aggregates per-sample `quant.sf` to gene level with `pytximport` using `counts_from_abundance=\"length_scaled_tpm\"` (the right choice for gene-level DE), needs a `tx2gene` map.\n- **STAR** (`--from star`): reads each `ReadsPerGene.out.tab`, selecting the column for your `--strandedness` (unstranded\u002Fforward\u002Freverse).\n- **featureCounts** (`--from featurecounts`): parses the combined `featureCounts` matrix.\n\nIt writes `counts.csv` (genes × samples, integers) and `metadata_template.csv` (one row per sample) for you to fill in. **Salmon\u002FRSEM counts are estimates (non-integer); they are rounded to integers** because PyDESeq2 requires integer counts — see `references\u002Fcounts-and-handoff.md` for why this is acceptable with `length_scaled_tpm` and how it differs from the offset-based DESeq2+tximport route. That reference also covers Ensembl→symbol mapping (needed before enrichment) and the exact orientation PyDESeq2 wants.\n\n## Common Pitfalls\n\nThese cause most wrong or irreproducible bulk RNA-seq results:\n\n1. **Too few replicates.** \u003C3 biological replicates per group gives almost no power and unstable dispersion estimates. More replicates beat deeper sequencing.\n2. **Confounded batch and condition.** If every treated sample was processed on a different day\u002Flane than controls, the effect is unrecoverable. Randomize, and model known batches (`~batch + condition`). See `references\u002Fdesign-and-qc.md`.\n3. **Wrong strandedness.** Choosing the wrong STAR column or featureCounts `-s`\u002FSalmon library type silently discards ~half the reads. Use Salmon `-l A` or infer strandedness, and verify the assigned-reads fraction.\n4. **Feeding TPM\u002FFPKM to DESeq2.** DESeq2 needs raw (or length-scaled) **counts**, never TPM\u002FFPKM\u002Fnormalized values. The bridge handles this.\n5. **Non-integer counts.** PyDESeq2 requires integers; round Salmon estimates (the bridge does this).\n6. **Gene-ID mismatch into enrichment.** DESeq2 output is often Ensembl IDs; Enrichr\u002FMSigDB want symbols. Map IDs before `pathway-enrichment` or \"nothing is significant\".\n7. **Skipping post-quant QC.** Always look at the PCA and sample-distance heatmap before trusting DE — they expose swapped labels, outliers, and hidden batches.\n8. **Mixing aligners across samples.** Quantify every sample with the same tool, version, reference, and parameters.\n9. **Unpinned versions.** \"latest\" pipelines\u002Fgenomes make results unreproducible; pin `-r`, tool versions, and the genome\u002Fannotation release.\n\n## Integration with Other Skills\n\n- **Upstream execution:** `nextflow` (runs `nf-core\u002Frnaseq`, Path A; HPC\u002Fcloud\u002Fcontainers).\n- **Reference data \u002F gene IDs:** `gget` (`gget ref` for genome+GTF, `gget info`\u002F`gget search` for ID mapping), `database-lookup` (Ensembl\u002FNCBI), `biopython`\u002F`pysam` (FASTA\u002FBAM handling).\n- **Differential expression:** `pydeseq2` (the DE engine this skill hands counts to).\n- **Enrichment:** `pathway-enrichment` (ORA + GSEA; its `scripts\u002Frun_enrichment.py` reads a DESeq2 results CSV directly).\n- **Figures & reporting:** `scientific-visualization`, `matplotlib`, `seaborn`; `scientific-writing` for the methods\u002Fresults narrative.\n- **Related but distinct:** `scanpy` (single-cell), `statistical-analysis` (multiple-testing depth).\n\n## Reference Files\n\nRead the relevant file when you need depth — each is self-contained:\n\n- `references\u002Fupstream-nfcore.md` — Path A: samplesheet format, `--aligner`\u002F`--pseudo_aligner` choice, key params, the `salmon.merged.gene_counts*.tsv` outputs, MultiQC, and what to hand to `pydeseq2`.\n- `references\u002Fupstream-manual.md` — Path B: FastQC, fastp\u002FTrim Galore, STAR genome index + alignment + `--quantMode GeneCounts`, Salmon decoy-aware index + `quant`, featureCounts, and how to determine strandedness.\n- `references\u002Fcounts-and-handoff.md` — turning quant output into PyDESeq2-ready `counts.csv`\u002F`metadata.csv` (pytximport, STAR column selection, featureCounts), the integer\u002Festimated-count nuance, Ensembl→symbol mapping, and the DE→enrichment rank\u002Fhit-list recipe.\n- `references\u002Fdesign-and-qc.md` — experimental design (replication, batch, confounding, design formulas) and QC-metric interpretation (mapping rate, duplication, rRNA, complexity, PCA\u002Foutliers) — the defensible-pipeline backbone.\n\n## Resources\n\n- nf-core\u002Frnaseq: https:\u002F\u002Fnf-co.re\u002Frnaseq · STAR: https:\u002F\u002Fgithub.com\u002Falexdobin\u002FSTAR · Salmon: https:\u002F\u002Fsalmon.readthedocs.io\n- fastp: https:\u002F\u002Fgithub.com\u002FOpenGene\u002Ffastp · Trim Galore: https:\u002F\u002Fgithub.com\u002FFelixKrueger\u002FTrimGalore · MultiQC: https:\u002F\u002Fmultiqc.info\n- pytximport: https:\u002F\u002Fpytximport.complextissue.com · featureCounts (Subread): https:\u002F\u002Fsubread.sourceforge.net\n- Method background: Love et al. 2014 (DESeq2) DOI 10.1186\u002Fs13059-014-0550-8 · Soneson et al. 2015 (tximport) DOI 10.12688\u002Ff1000research.7563.2\n",{"name":5,"license":15,"metadata":24,"description":7},{"version":25,"skill-author":26},"1.0","K-Dense Inc.","nik-claude-toolkit","4feaa2876384b593d9e30d9190bc56985eeeeb8e","skills\u002Fbulk-rnaseq","https:\u002F\u002Fgithub.com\u002Fnikhilesh-s\u002Fclaude-toolkit","https:\u002F\u002Fgithub.com\u002Fnikhilesh-s","2026-10-22 14:30:58",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add nikhilesh-s\u002Fclaude-toolkit --skill bulk-rnaseq",{"tool":39,"command":40},"bunx","bunx skills add nikhilesh-s\u002Fclaude-toolkit --skill bulk-rnaseq",{"tool":42,"command":43},"pnpm","pnpm dlx skills add nikhilesh-s\u002Fclaude-toolkit --skill bulk-rnaseq","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fnikhilesh-s\u002Fclaude-toolkit\u002Fblob\u002Fnik-claude-toolkit\u002Fskills\u002Fbulk-rnaseq\u002FSKILL.md",true,[47,53,57,61,65,71],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"references\u002Fcounts-and-handoff.md","REFERENCE","参考文档",6133,"https:\u002F\u002Fgithub.com\u002Fnikhilesh-s\u002Fclaude-toolkit\u002Fblob\u002Fnik-claude-toolkit\u002Fskills\u002Fbulk-rnaseq\u002Freferences\u002Fcounts-and-handoff.md",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"references\u002Fdesign-and-qc.md",5117,"https:\u002F\u002Fgithub.com\u002Fnikhilesh-s\u002Fclaude-toolkit\u002Fblob\u002Fnik-claude-toolkit\u002Fskills\u002Fbulk-rnaseq\u002Freferences\u002Fdesign-and-qc.md",{"path":58,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":59,"sourceHtmlUrl":60},"references\u002Fupstream-manual.md",5487,"https:\u002F\u002Fgithub.com\u002Fnikhilesh-s\u002Fclaude-toolkit\u002Fblob\u002Fnik-claude-toolkit\u002Fskills\u002Fbulk-rnaseq\u002Freferences\u002Fupstream-manual.md",{"path":62,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":63,"sourceHtmlUrl":64},"references\u002Fupstream-nfcore.md",6186,"https:\u002F\u002Fgithub.com\u002Fnikhilesh-s\u002Fclaude-toolkit\u002Fblob\u002Fnik-claude-toolkit\u002Fskills\u002Fbulk-rnaseq\u002Freferences\u002Fupstream-nfcore.md",{"path":66,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":70},"scripts\u002Fbuild_counts_matrix.py","SCRIPT","脚本",8081,"https:\u002F\u002Fgithub.com\u002Fnikhilesh-s\u002Fclaude-toolkit\u002Fblob\u002Fnik-claude-toolkit\u002Fskills\u002Fbulk-rnaseq\u002Fscripts\u002Fbuild_counts_matrix.py",{"path":72,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":73,"sourceHtmlUrl":74},"scripts\u002Fvalidate_samplesheet.py",8130,"https:\u002F\u002Fgithub.com\u002Fnikhilesh-s\u002Fclaude-toolkit\u002Fblob\u002Fnik-claude-toolkit\u002Fskills\u002Fbulk-rnaseq\u002Fscripts\u002Fvalidate_samplesheet.py",[76,83,91,98,105,112],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7AT8339CZMCRMRZP6G1R329","zarr-python","Chunked N-D arrays for cloud storage (Zarr-Python 3). Compressed arrays, parallel I\u002FO, S3\u002FGCS via fsspec, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","https:\u002F\u002Fgithub.com\u002Fnikhilesh-s\u002Fclaude-toolkit\u002Fblob\u002Fnik-claude-toolkit\u002Fskills\u002Fzarr-python\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":87,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7AT77E7JPH96ETQBNDVVYDM","video-use","Edit any video by conversation. Transcribe, cut, color grade, generate overlay animations, burn subtitles — for talking heads, montages, tutorials, travel, interviews. No presets, no menus. Ask questions, confirm the plan, execute, iterate, persist. Production-correctness rules are hard; everything else is artistic freedom.","https:\u002F\u002Fgithub.com\u002Fnikhilesh-s\u002Fclaude-toolkit\u002Fblob\u002Fnik-claude-toolkit\u002Fskills\u002Fvideo-use\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fnikhilesh-s\u002Fclaude-toolkit\u002Fblob\u002Fnik-claude-toolkit\u002Fskills\u002Fvideo-use\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M7AT6YVX000D73Q40SBPZYKP","venue-templates","Prepare journal manuscripts, conference papers, research posters, and grant documents using venue-specific formatting guidance and bundled LaTeX scaffolds. Use when selecting an official template, checking current page or anonymity rules, adapting academic writing to a venue, or inspecting a submission PDF.","https:\u002F\u002Fgithub.com\u002Fnikhilesh-s\u002Fclaude-toolkit\u002Fblob\u002Fnik-claude-toolkit\u002Fskills\u002Fvenue-templates\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":19},"01M7AT6SGGBENKX1G6V8V9G2MJ","vaex","Use this skill for processing and analyzing large tabular datasets (billions of rows) that exceed available RAM. Vaex excels at out-of-core DataFrame operations, lazy evaluation, fast aggregations, efficient visualization of big data, and machine learning on large datasets. Apply when users need to work with large CSV\u002FHDF5\u002FArrow\u002FParquet files, perform fast statistics on massive datasets, create visualizations of big data, or build ML pipelines that do not fit in memory.","https:\u002F\u002Fgithub.com\u002Fnikhilesh-s\u002Fclaude-toolkit\u002Fblob\u002Fnik-claude-toolkit\u002Fskills\u002Fvaex\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":19},"01M7AT6HHDJ54MR4HDPFHJYR7G","usfiscaldata","Query the U.S. Treasury Fiscal Data REST API for federal financial data. No API key required. Use for national debt (Debt to the Penny), Daily Treasury Statements, Monthly Treasury Statements, Treasury securities auctions, interest rates, foreign exchange rates, savings bonds, or U.S. government revenue and spending statistics.","https:\u002F\u002Fgithub.com\u002Fnikhilesh-s\u002Fclaude-toolkit\u002Fblob\u002Fnik-claude-toolkit\u002Fskills\u002Fusfiscaldata\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":19},"01M7AT662JFE4THBVAZBB3ANJD","uncertainty-and-units","Track physical units and propagate measurement uncertainty in scientific calculations using pint and uncertainties. Use for unit conversion and dimensional checking, GUM uncertainty budgets, Type A and Type B evaluation, coverage factors and expanded uncertainty, Monte Carlo propagation, significant-figure and plus-minus reporting, error propagation through curve fits, CODATA constants, auditing Python code for stripped units or broken uncertainty propagation, and order-of-magnitude plausibility checks using dimensionless groups (Reynolds, Peclet, Damkohler, Knudsen, Biot, Womersley), characteristic scales such as diffusion time or Debye length, and observed magnitude ranges. Trigger on \"is this number physically reasonable\", \"sanity check these units\", \"what regime is this flow in\", or a result that looks off by orders of magnitude.","https:\u002F\u002Fgithub.com\u002Fnikhilesh-s\u002Fclaude-toolkit\u002Fblob\u002Fnik-claude-toolkit\u002Fskills\u002Funcertainty-and-units\u002FSKILL.md",[],[]]