AgentSkillsCN

bio-experimental-design-sample-size

估算差异表达、ChIP-seq、甲基化以及蛋白质组学研究所需的样本量。适用于在预算实验经费、撰写资助申请,或确定为达到预期效应大小而需至少完成多少次重复实验时使用。

SKILL.md
--- frontmatter
name: bio-experimental-design-sample-size
description: Estimates required sample sizes for differential expression, ChIP-seq, methylation, and proteomics studies. Use when budgeting experiments, writing grant proposals, or determining minimum replicates needed to achieve statistical significance for expected effect sizes.
tool_type: r
primary_tool: ssizeRNA

Sample Size Estimation

RNA-seq Sample Size

r
library(ssizeRNA)

# Estimate sample size for RNA-seq
# m = total genes, m1 = expected DE genes
# fc = fold change, fdr = target FDR
result <- ssizeRNA_single(nGenes = 20000, pi0 = 0.9, m = 200,
                          mu = 10, disp = 0.1, fc = 2,
                          fdr = 0.05, power = 0.8)
result$ssize  # Required n per group

DESeq2-based Estimation

r
library(DESeq2)

# From pilot data
dds_pilot <- DESeqDataSetFromMatrix(pilot_counts, colData, ~condition)
dds_pilot <- DESeq(dds_pilot)

# Extract dispersion estimates for power calculation
dispersions <- mcols(dds_pilot)$dispGeneEst
median_disp <- median(dispersions, na.rm = TRUE)
# Use median_disp in power calculations

Single-cell Sample Size

r
library(powsimR)

# Estimate for scRNA-seq
# Accounts for dropout and cell-to-cell variability
params <- estimateParam(pilot_sce)
power <- simulateDE(params, n1 = 100, n2 = 100,
                    p.DE = 0.1, pLFC = 1)

Sample Size by Assay Type

AssayMin RecommendedFor Small Effects
Bulk RNA-seq36-12
scRNA-seq3 samples, 1000 cells6+ samples
ATAC-seq24-6
ChIP-seq23-4
Proteomics36-10
Methylation48-12

Budget Optimization

When resources are limited, prioritize:

  1. Biological replicates over technical replicates
  2. More samples over deeper sequencing (after ~20M reads for RNA-seq)
  3. Balanced designs (equal n per group)

Related Skills

  • experimental-design/power-analysis - Power calculations
  • experimental-design/batch-design - Optimal batch assignment
  • single-cell/preprocessing - scRNA-seq experimental design