Differential expression

From zongtingwei/Bioclaw_Skills_Hub · View interactive version

Differential expression is an AI agent skill from the GitHub repository zongtingwei/Bioclaw_Skills_Hub. Bulk transcriptomics differential expression with count-aware modeling, design validation, contrast handling, thresholded exports, and publication-ready DE figures.

How to use this skill

Skill file

Differential Expression

Version Compatibility

Reference examples assume:

Verify before use:

Overview

Use this skill for count-based DE from bulk RNA-seq or similar count matrices when the user needs:

When To Use This Skill

Quick Route

Progressive Disclosure

Prerequisites

| Requirement | Recommendation |

|---|---:|

| minimum replicates per group | >= 2 |

| preferred replicates per group | >= 3 |

| input values | raw integer counts |

Expected Inputs

Expected Outputs

Starter Pattern

from pydeseq2.dds import DeseqDataSet
from pydeseq2.ds import DeseqStats

dds = DeseqDataSet(
    counts=counts_df,
    metadata=metadata_df,
    design_factors=["condition", "batch"],
)
dds.deseq2()
stats = DeseqStats(dds, contrast=("condition", "treated", "control"))
stats.summary()
res = stats.results_df.sort_values("padj")
res.to_csv("results/de_results.tsv", sep="\t")

Workflow

1. Validate the design

Check:

2. Fit a count-aware model

Use raw counts, not TPM or log-normalized expression, for count-based DE frameworks.

3. Apply explicit filtering and ranking

Common reporting thresholds:

Export both the full table and a thresholded table.

4. Visualize results

At minimum:

5. Export pathway-ready artifacts

Produce a ranked gene list sorted by signed effect or Wald statistic for enrichment workflows.

Output Artifacts

results/
├── de_results.tsv
├── de_significant.tsv
└── de_ranked_genes.tsv
figures/
├── sample_pca.pdf
├── volcano.pdf
└── ma_plot.pdf
qc/
└── design_check.tsv

Quality Review

Anti-Patterns

Related Skills

Optional Supplements

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.