tooluniverse.gwas_tool moduleΒΆ

class tooluniverse.gwas_tool.BaseTool(tool_config)[source][source]ΒΆ

Bases: object

__init__(tool_config)[source][source]ΒΆ
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:

  1. Installed packages: Uses importlib.resources for proper package resource access

  2. Development mode: Falls back to file-based path resolution

  3. 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

classmethod load_defaults_from_file()[source][source]ΒΆ

Load defaults from the configuration file

run(arguments=None)[source][source]ΒΆ

Execute the tool.

The default BaseTool implementation accepts an optional arguments mapping to align with most concrete tool implementations which expect a dictionary of inputs.

check_function_call(function_call_json)[source][source]ΒΆ
get_required_parameters()[source][source]ΒΆ

Retrieve required parameters from the endpoint definition. Returns: list: List of required parameters for the given endpoint.

tooluniverse.gwas_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.gwas_tool.GWASRESTTool(tool_config)[source][source]ΒΆ

Bases: BaseTool

Base class for GWAS Catalog REST API tools.

__init__(tool_config)[source][source]ΒΆ
run(arguments: Dict[str, Any]) Dict[str, Any][source][source]ΒΆ

Execute the tool with given arguments.

class tooluniverse.gwas_tool.GWASAssociationSearch(tool_config)[source][source]ΒΆ

Bases: GWASRESTTool

Search for GWAS associations by various criteria.

__init__(tool_config)[source][source]ΒΆ
run(arguments: Dict[str, Any]) Dict[str, Any][source][source]ΒΆ

Search for associations with optional filters.

class tooluniverse.gwas_tool.GWASStudySearch(tool_config)[source][source]ΒΆ

Bases: GWASRESTTool

Search for GWAS studies by various criteria.

__init__(tool_config)[source][source]ΒΆ
run(arguments: Dict[str, Any]) Dict[str, Any][source][source]ΒΆ

Search for studies with optional filters.

class tooluniverse.gwas_tool.GWASSNPSearch(tool_config)[source][source]ΒΆ

Bases: GWASRESTTool

Search for GWAS single nucleotide polymorphisms (SNPs).

__init__(tool_config)[source][source]ΒΆ
run(arguments: Dict[str, Any]) Dict[str, Any][source][source]ΒΆ

Search for SNPs with optional filters.

class tooluniverse.gwas_tool.GWASAssociationByID(tool_config)[source][source]ΒΆ

Bases: GWASRESTTool

Get a specific GWAS association by its ID.

__init__(tool_config)[source][source]ΒΆ
run(arguments: Dict[str, Any]) Dict[str, Any][source][source]ΒΆ

Get association by ID.

class tooluniverse.gwas_tool.GWASStudyByID(tool_config)[source][source]ΒΆ

Bases: GWASRESTTool

Get a specific GWAS study by its ID.

__init__(tool_config)[source][source]ΒΆ
run(arguments: Dict[str, Any]) Dict[str, Any][source][source]ΒΆ

Get study by ID.

class tooluniverse.gwas_tool.GWASSNPByID(tool_config)[source][source]ΒΆ

Bases: GWASRESTTool

Get a specific GWAS SNP by its rs ID.

__init__(tool_config)[source][source]ΒΆ
run(arguments: Dict[str, Any]) Dict[str, Any][source][source]ΒΆ

Get SNP by rs ID.

class tooluniverse.gwas_tool.GWASVariantsForTrait(tool_config)[source][source]ΒΆ

Bases: GWASRESTTool

Get all variants associated with a specific trait.

__init__(tool_config)[source][source]ΒΆ
run(arguments: Dict[str, Any]) Dict[str, Any][source][source]ΒΆ

Get variants for a trait with pagination support.

class tooluniverse.gwas_tool.GWASAssociationsForTrait(tool_config)[source][source]ΒΆ

Bases: GWASRESTTool

Get all associations for a specific trait, sorted by p-value.

__init__(tool_config)[source][source]ΒΆ
run(arguments: Dict[str, Any]) Dict[str, Any][source][source]ΒΆ

Get associations for a trait, sorted by significance.

class tooluniverse.gwas_tool.GWASAssociationsForSNP(tool_config)[source][source]ΒΆ

Bases: GWASRESTTool

Get all associations for a specific SNP.

__init__(tool_config)[source][source]ΒΆ
run(arguments: Dict[str, Any]) Dict[str, Any][source][source]ΒΆ

Get associations for a SNP.

class tooluniverse.gwas_tool.GWASStudiesForTrait(tool_config)[source][source]ΒΆ

Bases: GWASRESTTool

Get studies for a specific trait with optional filters.

__init__(tool_config)[source][source]ΒΆ
run(arguments: Dict[str, Any]) Dict[str, Any][source][source]ΒΆ

Get studies for a trait with optional filters.

class tooluniverse.gwas_tool.GWASSNPsForGene(tool_config)[source][source]ΒΆ

Bases: GWASRESTTool

Get SNPs mapped to a specific gene.

__init__(tool_config)[source][source]ΒΆ
run(arguments: Dict[str, Any]) Dict[str, Any][source][source]ΒΆ

Get SNPs for a gene.

class tooluniverse.gwas_tool.GWASAssociationsForStudy(tool_config)[source][source]ΒΆ

Bases: GWASRESTTool

Get all associations for a specific study.

__init__(tool_config)[source][source]ΒΆ
run(arguments: Dict[str, Any]) Dict[str, Any][source][source]ΒΆ

Get associations for a study.