鱼皮AI导航
鱼皮AI导航
  • 主页
  • 社区
  • AI工具
  • AI知识库
  • AI提示词
  • MCP
  • Skills
  • AI学习资源
  • AI资讯
  • GitHub开源
登录/注册

gsea-enrichment

执行基因集富集分析时,需先将通路数据库文件加载为字典格式,再进行富集计算,确保使用正确的数据结构与物种参数,支持多类功能注释数据库的整合分析与可视化。

研究
访问 GitHub
文档Skills.MD
name
gsea-enrichment-analysis
title
GSEA and Pathway Enrichment Analysis
description
Gene set enrichment analysis with correct geneset format handling. Critical guidance for loading pathway databases and running enrichment in OmicVerse.

GSEA and Pathway Enrichment Analysis

Overview

This skill covers gene set enrichment analysis (GSEA) and pathway enrichment workflows in OmicVerse. It provides critical guidance on the correct data formats and API usage patterns to avoid common errors.

Critical API Reference - Geneset Format

IMPORTANT: Use Dictionary Format, NOT File Path!

The ov.bulk.geneset_enrichment() function requires a dictionary of gene sets, NOT a file path string. You must first load the geneset file using ov.utils.geneset_prepare().

CORRECT usage:

▼
python
复制代码
# Step 1: Download pathway database (if not already available) ov.utils.download_pathway_database() # Step 2: Load geneset file into dictionary format - REQUIRED! pathways_dict = ov.utils.geneset_prepare( 'genesets/GO_Biological_Process_2021.txt', # or .gmt file organism='Human' # or 'Mouse' ) # Step 3: Now run enrichment with the DICTIONARY enr = ov.bulk.geneset_enrichment( gene_list=deg_genes, pathways_dict=pathways_dict, # Pass the DICTIONARY, not file path! pvalue_type='auto', organism='Human' )

WRONG - DO NOT USE:

▼
python
复制代码
# WRONG! Don't pass file path directly to geneset_enrichment! # enr = ov.bulk.geneset_enrichment( # gene_list=deg_genes, # pathways_dict='genesets/GO_Biological_Process_2021.gmt' # ERROR! String path doesn't work! # ) # WRONG! geneset_enrichment expects dict, not file path # enr = ov.bulk.geneset_enrichment( # gene_list=deg_genes, # pathways_dict='GO_Biological_Process_2021' # ERROR! # )

File Format Support

File ExtensionLoad MethodNotes
.txtov.utils.geneset_prepare()OmicVerse format
.gmtov.utils.geneset_prepare()Standard GMT format
.jsonjson.load() then convertCustom handling needed

Complete Enrichment Workflow

▼
python
复制代码
import omicverse as ov # 1. Setup ov.plot_set() # 2. Ensure pathway database is available ov.utils.download_pathway_database() # 3. Load gene sets - ALWAYS use geneset_prepare first! go_bp = ov.utils.geneset_prepare('genesets/GO_Biological_Process_2021.txt', organism='Human') go_mf = ov.utils.geneset_prepare('genesets/GO_Molecular_Function_2021.txt', organism='Human') kegg = ov.utils.geneset_prepare('genesets/KEGG_2021_Human.txt', organism='Human') # 4. Prepare gene list (e.g., from DEG analysis) # Assuming dds is a pyDEG object with results deg_genes = dds.result.loc[dds.result['sig'] != 'normal'].index.tolist() # 5. Run enrichment with dictionary enr_go_bp = ov.bulk.geneset_enrichment( gene_list=deg_genes, pathways_dict=go_bp, # Dictionary, NOT file path! pvalue_type='auto', organism='Human' ) # 6. Visualize results ov.bulk.geneset_plot(enr_go_bp, figsize=(6, 8), num=10) # 7. For multiple databases, combine into dict enr_dict = { 'GO_BP': enr_go_bp, 'GO_MF': enr_go_mf, 'KEGG': enr_kegg } colors_dict = { 'GO_BP': '#1f77b4', 'GO_MF': '#ff7f0e', 'KEGG': '#2ca02c' } ov.bulk.geneset_plot_multi(enr_dict, colors_dict, num=5)

