[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6QE4JFTC8CEVMFXBZG5NA2H":3,"skill-same:01M6QE4JFTC8CEVMFXBZG5NA2H":105},{"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":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":54,"commitSha":55,"skillDirectory":56,"forksCount":14,"repositoryHtmlUrl":57,"repositoryHomepageUrl":58,"ownerHtmlUrl":59,"ownerBlogUrl":60,"ownerDescription":61,"updatedAt":62,"install":63,"resources":76},"01M6QE4JFTC8CEVMFXBZG5NA2H","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.","Tashima-Tarsh\u002FDisha6.6","Tashima-Tarsh","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F269906498?v=4","01M6PBH98X03XERH0HFT4PFB1P","NITISH KUMAR","01M6PBH9DA0M6KM3Z12P848F0K",0,"MIT","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-bulk-rnaseq\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"bulk rnaseq","bulk","rnaseq","quantification","gene","for","matrix","figures","transcriptomics","scientific","design","fastqc","expression","RNA","use","analyze","pydeseq2","Reproducible","run","go","2026-11-10 10:12:30",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.1'\n  category: life-sciences\n  maintainer: Kalaris Labs\n  tags: RNA-seq, transcriptomics, differential expression, alignment, bioinformatics\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\n## Related skills\n\n- `pydeseq2`: Runs differential expression analysis on bulk RNA-seq count data with PyDESeq2, the Python port of DESeq2.\n- `pathway-enrichment`: Run pathway and gene-set enrichment analysis on gene lists or ranked gene data, then interpret the results.\n- `nextflow`: Build, run, and debug Nextflow data pipelines and nf-core workflows end to end.\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\n## Related skills\n\n- `pydeseq2`: Runs differential expression analysis on bulk RNA-seq count data with PyDESeq2, the Python port of DESeq2.\n- `pathway-enrichment`: Run pathway and gene-set enrichment analysis on gene lists or ranked gene data, then interpret the results.\n- `nextflow`: Build, run, and debug Nextflow data pipelines and nf-core workflows end to end.\n",{"name":5,"license":15,"metadata":49,"description":7},{"tags":50,"version":51,"category":52,"maintainer":53},"RNA-seq, transcriptomics, differential expression, alignment, bioinformatics","1.1","life-sciences","Kalaris Labs","main","0da4485785ee599388900be50db1635489d53056",".agents\u002Fskills\u002Fkal-bulk-rnaseq","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6","https:\u002F\u002Fdisha6.6.thenitishkr.in\u002F","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh","www.thenitishkr","thenitishkr | AI • Cyber-security • Research\r\n","2026-11-08 03:33:25",{"source":8,"skillName":5,"commands":64,"prompt":74,"zipAvailable":75},[65,68,71],{"tool":66,"command":67},"npx","npx skills add Tashima-Tarsh\u002FDisha6.6 --skill bulk-rnaseq",{"tool":69,"command":70},"bunx","bunx skills add Tashima-Tarsh\u002FDisha6.6 --skill bulk-rnaseq",{"tool":72,"command":73},"pnpm","pnpm dlx skills add Tashima-Tarsh\u002FDisha6.6 --skill bulk-rnaseq","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-bulk-rnaseq\u002FSKILL.md",true,[77,83,87,91,95,101],{"path":78,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fcounts-and-handoff.md","REFERENCE","参考文档",6133,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-bulk-rnaseq\u002Freferences\u002Fcounts-and-handoff.md",{"path":84,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Fdesign-and-qc.md",5117,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-bulk-rnaseq\u002Freferences\u002Fdesign-and-qc.md",{"path":88,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Fupstream-manual.md",5487,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-bulk-rnaseq\u002Freferences\u002Fupstream-manual.md",{"path":92,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Fupstream-nfcore.md",6186,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-bulk-rnaseq\u002Freferences\u002Fupstream-nfcore.md",{"path":96,"resourceType":97,"resourceTypeDesc":98,"sizeBytes":99,"sourceHtmlUrl":100},"scripts\u002Fbuild_counts_matrix.py","SCRIPT","脚本",8317,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-bulk-rnaseq\u002Fscripts\u002Fbuild_counts_matrix.py",{"path":102,"resourceType":97,"resourceTypeDesc":98,"sizeBytes":103,"sourceHtmlUrl":104},"scripts\u002Fvalidate_samplesheet.py",8130,"https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fkal-bulk-rnaseq\u002Fscripts\u002Fvalidate_samplesheet.py",[106,135,158,183,207,230],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":115,"publishedAt":44},"01M6QRD07D4TGNDK6VJ4EHF8BV","youtube-full","Use when the user needs YouTube transcripts, video search, channel browsing, playlist extraction, or content monitoring. Trigger phrases: 'get the transcript for', 'search YouTube for', 'what are the latest videos on', 'list this playlist', 'monitor this channel', or any request involving a YouTube URL, video ID, or @handle. Do NOT use for downloading video or audio files, YouTube engagement data (likes, comments), or private\u002Fage-restricted videos.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fyoutube-full\u002FSKILL.md",[112],{"categoryNo":113,"categoryName":114,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000016","图像与多媒体",[116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,29,132,133,134],"youtube full","youtube","full","transcript","search","monitoring","data","Video","Audio","list","files","do","get","age","trigger","URL","browsing","request","youtube transcripts",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":44},"01M6QRCJ3112VYPA97YG7KGMC2","x-twitter-growth","X\u002FTwitter growth engine for building audience, crafting viral content, and analyzing engagement. Use when the user wants to grow on X\u002FTwitter, write tweets or threads, analyze their X profile, research competitors on X, plan a posting strategy, or optimize engagement. Complements social-content (generic multi-platform) with X-specific depth: algorithm mechanics, thread engineering, reply strategy, profile optimization, and competitive intelligence via web search.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fx-twitter-growth\u002FSKILL.md",[],[142,143,144,145,120,146,147,148,149,150,39,151,152,153,38,154,155,156,157,29],"twitter","x twitter growth","growth","research","content","engineering","plan","web search","competitors","engine","write","strategy","platform","grow","posting","competitive",{"skillNo":159,"name":160,"nameZh":6,"description":161,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":162,"categories":163,"keywords":165,"publishedAt":44},"01M6QRBN3EHQNJY42RERP7A149","write-a-skill","Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, build, or author a new skill.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwrite-a-skill\u002FSKILL.md",[164],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[166,152,167,168,169,170,171,172,38,173,174,54,175,176,177,178,179,180,181,182],"write a skill","github","create","https","productivity","matt pocock","direct","example","build","new skill","structure","new agent","resources","with","tree","progressive disclosure","author",{"skillNo":184,"name":185,"nameZh":6,"description":186,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":187,"categories":188,"keywords":189,"publishedAt":44},"01M6QRB6G8P33PNGAF9Y69EJ9T","wrap-up","Close out a launched Claude Managed Agent — recap every primitive the founder now owns, regenerate the single-file overview page, and suggest the next 1-2 upgrades. Use when the user says \"wrap up\", \"close this out\", \"what do I own now\", \"give me the summary\", \"recap the agent\", or when the orchestrator routes phase=wrap-up. primitives_inventory.py tables everything owned (agent, environment, session, memory, outcome, deployment); overview_page.py regenerates a self-contained .\u002Fmy-agent\u002Fagent-overview.html; upgrade_suggester.py ranks the next moves from recorded deferrals plus standing hardening steps. Companion to run-without-you; the last stop before phase=done.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwrap-up\u002FSKILL.md",[],[190,191,192,193,194,42,195,196,197,38,198,127,199,200,201,202,203,204,205,206],"wrap up","up","wrap","gemini","deployment","file","hardening","closeout","stop","upgrade","founder","close","companion","you","tables","directions","phase",{"skillNo":208,"name":209,"nameZh":6,"description":210,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":211,"categories":212,"keywords":214,"publishedAt":44},"01M6QRA5AYC1RBFZ39GTWGS3N8","workflow-builder","Design and write deterministic multi-agent workflow scripts (.js files in .claude\u002Fworkflows\u002F) for Claude Code's Workflow tool. Use when a user wants to build, create, author, scaffold, or run a custom Claude Code workflow, orchestrate sub-agents (fan-out, pipeline, loop, judge-panel), or automate a repeatable multi-step task across fresh-context agents.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fworkflow-builder\u002FSKILL.md",[213],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[215,216,217,34,218,168,42,219,220,221,222,223,152,224,126,225,226,227,228,229],"workflow","workflow builder","builder","workflows","code","orchestrate","pipeline","loop","multi-agent","context","across","fresh","scripts","judge","claude code workflow",{"skillNo":231,"name":232,"nameZh":6,"description":233,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":234,"categories":235,"keywords":236,"publishedAt":44},"01M6QR7QMCZESKQA0ERW1E657M","weekly-review","Use when someone wants to run a weekly review, close open loops, audit stalled projects and commitments, get their system back to trusted, restart a lapsed review habit, or says \"\u002Fcs:weekly-review\". Walks David Allen's three-phase loop — GET CLEAR, GET CURRENT, GET CREATIVE — with deterministic scripts that inventory open loops, gate the checklist with named gaps, and score commitment health 0-100.","https:\u002F\u002Fgithub.com\u002FTashima-Tarsh\u002FDisha6.6\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fweekly-review\u002FSKILL.md",[],[237,238,239,240,241,242,243,244,245,222,246,247,248,249,250,251,128,252,253,206],"review","weekly review","weekly","deterministic scripts","reflect","feeds","inventory","open","team","projects","project-management","scanner","conversation","back","project","sprint","cadence"]