# Analyze RNA-Seq Expression with PyDESeq2

Bulk RNA-seq comparisons require careful data alignment, model design, and multiple-testing correction. This skill guides PyDESeq2 workflows from count preparation through differential expression results and plots.

## Install

```bash
npx skillstore add davila7/pydeseq2
```

## Metadata

- Status: approved
- Slug: davila7-pydeseq2
- Skillstore revision: r2
- Version status: missing
- Tree hash: 89065782b8f699585f547a27d9d2b4aff05ecc532fd26caa30fed8deea3edb09
- Author: davila7
- GitHub username: davila7
- License: MIT
- Repository: https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/scientific/pydeseq2
- Ref: c43861a65bb95efcae259cd161c9d6f4dc7eec6f
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: confirmation\_required
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: filesystem, external\_commands, network
- Quality score: 38
- Quality tier: warning
- Public page: https://skillstore.pages.dev/skills/davila7-pydeseq2
- Manifest: https://skillstore.pages.dev/api/skills/davila7-pydeseq2/manifest

## Capabilities

- Loads and aligns count matrices with sample metadata from CSV, TSV, or AnnData inputs.
- Filters low-count genes and samples with missing condition metadata.
- Builds single-factor, multi-factor, covariate, and interaction design formulas.
- Runs PyDESeq2 fitting, Wald tests, independent filtering, and Benjamini-Hochberg correction.
- Applies log fold-change shrinkage for ranking and visualization.
- Exports result tables, fitted datasets, volcano plots, and MA plots.

## Use Cases

- Compare treatment and control samples: Prepare a two-group analysis with filtered counts, an explicit contrast, adjusted p-values, and ranked genes.
- Control for batch effects: Construct a multi-factor design that estimates condition effects while accounting for batch or continuous covariates.
- Automate repeatable RNA-seq analyses: Use the command-line script to process datasets and export tables, fitted objects, volcano plots, and MA plots.

## Prompt Templates

### Run a basic comparison

```
Analyze my counts file at [counts path] and metadata at [metadata path]. Compare [treated] against [control] using the [condition] column.
```

### Check and prepare inputs

```
Inspect the count matrix and metadata at [paths]. Verify orientation, sample alignment, non-negative integer counts, missing values, and low-count filtering.
```

### Model batch-adjusted effects

```
Create a PyDESeq2 workflow for design [~batch + condition] and contrast [condition, treated, control]. Explain assumptions, diagnostics, and adjusted result interpretation.
```

### Plan a multi-contrast analysis

```
Design an advanced PyDESeq2 analysis for [factors and levels]. Include interactions, multiple contrasts, shrinkage strategy, quality checks, exports, and reproducibility notes.
```

## Limitations

- Supports bulk RNA-seq count data, not normalized expression values or single-cell differential expression.
- Requires PyDESeq2 and compatible Python scientific packages to run the provided workflow.
- Cannot determine whether a design is biologically valid or sufficiently powered without experimental context.
- Pickle files must come from trusted sources because deserialization can execute embedded code.

## Best Practices

- Confirm that count columns and metadata rows identify the same samples before fitting.
- Use raw non-negative integer counts, filter weak genes, and document every filtering threshold.
- Specify contrasts explicitly and interpret adjusted p-values alongside effect sizes and diagnostics.

## Anti Patterns

- Do not use normalized, transformed, or fractional expression values as DESeq2 count input.
- Do not remove confounded variables without explaining how the design and biological question change.
- Do not load pickle files from untrusted or unknown sources.

## Security Audit

- Audited at: 2026-07-23T15:54:24.712\+00:00
- Summary: All 74 static findings are false positives involving Markdown, expected output writes, documentation links, or sample-filtering guidance. However, the workflow recommends pickle.load without a trust warning, which can execute malicious payloads. No prompt injection, network requests, credential access, or covert command execution was found.

## Stats

- Views: 200
- Downloads: 7
- Favorites: 0
- Popularity score: 0
