tooluniverse.enrichr_tool module¶
- class tooluniverse.enrichr_tool.BaseTool(tool_config)[source][source]¶
Bases:
object
- classmethod get_default_config_file()[source][source]¶
Get the path to the default configuration file for this tool type.
This method uses a robust path resolution strategy that works across different installation scenarios:
Installed packages: Uses importlib.resources for proper package resource access
Development mode: Falls back to file-based path resolution
Legacy Python: Handles importlib.resources and importlib_resources
Override this method in subclasses to specify a custom defaults file.
- Returns:
Path or resource object pointing to the defaults file
- tooluniverse.enrichr_tool.register_tool(tool_type_name=None, config=None)[source][source]¶
Decorator to automatically register tool classes and their configs.
- Usage:
@register_tool(‘CustomToolName’, config={…}) class MyTool:
pass
- class tooluniverse.enrichr_tool.EnrichrTool(tool_config)[source][source]¶
Bases:
BaseTool
Tool to perform gene enrichment analysis using Enrichr.
- get_official_gene_name(gene_name)[source][source]¶
Retrieve the official gene symbol for a given gene name or synonym using the MyGene.info API.
- submit_gene_list(gene_list)[source][source]¶
Submit the gene list to Enrichr and return the user list ID.
- get_enrichment_results(user_list_id, library)[source][source]¶
Fetch enrichment results for a specific library.
- build_graph(genes, enrichment_results)[source][source]¶
Initialize and build the graph with gene nodes and enriched terms.
- rank_paths_by_weight(G, source, target)[source][source]¶
Find and rank paths between source and target based on total edge weight.