Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

bio-experimental-design-sample-size

БесплатноБез исполняемых скриптовНе проверен

Estimates the minimum biological replicates (or cells/events) for a target power at a target FDR in genomics experiments using ssizeRNA, PROPER, powsimR for…

lilinjiот lilinji★ 18 звёзд на GitHub

Об этом скилле

Version Compatibility

Reference examples tested with: ssizeRNA 1.3+, PROPER 1.34+, powsimR 1.2+ (GitHub), DESeq2 1.42+, edgeR 4.0+.

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

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

If code throws an error, introspect the installed package and adapt to the actual API. Notes: ssizeRNA provides ssizeRNA_single() (one mean/dispersion for all genes), ssizeRNA_vary() (genes vary), and check.power() (average power and true FDR for a given n); powsimR is GitHub-only with drifting signatures. Verify against the installed help before use.

Sample Size for Genomics Experiments

"How many samples do I need?" -> Find the smallest number of biological replicates per group that achieves a target marginal power at a target FDR, given the dispersion and effect-size distribution expected for the assay — counting biological units, not measurements.

  • R: ssizeRNA::ssizeRNA_vary(), ssizeRNA::check.power() — FDR-aware NB sample size; pilot dispersions from DESeq2/edgeR

The Single Most Important Modern Insight -- The Biological Replicate Is the Unit, and n=3 Is a Convention

Sample size is a count of biological replicates — independent experimental units (animals, donors, cultures from independent passages), not measurements. Technical replicates (one library split across lanes, one RNA split into preps) reduce measurement noise but add no degrees of freedom for biological inference; averaging them into their biological unit is correct, and selling "n = 3 samples x 3 technical reps = 9" as biological power is a standard error (Blainey, Krzywinski & Altman 2014 Nat Methods 11:879). The ubiquitous "n=3" is a publication convention, not a calculation: in the 48-vs-48 yeast benchmark, >=6 biological replicates were needed to recover most true DE genes at realistic effect sizes, and below that the choice of DE tool mattered more than at higher n (Schurch 2016 RNA 22:839). Human and primary material, with higher dispersion, need more. For single-cell, the corollary is sharp: population-level DE power is set by the number of donors, not the number of cells, because cells are pseudoreplicates — pseudobulk per donor is the correct unit (Squair 2021 Nat Commun 12:5692; Murphy & Skene 2022 Nat Commun 13:7851).

Algorithmic Taxonomy

Approach Model Tool Strength Fails / costs when
FDR-aware NB sample size NB, varying mean/dispersion ssizeRNA::ssizeRNA_vary controls average power at a true FDR needs a dispersion/expression model
Pilot-dispersion simulation empirical dispersions from pilot PROPER, powsimR most defensible; study-specific requires a pilot dataset
Single-parameter NB one mean/dispersion for all genes ssizeRNA::ssizeRNA_single quick; transparent ignores the mean-dispersion trend
Verify a planned n average power + true FDR at fixed n ssizeRNA::check.power sanity-checks a budget-driven n not a search over n
scRNA-seq cohort sizing pseudobulk over donors powsimR counts the right unit (donors) cell-level sizing is wrong unit
Per-feature t-test n Gaussian (Cohen's d) pwr::pwr.t.test proteomics/continuous after transform wrong for raw counts

Decision Tree by Scenario

Scenario Recommended approach Why
Bulk RNA-seq, pilot available estimate dispersions, then ssizeRNA_vary/PROPER study-specific dispersion beats a guess
Bulk RNA-seq, no pilot ssizeRNA_vary with a literature dispersion, stated as approximate transparent starting point
Budget already fixed at some n check.power to report achieved power and true FDR answers "is this n adequate?"
scRNA-seq disease vs control size the number of DONORS (pseudobulk; powsimR) population power scales with donors
ChIP/ATAC/methylation NB sample size per region; assay floor as minimum overdispersed counts; detection floor
Proteomics (continuous) pwr::pwr.t.test per protein, with missingness caveat Gaussian after transform
Have technical replicates collapse to biological units first technical reps add no biological df
Clinical-trial endpoint -> clinical-biostatistics/power-and-sample-size regulated regime

FDR-Aware NB Sample Size -- ssizeRNA

Goal: Find the minimum biological replicates per group for a target power at a target FDR, accounting for the proportion of DE genes and the mean-dispersion structure.

Approach: Specify the number of genes, the proportion non-DE (pi0), the mean count and dispersion (ideally from pilot data), the fold change, the target FDR, and the target power; let ssizeRNA_vary search replicate numbers and return the smallest that reaches the target.

library(ssizeRNA)
res <- ssizeRNA_vary(nGenes = 20000, pi0 = 0.95,
Полный SKILL.md на GitHub

Установить bio-experimental-design-sample-size в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/sample_size_estimation.Rusage-guide.md

FAQ

Что делает скилл bio-experimental-design-sample-size?

Estimates the minimum biological replicates (or cells/events) for a target power at a target FDR in genomics experiments using ssizeRNA, PROPER, powsimR for scRNA-seq, and pilot-data dispersion estimation from DESeq2/edgeR. Covers the biological-versus-technical replication distinction (technical replicates do not add degrees of freedom for biological inference), replicate-number-versus-sequencing-depth budgeting, scRNA-seq sample-versus-cell allocation under a pseudobulk model, and the critique that "n=3" is a publication convention rather than a power calculation. Use when budgeting a sequencing experiment, writing the sample-size justification in a grant, estimating replicates from pilot data, allocating a fixed budget between samples and depth, or planning scRNA-seq cohort size. For clinical-trial sample size see clinical-biostatistics/power-and-sample-size; for the power-given-n direction see experimental-design/power-analysis.

Как установить скилл bio-experimental-design-sample-size?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл bio-experimental-design-sample-size запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить bio-experimental-design-sample-size с