Skip to content
Back to skills

Statistics And Results

ASecurity

"Compute, interpret, export, and troubleshoot PyDESeq2 statistical

  • 247 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 8, 2026
datapythongobash

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill statistics-and-results --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Statistics And Results?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Statistics And Results
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-statistics-and-results/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-statistics-and-results)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: statistics-and-results
description: "Compute, interpret, export, and troubleshoot PyDESeq2 statistical
  results after fitting a DeseqDataSet."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# 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 fitted `DeseqDataSet`.
- Compare categorical levels with `contrast=[factor, tested_level, reference_level]` or use a numeric contrast vector for direct design matrices.
- Run `summary()`, thresholded tests with `lfc_null` and `alt_hypothesis`, or `run_wald_test()` when a lower-level rerun is needed.
- Interpret `results_df` columns, p-value filtering, NaN behavior, coefficient names, and log2 versus natural-log scales.
- Apply `lfc_shrink(coeff, adapt=True)` and make `plot_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

```python
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.md` gives result-column semantics, contrast forms, thresholded tests, shrinkage behavior, coefficient naming, and MA-plot usage.
- `references/troubleshooting.md` maps common runtime errors and confusing outputs to fixes.
- `scripts/summarize_results.py` runs 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:

```bash
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.

Files in this skill

  • SKILL.md2.8 KB
  • references/results-reference.md7.9 KB
  • references/troubleshooting.md7.1 KB
  • scripts/summarize_results.py5.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.