bulk-rna-seq-deseq2-analysis-with-omicverse
Analyze bulk RNA-seq data with PyDESeq2, covering ID mapping, differential expression testing, and enrichment visualization.
Install
mkdir -p .claude/skills/bulk-rna-seq-deseq2-analysis-with-omicverse && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/2424" && unzip -o skill.zip -d .claude/skills/bulk-rna-seq-deseq2-analysis-with-omicverse && rm skill.zipInstalls to .claude/skills/bulk-rna-seq-deseq2-analysis-with-omicverse
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
PyDESeq2 differential expression: ID mapping, DE testing, fold-change thresholding, and GSEA enrichment visualization in OmicVerse.Key capabilities
- →Maps Ensembl IDs to standard gene symbols
- →Automates PyDESeq2 differential expression analysis
- →Filters low-expression gene data automatically
- →Generates volcano plots and expression boxplots
How it works
Executes a scripted bioinformatics pipeline using the OmicVerse library to normalize data and perform statistical testing.
Inputs & outputs
When to use bulk-rna-seq-deseq2-analysis-with-omicverse
- →Map Ensembl IDs to gene symbols
- →Calculate differential expression between groups
- →Generate enrichment plots for RNA-seq results
About this skill
Bulk RNA-seq DESeq2 analysis with omicverse
Overview
Use this skill when a user wants to reproduce the DESeq2 workflow showcased in t_deseq2.ipynb. It covers loading raw featureCounts matrices, mapping Ensembl IDs to symbols, running PyDESeq2 via ov.bulk.pyDEG, and exploring downstream enrichment plots.
Instructions
- Import and format the expression matrix
- Call
import omicverse as ovandov.style()to standardise visuals. - Read tab-separated count data from featureCounts using
ov.io.read(..., index_col=0, header=1). - Strip trailing
.bamfrom column names with[c.split('/')[-1].replace('.bam', '') for c in data.columns].
- Call
- Map gene identifiers
- Ensure the appropriate mapping pair exists by running
ov.utils.download_geneid_annotation_pair(). - Replace
gene_idwith gene symbols usingov.bulk.Matrix_ID_mapping(data, 'genesets/pair_<GENOME>.tsv').
- Ensure the appropriate mapping pair exists by running
- Initialise the DEG object
- Create
dds = ov.bulk.pyDEG(data)from the mapped counts. - Resolve duplicate gene names with
dds.drop_duplicates_index()and confirm success in logs.
- Create
- Define contrasts and run DESeq2
- Collect sample labels into
treatment_groupsandcontrol_groupslists that match column names exactly. - Execute
dds.deg_analysis(treatment_groups, control_groups, method='DEseq2')to invoke PyDESeq2.
- Collect sample labels into
- Filter and tune thresholds
- Inspect result shape (
dds.result.shape) and optionally filter low-expression genes, e.g.dds.result.loc[dds.result['log2(BaseMean)'] > 1]. - Set thresholds via
dds.foldchange_set(fc_threshold=-1, pval_threshold=0.05, logp_max=6)to auto-pick fold-change cutoffs.
- Inspect result shape (
- Visualise differential genes
- Draw volcano plots with
dds.plot_volcano(...)and summarise key genes. - Produce per-gene boxplots:
dds.plot_boxplot(genes=[...], treatment_groups=..., control_groups=..., figsize=(2, 3)).
- Draw volcano plots with
- Run enrichment analyses (optional)
- Download enrichment libraries using
ov.utils.download_pathway_database()and load them throughov.utils.geneset_prepare. - Rank genes for GSEA with
rnk = dds.ranking2gsea(). - Instantiate
gsea_obj = ov.bulk.pyGSEA(rnk, pathway_dict)and callgsea_obj.enrichment()to compute terms. - Plot enrichment bubble charts via
gsea_obj.plot_enrichment(...)and GSEA curves withgsea_obj.plot_gsea(term_num=..., ...).
- Download enrichment libraries using
- Defensive validation
# Before PyDESeq2: verify count matrix contains raw integers (not log-transformed) import numpy as np if hasattr(data, 'values'): sample = data.values.flatten()[:1000] else: sample = np.array(data).flatten()[:1000] if np.any(sample != sample.astype(int)): print("WARNING: Data may not be raw counts. PyDESeq2 requires integer counts, not log-transformed.") # Verify treatment/control groups match column names for g in treatment_groups + control_groups: assert g in data.columns, f"Sample '{g}' not in count matrix columns: {list(data.columns)}" - Troubleshooting
- If PyDESeq2 raises errors about size factors, remind users to provide raw counts (not log-transformed data).
gene_idmapping depends on species; direct them to download the correct genome pair when results look sparse.- Large pathway libraries may require raising recursion limits or filtering to the top N terms before plotting.
Examples
- "Run PyDESeq2 on treated vs control replicates and highlight the top enriched WikiPathways terms."
- "Filter DEGs to genes with log2(BaseMean) > 1, auto-select fold-change cutoffs, and create volcano and boxplots."
- "Generate the ranked gene list for GSEA and plot the enrichment curve for the top pathway."
References
- Tutorial notebook:
t_deseq2.ipynb - Sample featureCounts matrix:
sample/counts.txt - Quick copy/paste commands:
reference.md
When not to use it
- →Single-cell RNA sequencing data
- →Non-count based expression data analysis
Prerequisites
Limitations
- →Strictly follows the PyDESeq2 method
- →Requires specific input file formats from featureCounts
How it compares
It wraps the entire pipeline into a standardized tool rather than manual Jupyter notebook coding.
Compared to similar skills
bulk-rna-seq-deseq2-analysis-with-omicverse side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| bulk-rna-seq-deseq2-analysis-with-omicverse (this skill) | 2 | 5mo | No flags | Intermediate |
| quant-analyst | 103 | 2mo | No flags | Advanced |
| umap-learn | 6 | 2mo | Review | Intermediate |
| embedding-strategies | 8 | 2mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by Starlitnightly
View all by Starlitnightly →You might also like
quant-analyst
zenobi-us
Expert quantitative analyst specializing in financial modeling, algorithmic trading, and risk analytics. Masters statistical methods, derivatives pricing, and high-frequency trading with focus on mathematical rigor, performance optimization, and profitable strategy development.
umap-learn
K-Dense-AI
UMAP dimensionality reduction. Fast nonlinear manifold learning for 2D/3D visualization, clustering preprocessing (HDBSCAN), supervised/parametric UMAP, for high-dimensional data.
embedding-strategies
wshobson
Select and optimize embedding models for semantic search and RAG applications. Use when choosing embedding models, implementing chunking strategies, or optimizing embedding quality for specific domains.
building-automl-pipelines
jeremylongshore
Build automated machine learning pipelines, including feature engineering, model selection, and performance evaluation.
model-compare
rawwerks
Compare 3D CAD models using boolean operations (IoU, Dice, precision/recall). Use when evaluating generated models against gold references, diffing CAD revisions, or computing similarity metrics for ML training. Triggers on: model diff, compare models, IoU, intersection over union, model similarity, CAD comparison, STEP diff, 3D evaluation, gold reference, generated model, precision recall 3D.
matchms
davila7
Mass spectrometry analysis. Process mzML/MGF/MSP, spectral similarity (cosine, modified cosine), metadata harmonization, compound ID, for metabolomics and MS data processing.