statistics-and-results
Compute, interpret, export, and troubleshoot PyDESeq2 statistical results after fitting a DeseqDataSet.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- statistics-and-results
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Compute, interpret, export, and troubleshoot PyDESeq2 statistical results after fitting a DeseqDataSet.
- disable-model-invocation
- true
02 资源文件 3
- 参考文档references/results-reference.md7.9 KB
- 参考文档references/troubleshooting.md7.1 KB
- 脚本scripts/summarize_results.py5.8 KB
03 SKILL.md 正文
PyDESeq2 Statistics and Results
Use this sub-skill after a DeseqDataSet has already been fitted with dds.deseq2() or the equivalent staged fitting steps. It covers DeseqStats, contrasts, Wald-test summaries, adjusted p-values, log-fold-change shrinkage, MA plots, and result-table interpretation.
When To Use
- Build a
DeseqStats(dds, contrast=...)object for a fittedDeseqDataSet. - Compare categorical levels with
contrast=[factor, tested_level, reference_level]or use a numeric contrast vector for direct design matrices. - Run
summary(), thresholded tests withlfc_nullandalt_hypothesis, orrun_wald_test()when a lower-level rerun is needed. - Interpret
results_dfcolumns, p-value filtering, NaN behavior, coefficient names, and log2 versus natural-log scales. - Apply
lfc_shrink(coeff, adapt=True)and makeplot_MA(log=True, save_path=None, **kwargs)outputs.
Route Elsewhere
- For raw count/metadata loading, CSV/index validation, AnnData setup, and design-matrix input checks, use
../data-io-validation/SKILL.md. - For complete fitting workflows that create the fitted
DeseqDataSet, use../dea-workflows/SKILL.md. - For staged normalization, dispersion, LFC fitting, VST, and internal AnnData keys, use
../model-fitting-internals/SKILL.md.
Minimal Result Pattern
from pydeseq2.ds import DeseqStats
stat_res = DeseqStats(
dds,
contrast=["condition", "B", "A"],
alpha=0.05,
cooks_filter=True,
independent_filter=True,
quiet=True,
)
stat_res.summary()
results = stat_res.results_df.sort_values("padj", na_position="last")
Use results_df for exports and ranking. It contains baseMean, log2FoldChange, lfcSE, stat, pvalue, and padj after summary().
Key References
references/results-reference.mdgives result-column semantics, contrast forms, thresholded tests, shrinkage behavior, coefficient naming, and MA-plot usage.references/troubleshooting.mdmaps common runtime errors and confusing outputs to fixes.scripts/summarize_results.pyruns a safe synthetic workflow with flags for contrast, thresholded tests, shrinkage, MA plotting, CSV export, and independent filtering.
Safe Script
Run the bundled script after installing PyDESeq2. From the pydeseq2 skill root, use:
python scripts/summarize_results.py --help
python scripts/summarize_results.py --contrast condition B A --output-csv results.csv --ma-plot ma.png
The script uses PyDESeq2's packaged synthetic dataset by default, performs a small fit, and does not download data or mutate files unless explicit output paths are provided.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).