bulk-rna-seq-deseq2-analysis-with-omicverse
Walk Claude through PyDESeq2-based differential expression, including ID mapping, DE testing, fold-change thresholding, and enrichment visualisation.
Install
mkdir -p .claude/skills/bulk-rna-seq-deseq2-analysis-with-omicverse && curl -L -o skill.zip "https://mcp.directory/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
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
More by Starlitnightly
View all skills by Starlitnightly →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
fastapi-templates
wshobson
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
Related MCP Servers
Browse all serversBoost productivity with Task Master: an AI-powered tool for project management and agile development workflows, integrat
Connect Blender to Claude AI for seamless 3D modeling. Use AI 3D model generator tools for faster, intuitive, interactiv
Send and receive WhatsApp messages directly from Claude and other AI assistants. Search conversations, manage contacts,
Use iOS Simulator for testing with tools like UI interaction and device info retrieval. Perfect as an iPhone emulator fo
Control any ROS1 or ROS2 robot with natural language using ROS MCP Server—AI-powered, code-free, real-time monitoring an
Integrate Claude Desktop with Neovim for an AI coding assistant that enhances Vim workflows with AI-powered coding help
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.