一键导入
differential-expression
Differential gene expression analysis with PyDESeq2. Design matrices, contrasts, multiple testing correction, volcano plots.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Differential gene expression analysis with PyDESeq2. Design matrices, contrasts, multiple testing correction, volcano plots.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Single-cell RNA-seq analysis with Scanpy. QC, normalization, clustering, visualization, marker gene identification.
End-to-end single-cell RNA-seq analysis including data loading, QC, integration, clustering, cell type annotation, and differential expression.
Critically review AI-agent-conducted scientific analyses for correctness, rigor, and completeness. Use this skill whenever an analysis session has completed and needs validation, when a user asks to "review," "validate," "check," or "audit" a computational analysis, or when an agent pipeline produces scientific results that require quality control before reporting. Also trigger when the user references an execution trace, notebook, or conversation history from a prior analysis session. This skill should run as the final step of any autonomous scientific analysis pipeline.
| name | differential-expression |
| description | Differential gene expression analysis with PyDESeq2. Design matrices, contrasts, multiple testing correction, volcano plots. |
| metadata | {"skill-author":"Albert Ying"} |
from pydeseq2.dds import DeseqDataSet
from pydeseq2.ds import DeseqStats
import pandas as pd
# counts: genes x samples DataFrame; metadata: samples DataFrame
dds = DeseqDataSet(
counts=counts_df,
metadata=metadata_df,
design="~batch + condition", # batch correction built into design
)
dds.deseq2()
# Extract results for a contrast
stat_res = DeseqStats(dds, contrast=["condition", "treated", "control"])
stat_res.summary()
results_df = stat_res.results_df
# Filter significant genes
sig = results_df[
(results_df["padj"] < 0.05) & (results_df["log2FoldChange"].abs() > 1)
]
import matplotlib.pyplot as plt
import numpy as np
df = results_df.copy()
df["-log10p"] = -np.log10(df["padj"].clip(lower=1e-300))
fig, ax = plt.subplots(figsize=(8, 6))
colors = np.where(
(df["padj"] < 0.05) & (df["log2FoldChange"] > 1), "red",
np.where((df["padj"] < 0.05) & (df["log2FoldChange"] < -1), "blue", "gray")
)
ax.scatter(df["log2FoldChange"], df["-log10p"], c=colors, s=8, alpha=0.5)
ax.axhline(-np.log10(0.05), ls="--", color="gray", lw=0.8)
ax.axvline(-1, ls="--", color="gray", lw=0.8)
ax.axvline(1, ls="--", color="gray", lw=0.8)
ax.set_xlabel("log2 Fold Change")
ax.set_ylabel("-log10 adjusted p-value")
~patient + treatment.~genotype + treatment + genotype:treatment.