Common Errors and Solutions

Error: "FileNotFoundError" or "pathways_dict is not a dict"

Cause: Passing file path string instead of dictionary to geneset_enrichment() Solution: First load with ov.utils.geneset_prepare(), then pass the returned dictionary

Error: "Missing file 'genesets/GO_Biological_Process_2021.gmt'"

Cause: Pathway database not downloaded Solution: Run ov.utils.download_pathway_database() first

Error: "No enriched pathways found"

Cause: Gene list doesn't overlap with pathway genes, or organism mismatch Solution:

  • Verify gene symbols match (human vs mouse capitalization)
  • Check organism parameter matches your data
  • Ensure gene list has sufficient genes (>10 recommended)

Pathway Databases Available

After running ov.utils.download_pathway_database():

  • GO_Biological_Process_2021.txt
  • GO_Molecular_Function_2021.txt
  • GO_Cellular_Component_2021.txt
  • KEGG_2021_Human.txt
  • KEGG_2021_Mouse.txt
  • Reactome_2022.txt
  • WikiPathway_2023_Human.txt
  • And many more...

Best Practices

  1. Always load genesets first: Never pass file paths directly to geneset_enrichment()
  2. Check gene format: Ensure gene symbols match (CAPS for human, Title case for mouse)
  3. Download once: Run download_pathway_database() once per environment
  4. Specify organism: Always set organism='Human' or organism='Mouse'
  5. Use background genes: For more accurate results, provide background parameter

Examples

  • "Run GO enrichment on my DEG results using the correct geneset_prepare workflow"
  • "Perform KEGG pathway analysis on upregulated genes with proper dictionary format"
  • "Compare GO BP, MF, and KEGG enrichment results using geneset_plot_multi"

References

  • Tutorial notebook: t_deg.ipynb (enrichment section)
  • Pathway download: ov.utils.download_pathway_database()
  • Quick reference: reference.md
研究

快捷安装

复制到终端去安装 Skill

npxadd-skillStarlitnightly/omicverse--skill"gsea-enrichment"
站长:程序员鱼皮 老鱼简历 商务合作 增值电信业务经营许可证
2026 鱼皮AI导航 | 沪ICP备19026706号-6
站长:程序员鱼皮 老鱼简历 商务合作 增值电信业务经营许可证
2026 鱼皮AI导航 | 沪ICP备19026706号-6
🔥热门工具
朱雀AI检测朱雀AI检测
朱雀AI检测助手朱雀AI检测助手
LovartLovart
老鱼简历老鱼简历
WritePass官网WritePass官网
面多多面多多
CursorCursor
星月写作星月写作
朱雀AI检测助手朱雀AI检测助手
零感AI零感AI
Skills 推荐
prime-numbers
面向图论中的素数问题求解,提供素性判定、整数分解、素数分布分析及模运算定理验证等核心能力,支持从基础试除到概率化与确定性算法的多层次策略选择,适用于理论推导与计算验证相结合的研究场景。
research
面向技术方案的深度调研能力,通过网络搜索、GitHub 仓库分析和多源证据采集,支持在实施前全面评估技术选型,确保每个推荐方案均基于官方文档、活跃代码库及真实应用案例等至少两项可靠依据。
rank-tracker
持续监控关键词在传统搜索结果与AI生成内容中的排名变化,分析趋势波动并识别显著升降,支持多维度对比竞争格局与SERP特征占有情况,输出可视化报告及可执行优化建议,适用于搜索引擎营销策略的动态调整。
research-grants
面向 NSF、NIH、DOE 和 DARPA 等联邦机构的科研基金申请,提供从选题定位、立项依据、技术路线设计、创新性阐述、可行性论证到预算编制与合规性审查的全流程支持,强调科学严谨性、跨学科整合能力及社会价值转化路径。
FirstPrinciples
通过剥离表层假设,将复杂问题还原至物理或现实中的基本事实,系统性识别硬性约束与可变条件,并基于不可动摇的基础重新构建最优解决方案,适用于技术决策、安全分析及成本优化等深度推理场景。