agentsclimarketplace

Sample size

Skill BioTender-max/awesome-bio-agent-skills/skills/bioskills/sample-size

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.From its SKILL.md

Install
npx -y skills add BioTender-max/awesome-bio-agent-skills --skill sample-size

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

3.0 KB, 712 tokens by cl100k_base, as published. Nobody here has run it

Version Compatibility

Reference examples tested with: DESeq2 1.42+

Before using code patterns, verify installed versions match. If versions differ:

  • R: packageVersion('<pkg>') then ?function_name to verify parameters

If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.

Sample Size Estimation

"How many samples do I need for my experiment?" → Estimate required biological replicates per group for a target power level given expected effect sizes and variability.

  • R: ssizeRNA::ssizeRNA_single(), DESeq2 pilot dispersion estimates
  • scRNA-seq: powsimR::simulateDE()

RNA-seq Sample Size

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

Goal: Derive realistic dispersion estimates from pilot RNA-seq data for use in power and sample size calculations.

Approach: Run DESeq2 on pilot count data to estimate per-gene dispersions, then extract the median dispersion as a representative variability parameter for power formulas.

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

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

What ships with it: 2 files

5.5 KB alongside SKILL.md

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.