tooluniverse.enrichr_tool 模块¶
- class tooluniverse.enrichr_tool.EnrichrTool[源代码]¶
基类:
BaseTool用于使用 Enrichr 进行基因富集分析的工具。
- get_official_gene_name(gene_name)[源代码]¶
使用 MyGene.info API 根据给定的基因名称或同义词检索官方基因符号。
- 参数
gene_name (str): The gene name or synonym to query.
- 返回值
str: The official gene symbol if found; otherwise, raises an Exception.
- submit_gene_list(gene_list)[源代码]¶
将基因列表提交至 Enrichr,并返回用户列表 ID。
- 参数
gene_list (str): Newline-separated string of gene names.
- 返回值
str: The user list ID from Enrichr.
- get_enrichment_results(user_list_id, library)[源代码]¶
获取特定库的扩展结果。
- 参数
user_list_id (str): The user list ID from Enrichr. library (str): The name of the enrichment library.
- 返回值
dict: The enrichment results.
- build_graph(genes, enrichment_results)[源代码]¶
初始化并构建包含基因节点和富集术语的图表。
- 参数
genes (list): List of gene names. enrichment_results (dict): Dictionary of enrichment results by library.
- 返回值
networkx.Graph: The constructed graph.
- rank_paths_by_weight(G, source, target)[源代码]¶
在源节点和目标节点之间查找路径,并根据总边权重进行排序。
- 参数
G (networkx.Graph): The graph to search. source (str): The source node. target (str): The target node.
- 返回值
list: List of tuples (path, weight) sorted by weight descending.