bulk-rnaseq – skill Dữ liệu & Khoa học cho agent AI
Chuẩn bị đầu ra FASTQ, Salmon, STAR hoặc featureCounts của bulk RNA-seq để phân tích biểu hiện gen vi sai ở mức gene. Bao gồm nf-core/rnaseq và định lượng độc lập, lặp sinh học, strandedness, nguồn gốc tham chiếu, lắp ráp ma trận đếm đã kiểm chứng và bàn giao cho PyDESeq2. Dùng cho phân tích từ FASTQ đến số đếm, cấu hình nf-core/rnaseq...
Cài skill bulk-rnaseq bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/bulk-rnaseq-133ff.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /bulk-rnaseq – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/bulk-rnaseq-133ff.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $bulk-rnaseq – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/bulk-rnaseq-133ff.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /bulk-rnaseq – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/bulk-rnaseq-133ff.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /bulk-rnaseq – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Bulk RNA-seq
Overview
This skill prepares bulk RNA-seq reads and quantification output for a reproducible gene-level comparison. It owns sample validation, reads-to-counts recipes, and the count/metadata handoff; downstream statistical fitting and enrichment remain in their specialist skills.
"Defensible" means three things, applied throughout:
- Reproducible — pinned pipeline/tool versions, containers where possible, recorded parameters, fixed random seeds.
- Quality-gated — QC is inspected and acted on before, during, and after quantification, not skipped.
- Statistically sound — adequate replication, a design that matches the biology, counts handled correctly, and FDR-controlled testing.
The pipeline is: FastQC/trim → align/quant (STAR/Salmon) → counts → DE (pydeseq2) → enrichment (pathway-enrichment) → figures.
When to Use This Skill
Use this skill when the user wants to:
- Go from FASTQ files (or a sequencing run) to differentially expressed genes and pathways.
- Run or configure
nf-core/rnaseq, or align/quantify with STAR, Salmon, or featureCounts. - Turn Salmon/STAR/featureCounts output into a counts matrix ready for DESeq2/PyDESeq2.
- Design or sanity-check a bulk RNA-seq experiment (replicates, batch, strandedness) before committing compute.
- Scope an end-to-end RNA-seq analysis and decide which tools and skills to chain.
This is bulk RNA-seq (samples = biological specimens). For single-cell/nuclei data use scanpy; for the DE statistics alone use pydeseq2; for enrichment alone use pathway-enrichment.
The Pipeline at a Glance
flowchart TD
fastq["Raw FASTQ + samplesheet"] --> qc["FastQC + MultiQC"]
qc --> trim["Trim: fastp / Trim Galore"]
trim --> align["Align + quant: STAR and/or Salmon"]
align --> counts["Gene-level counts matrix"]
counts --> de["Differential expression"]
de --> enrich["Pathway / GSEA enrichment"]
de --> fig["Figures"]
enrich --> fig
nfcore["nf-core/rnaseq via nextflow skill"] -.->|"path A"| align
manual["Standalone recipes (this skill)"] -.->|"path B"| align
bridge["build_counts_matrix.py (this skill)"] -.-> counts
pydeseq2skill["pydeseq2 skill"] -.-> de
pwskill["pathway-enrichment skill"] -.-> enrich
vizskill["scientific-visualization skill"] -.-> figTwo Upstream Paths — Pick One
The reads → counts stage can be run two ways. Both produce gene-level counts,
but STAR/featureCounts and Salmon/tximport do not generally give identical or
interchangeable values: assignment rules, multimapping, and effective-length
corrections differ. Choose one quantification route for the entire comparison.
| Use Path A — nf-core/rnaseq when… | Use Path B — standalone tools when… |
|------------------------------------------|------------------------------------------|
| You want the field-standard, audited, citable pipeline with one command | You have a few samples and want to learn/inspect each step |
| Many samples, or you'll scale to HPC/cloud | No Nextflow/containers available, or a constrained environment |
| Reproducibility and a full MultiQC report matter most | You need a non-standard step the pipeline doesn't expose |
| → Drive it through the nextflow skill | → Follow references/upstream-manual.md |
When unsure, prefer Path A: nf-core/rnaseq already wires together FastQC → trimming → STAR/Salmon → quantification → tximport → MultiQC with sensible, reviewed defaults, which is the most defensible option. Path B exists for transparency and constrained setups.
Both paths converge on a gene-level counts matrix. Preserve whether counts are
raw or length-scaled, the transcript-to-gene mapping release, and any offsets.
Length-scaled counts must not receive a second transcript-length correction.
Setup
# This skill's glue (bridge + handoffs) — Python
uv pip install "pytximport==0.13.0" pandas numpy
# Downstream skills install their own deps:
# pydeseq2 skill -> uv pip install pydeseq2
# pathway-enrichment skill -> uv pip install gseapy gprofiler-official
# Path A (nf-core): only Nextflow + a container engine are needed — see the `nextflow` skill.
# Path B (standalone tools): install via bioconda. Pin versions for reproducibility.
conda create -n rnaseq -c conda-forge -c bioconda --strict-channel-priority \
fastqc fastp trim-galore "star=2.7.11b" "salmon=2.8.0" subread multiqcReviewed against nf-core/rnaseq 3.27.0, STAR 2.7.11b documentation, Salmon 2.8.0,
pytximport 0.13.0 and PyDESeq2 0.5.4. The bundled Python bridge and a tiny Salmon
index/quant run were executed; the full Nextflow/STAR/trimming recipes are illustrative,
not an end-to-end validation. Salmon 2.x cannot read older C++ indexes: rebuild them.
The bridge's length-scaled Salmon route is for full-length bulk RNA-seq; 3′ counting
assays need original counts without transcript-length correction.
Record the exact versions you use (pipeline revision, tool versions, reference genome + annotation release) — they belong in the methods section and make the analysis reproducible.
Version 2.0 makes STAR strandedness explicit and rejects ambiguous samples, gene sets,
transcript mappings and fractional featureCounts data that older bridge versions accepted.
Quick Start
Path A — nf-core/rnaseq (recommended)
# 0. Validate the samplesheet first (catches the most common failures early)
python scripts/validate_samplesheet.py --samplesheet samplesheet.csv --nfcore
# 1. Smoke-test the environment with tiny bundled data
nextflow run nf-core/rnaseq -r 3.27.0 -profile test,docker --outdir test_results
# 2. Real run: pin the revision, pick an aligner, pass a samplesheet + reference
nextflow run nf-core/rnaseq -r 3.27.0 \
-profile docker \
--input samplesheet.csv \
--genome GRCh38 \
--aligner star_salmon \
--outdir results \
-resumenf-core/rnaseq runs tximport internally, so gene counts come out already merged — no bridge script needed. Use results/star_salmon/salmon.merged.gene_counts_length_scaled.tsv for DE. Samplesheet format, aligner choice, and outputs: references/upstream-nfcore.md. For engine/HPC/cloud/container detail, use the nextflow skill.
Path B — standalone STAR/Salmon (abbreviated)
mkdir -p qc/
fastqc -o qc/ reads/*.fastq.gz # 1. QC raw reads
fastp -i s1_R1.fq.gz -I s1_R2.fq.gz \
-o s1_R1.trim.fq.gz -O s1_R2.trim.fq.gz \
--thread 4 -j s1.fastp.json # 2. Trim adapters/low-quality
salmon quant -i salmon_index -l A \
-1 s1_R1.trim.fq.gz -2 s1_R2.trim.fq.gz \
--gcBias --seqBias -p 8 -o quant/s1 # 3. Quantify (per sample)Full recipes (FastQC, fastp/Trim Galore, STAR index+align+--quantMode GeneCounts, Salmon decoy-aware index, featureCounts, strandedness): references/upstream-manual.md.
Counts → DE → enrichment (both paths)
# Path B only: assemble a gene x sample counts matrix + metadata template for PyDESeq2
python scripts/build_counts_matrix.py --from salmon \
--quant-dir quant/ --tx2gene tx2gene.tsv --output-dir counts/
# Then hand off (see the dedicated skills):
# pydeseq2: counts.csv + metadata.csv -> DE table (log2FC, padj, stat)
# pathway-enrichment: rank by `stat` (GSEA) or padj+|LFC| hit list (ORA)
# scientific-visualization / matplotlib: volcano, MA, heatmap, PCA, enrichment dotplotStage-by-Stage Workflow
Work top to bottom. Each stage names the skill or file that owns the detail. Don't skip the design/QC stages — they are where bulk RNA-seq studies most often go wrong.
1. Design & sample sheet. Confirm ≥3 biological replicates per group, identify batch/confounders, and choose the comparison(s). Build the samplesheet and validate it with scripts/validate_samplesheet.py. Rationale and rules: references/design-and-qc.md.
2. Raw-read QC. FastQC per file; aggregate with MultiQC. Check per-base quality, adapter content, duplication, and over-representation. Thresholds: references/design-and-qc.md.
3. Trimming. Remove adapters and low-quality tails (via fastp or Trim Galore). Re-run FastQC to confirm. Recipes: references/upstream-manual.md (Path A does this for you).
4. Align / quantify. STAR (genome alignment + --quantMode GeneCounts) and/or Salmon (decoy-aware selective alignment). Determine strandedness — the wrong convention can silently discard most assigned reads. Detail: references/upstream-manual.md; pipeline params: references/upstream-nfcore.md.
5. Build the counts matrix. Turn quant output into a gene × sample integer matrix and a metadata template (scripts/build_counts_matrix.py). The estimated-count and gene-ID-mapping nuances live in references/counts-and-handoff.md.
6. Differential expression → pydeseq2 skill. Load counts.csv + metadata.csv, set the design (e.g. ~batch + condition), check full rank and residual degrees
… (nội dung đầy đủ có trong gói tải về)
Skill liên quan
- cross-wave-delta-analysis – So sánh các đợt recon để tìm phát hiện MỚI, TỆ ĐI (REGRESSED), TỒN TẠI (PERSISTENT).
- deprecation-and-migration – Quản lý deprecation và migration. Dùng khi gỡ bỏ hệ thống, API hoặc tính năng cũ. Dùng…
- skill-creator – Tạo skill mới, chỉnh sửa và cải thiện skill hiện có, đo lường hiệu suất skill. Dùng khi…
- cellxgene-census – Truy vấn CZ CELLxGENE Census theo lập trình để lấy dữ liệu transcriptomics đơn bào và…
- binary-analysis-patterns – Nắm vững các mẫu phân tích binary, gồm disassembly, decompilation, phân tích luồng điều…
- notion-meeting-intelligence – Chuẩn bị tài liệu cuộc họp với ngữ cảnh Notion và nghiên cứu Codex; dùng khi thu thập…
- axolotl – Axolotl: tinh chỉnh LLM bằng YAML (LoRA, DPO, GRPO).
- citation-management – Quản lý trích dẫn toàn diện cho nghiên cứu học thuật. Tìm kiếm OpenAlex, PubMed và…