Command Palette

Search for a command to run...

Назад к скиллам
скилл № 11737

bio-differential-expression-de-results

Extracts, filters, annotates, and exports differential expression results from DESeq2 or edgeR with proper handling of padj=NA (independent filtering, Cook's…

БесплатноБез исполняемых скриптов
lilinjiот lilinji★ 18 звёзд на GitHub

Установить bio-differential-expression-de-results в Claude Code и Claude Desktop

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

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

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

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

Version Compatibility

Reference examples tested with: DESeq2 1.42+, edgeR 4.0+, IHW 1.34+, qvalue 2.34+, ashr 2.2+, AnnotationDbi 1.66+, org.Hs.eg.db 3.18+, biomaRt 2.58+, mygene 1.38+ (Python), dplyr 1.1+, openxlsx 4.2+

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

  • R: packageVersion('<pkg>') then ?function_name to verify parameters
  • Python: pip show <package> then help(module.function) to check signatures

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

DE Results

"What are my significant genes?" -> Extract DE estimates and p-values from the fitted model, handle missing padj correctly, apply FDR control appropriate to the design, and produce the table or ranked list the downstream tool actually needs.

The Single Most Important Modern Insight -- padj = NA has three distinct meanings

A NA in the padj column is not a missing value; it is a flag indicating which filter excluded the gene. The three causes -- independent filtering, Cook's distance outlier, and all-zero in a group -- have completely different remediations. Dropping all NA rows blindly silently discards real signal, most often from low-count master regulators (transcription factors expressed at ~10 counts) that pass biology but fail the data-driven baseMean threshold.

padj = NA cause DESeq2 detection What it means Fix if undesired
Independent filtering finite pvalue, NA padj, baseMean below auto threshold Removed before BH adjustment to maximize rejections at alpha results(dds, independentFiltering = FALSE) OR filterFun = ihw
Cook's distance outlier NA pvalue, NA padj, baseMean > 0, group has >=3 reps One sample has Cook's > qf(0.99, p, m-p) results(dds, cooksCutoff = FALSE)
All-zero or near-zero in a group NA pvalue AND baseMean very low Insufficient information to test Filter at preprocess time; or accept

Independent filtering (Bourgon, Gentleman, Huber 2010 PNAS 107:9546) chooses the baseMean threshold to maximize rejections. The filter MUST be independent of the test statistic under the null -- this is why baseMean (the across-sample mean) is the canonical choice. Using "min count in treatment group" as a filter VIOLATES the independence requirement and inflates type-I error. Most pipelines unknowingly do this; do not.

A second axis: at n>=7 per group, DESeq() also REPLACES outlier counts via replaceOutliers() and refits (default minReplicatesForReplace = 7). Cook's filtering is NOT computed for continuous covariates -- a continuous-covariate analysis has effectively no outlier filtering.

Algorithmic Taxonomy

Method What it computes When to use Failure mode
BH (p.adjust(method='BH'), DESeq2 default pAdjustMethod='BH') FDR at fixed alpha; Benjamini-Hochberg 1995 Default for most RNA-seq DE Assumes independence or PRDS; many overlapping tests violate
Storey q-value (qvalue::qvalue) q-value using estimated pi_0 Genome-scale with many true nulls Pi_0 estimation can fail at small test counts
IHW (results(filterFun=ihw), Ignatiadis 2016 Nat Methods 13:577) Weighted BH with covariate-informed weights Modern default for DESeq2; +5-20% discoveries at same FDR Covariate MUST be independent under null
ashr local false sign rate (lfsr / svalue, with svalue=TRUE) P(sign of estimate is wrong) When effect-direction certainty is what matters Conservative lower bound on FDR; not interchangeable with padj
BY (p.adjust(method='BY')) Benjamini-Yekutieli; arbitrary dependence Strongly correlated tests Uniformly conservative; rarely needed for DE
Holm / Bonferroni FWER Small confirmatory test sets Far too conservative for genome-scale
TREAT / lfcThreshold= FDR for " LFC > tau" hypothesis

Decision Tree by Scenario

Scenario Recommended approach Why
Standard bulk DE, two groups DESeq2 results with default BH; report padj < 0.05 Default works
Want more power at same FDR results(dds, filterFun = ihw) IHW typically gains 5-20%
Pre-specified biological fold-change matters results(dds, lfcThreshold = log2(1.5), altHypothesis = 'greaterAbs') OR glmTreat(fit, lfc = log2(1.5)) Post-hoc padj<0.05 & abs(LFC)>1 does NOT control FDR for the magnitude claim
Ranking for GSEA preranked stat (Wald Z) for DESeq2 OR shrunken LFC Never use unshrunken LFC -- low-count noise dominates
ORA input Subset by padj<0.05; background = ALL TESTED genes (post-independent-filtering) Background = "all genes in genome" i
Полный SKILL.md на GitHub

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

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

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

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

  • examples/annotate_results.R
  • examples/export_excel.R
  • examples/filter_results.R
  • usage-guide.md

FAQ

Что делает скилл bio-differential-expression-de-results?

Extracts, filters, annotates, and exports differential expression results from DESeq2 or edgeR with proper handling of padj=NA (independent filtering, Cook's outliers, all-zero), multiple-testing correction choice (BH vs Storey q-value vs IHW vs lfsr), TREAT vs post-hoc fold-change filtering, p-value histogram diagnostics, gene annotation via org.db/biomaRt/mygene, GSEA preranked input, ORA background construction, replication reality (Schurch 2016 small-n result), and SABV/sex-stratified reporting. Use when extracting and interpreting DE results, troubleshooting padj=NA, choosing FDR method, preparing ranked lists for pathway analysis, annotating gene IDs, or comparing DESeq2 vs edgeR outputs.

Как установить скилл bio-differential-expression-de-results?

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

Скилл bio-differential-expression-de-results запускает скрипты?

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

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

Сравнить bio-differential-expression-de-results с