TECHNICAL NOTE
RNA-seq 差异分析的基本流程
A basic RNA-seq differential expression workflow
以 bulk RNA-seq 为例,差异表达分析不仅取决于软件,也取决于样本设计、数据质量和统计模型。
Bulk RNA-seq differential expression depends on study design, data quality and the statistical model.
01准备计数及样本信息 / Input
准备原始基因计数矩阵与样本信息表,确保样本名称一致,并记录实验分组、批次及生物学重复。不要直接以 TPM 或 FPKM 代替原始计数输入 DESeq2。
Align count matrix columns with sample metadata, record group and batch, and use suitable count inputs rather than TPM or FPKM.
02设计与拟合 / Model design
根据研究目的设置设计公式。例如在批次与分组可区分时,可纳入批次因素。利用 PCA 等方法检查样本结构及异常值。
Choose a model consistent with the study design. Include batch if estimable and inspect sample structure using PCA.
03结果解释 / Interpretation
报告 log2 fold change 和多重检验校正后的 P 值,结合效应大小、表达水平和生物学背景解释结果。
Report log2 fold changes and adjusted P values, considering effect sizes, expression levels and biological context.
R 代码示例 / R example
library(DESeq2)
# counts and metadata are prepared locally
# metadata rows must match count matrix columns
dds <- DESeqDataSetFromMatrix(counts, metadata, ~ condition)
dds <- DESeq(dds)
res <- results(dds, contrast = c("condition", "treated", "control"))示例假定 metadata 中包含 condition 列及对应分组,并且有适当的生物学重复;未提供真实样本数据。
The example assumes appropriate biological replicates and a matching condition column; no real sample data are used.
参考资料 / Reference
本文为技术学习笔记,仅供学习参考。示例命令需根据本地数据和软件版本调整。
For technical learning only. Adapt example commands to local data and software versions.