tooluniverse.ensembl_tool module

Ensembl REST API Tool

This tool provides access to the Ensembl genome browser database for gene lookup, sequence retrieval, variant information, homology data, and more.

class tooluniverse.ensembl_tool.EnsemblRESTTool[source]

Bases: BaseTool

Generic Ensembl REST API tool. Handles all Ensembl endpoints based on endpoint template in JSON config. Supports path parameters (e.g., {species}, {id}) and query parameters.

__init__(tool_config)[source]
run(arguments)[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.

Parameters:
  • arguments (dict, optional) – Tool-specific arguments

  • stream_callback (callable, optional) – Callback for streaming responses

  • use_cache (bool, optional) – Whether result caching is enabled

  • validate (bool, optional) – Whether parameter validation was performed

Note

These additional parameters (stream_callback, use_cache, validate) are passed from run_one_function() to provide context about the execution. Tools can use these for optimization or special handling.

For backward compatibility, tools that don’t accept these parameters will still work - they will only receive the arguments parameter.

class tooluniverse.ensembl_tool.EnsemblLookupGene[source]

Bases: EnsemblRESTTool

Legacy: Lookup gene information by ID or symbol. Use EnsemblRESTTool with endpoint=’/lookup/id/{id}’ instead.

__init__(tool_config)[source]
class tooluniverse.ensembl_tool.EnsemblGetSequence[source]

Bases: EnsemblRESTTool

Legacy: Get DNA or protein sequences. Use EnsemblRESTTool with endpoint=’/sequence/id/{id}’ instead.

__init__(tool_config)[source]
class tooluniverse.ensembl_tool.EnsemblGetVariants[source]

Bases: EnsemblRESTTool

Legacy: Get variant information. Use EnsemblRESTTool with endpoint=’/overlap/region/{species}/{region}’ instead.

__init__(tool_config)[source]