galaxy.tools.toolbox package

Submodules

galaxy.tools.toolbox.base module

class galaxy.tools.toolbox.base.AbstractToolBox(config_filenames, tool_root_dir, app)[source]

Bases: galaxy.util.dictifiable.Dictifiable, galaxy.tools.toolbox.integrated_panel.ManagesIntegratedToolPanelMixin

Abstract container for managing a ToolPanel - containing tools and workflows optionally in labelled sections.

add_tool_to_cache(tool, config_file)[source]
create_section(section_dict)[source]
create_tool(config_file, repository_id=None, guid=None, **kwds)[source]
dynamic_conf_filenames(include_migrated_tool_conf=False)[source]

Return list of dynamic tool configuration filenames (shed_tools). These must be used with various dynamic tool configuration update operations (e.g. with update_shed_config).

dynamic_confs(include_migrated_tool_conf=False)[source]
find_section_id(tool_panel_section_id)[source]

Find the section ID referenced by the key or return ‘’ indicating no such section id.

get_integrated_section_for_tool(tool)[source]
get_loaded_tools_by_lineage(tool_id)[source]

Get all loaded tools associated by lineage to the tool whose id is tool_id.

get_section(section_id, new_label=None, create_if_needed=False)[source]
get_sections()[source]
get_shed_config_dict_by_filename(filename, default=None)[source]
get_tool(tool_id, tool_version=None, get_all_versions=False, exact=False)[source]

Attempt to locate a tool in the tool box. Note that exact only refers to the tool_id, not the tool_version.

get_tool_id(tool_id)[source]

Take a tool id - potentially from a different Galaxy instance or that is no longer loaded - and find the closest match to the currently loaded tools (using get_tool for inexact matches which currently returns the oldest tool shed installed tool with the same short id).

get_tool_repository_from_xml_item(item, path)[source]
get_tool_to_dict(trans, tool)[source]

Return tool’s to_dict. Use cache if present, store to cache otherwise. Note: The cached tool’s to_dict is specific to the calls from toolbox.

handle_panel_update(section_dict)[source]

Extension-point for Galaxy-app specific reload logic.

This abstract representation of the toolbox shouldn’t have details about interacting with the rest of the Galaxy app or message queues, etc….

has_tool(tool_id, tool_version=None, exact=False)[source]
is_missing_shed_tool(tool_id)[source]

Confirm that the tool ID does reference a shed tool and is not installed.

load_hidden_lib_tool(path)[source]
load_hidden_tool(config_file, **kwds)[source]

Load a hidden tool (in this context meaning one that does not appear in the tool panel) and register it in _tools_by_id.

load_item(item, tool_path, panel_dict=None, integrated_panel_dict=None, load_panel_dict=True, guid=None, index=None, internal=False)[source]
load_tool(config_file, guid=None, repository_id=None, use_cached=False, **kwds)[source]

Load a single tool from the file named by config_file and return an instance of Tool.

load_tool_from_cache(config_file, recover_tool=False)[source]
package_tool(trans, tool_id)[source]

Create a tarball with the tool’s xml, help images, and test data. :param trans: the web transaction :param tool_id: the tool ID from app.toolbox :returns: tuple of tarball filename, success True/False, message/None

register_tool(tool)[source]
reload_tool_by_id(tool_id)[source]

Attempt to reload the tool identified by ‘tool_id’, if successful replace the old tool.

remove_tool_by_id(tool_id, remove_from_panel=True)[source]

Attempt to remove the tool identified by ‘tool_id’. Ignores tool lineage - so to remove a tool with potentially multiple versions send remove_from_panel=False and handle the logic of promoting the next newest version of the tool into the panel if needed.

to_dict(trans, in_panel=True, **kwds)[source]

Create a dictionary representation of the toolbox. Uses primitive cache for toolbox-specific tool ‘to_dict’s.

tool_panel_contents(trans, **kwds)[source]

Filter tool_panel contents for displaying for user.

tools()[source]
update_shed_config(shed_conf)[source]

Update the in-memory descriptions of tools and write out the changes to integrated tool panel unless we are just deactivating a tool (since that doesn’t affect that file).

watch_tool(tool)[source]
class galaxy.tools.toolbox.base.BaseGalaxyToolBox(config_filenames, tool_root_dir, app)[source]

Bases: galaxy.tools.toolbox.base.AbstractToolBox

Extend the AbstractToolBox with more Galaxy tooling-specific functionality. Adds dependencies on dependency resolution and tool loading modules, that an abstract description of panels shouldn’t really depend on.

reload_dependency_manager()[source]
sa_session

Returns a SQLAlchemy session

galaxy.tools.toolbox.integrated_panel module

class galaxy.tools.toolbox.integrated_panel.ManagesIntegratedToolPanelMixin[source]

Bases: object

galaxy.tools.toolbox.panel module

class galaxy.tools.toolbox.panel.HasPanelItems[source]

Bases: object

panel_items()[source]

Return an ordered dictionary-like object describing tool panel items (such as workflows, tools, labels, and sections).

panel_items_iter()[source]

Iterate through panel items each represented as a tuple of (panel_key, panel_type, panel_content).

class galaxy.tools.toolbox.panel.ToolPanelElements(dict=None)[source]

Bases: galaxy.util.odict.odict, galaxy.tools.toolbox.panel.HasPanelItems

Represents an ordered dictionary of tool entries - abstraction used both by tool panel itself (normal and integrated) and its sections.

append_section(key, section_elems)[source]
append_tool(tool)[source]
get_tool_with_id(tool_id)[source]
has_tool_with_id(tool_id)[source]
index_of_tool_id(tool_id)[source]
insert_tool(index, tool)[source]
panel_items()[source]

Return an ordered dictionary-like object describing tool panel items (such as workflows, tools, labels, and sections).

replace_tool(previous_tool_id, new_tool_id, tool)[source]
stub_label(key)[source]
stub_tool(key)[source]
stub_workflow(key)[source]
update_or_append(index, key, value)[source]
class galaxy.tools.toolbox.panel.ToolSection(item=None)[source]

Bases: galaxy.util.dictifiable.Dictifiable, galaxy.tools.toolbox.panel.HasPanelItems

A group of tools with similar type/purpose that will be displayed as a group in the user interface.

copy()[source]
dict_collection_visible_keys = ['id', 'name', 'version']
panel_items()[source]

Return an ordered dictionary-like object describing tool panel items (such as workflows, tools, labels, and sections).

to_dict(trans, link_details=False, toolbox=None)[source]

Return a dict that includes section’s attributes.

class galaxy.tools.toolbox.panel.ToolSectionLabel(item)[source]

Bases: galaxy.util.dictifiable.Dictifiable

A label for a set of tools that can be displayed above groups of tools and sections in the user interface

dict_collection_visible_keys = ['id', 'text', 'version']
to_dict(**kwds)[source]

Return item dictionary.

galaxy.tools.toolbox.parser module

This module is used to parse tool_conf files.

These files define tool lists, sections, labels, etc… the elements of the Galaxy tool panel.

galaxy.tools.toolbox.parser.get_toolbox_parser(config_filename)[source]
galaxy.tools.toolbox.parser.ensure_tool_conf_item(xml_or_item)[source]

galaxy.tools.toolbox.tags module

Handle details of tool tagging - perhaps a deprecated feature.

class galaxy.tools.toolbox.tags.AbstractToolTagManager[source]

Bases: object

handle_tags(tool_id, tool_definition_source)[source]

Parse out tags and persist them.

reset_tags()[source]

Starting to load tool panels, reset all tags.

class galaxy.tools.toolbox.tags.NullToolTagManager[source]

Bases: galaxy.tools.toolbox.tags.AbstractToolTagManager

handle_tags(tool_id, tool_definition_source)[source]

Parse out tags and persist them.

reset_tags()[source]

Starting to load tool panels, reset all tags.

class galaxy.tools.toolbox.tags.PersistentToolTagManager(app)[source]

Bases: galaxy.tools.toolbox.tags.AbstractToolTagManager

handle_tags(tool_id, tool_definition_source)[source]

Parse out tags and persist them.

reset_tags()[source]

Starting to load tool panels, reset all tags.

galaxy.tools.toolbox.tags.tool_tag_manager(app)[source]

Build a tool tag manager according to app’s configuration and return it.

galaxy.tools.toolbox.watcher module

class galaxy.tools.toolbox.watcher.LocFileEventHandler(loc_watcher)[source]

Bases: object

on_any_event(event)[source]
class galaxy.tools.toolbox.watcher.NullToolConfWatcher[source]

Bases: object

monitor(conf_path)[source]
shutdown()[source]
start()[source]
watch_file(tool_file, tool_id)[source]
class galaxy.tools.toolbox.watcher.NullWatcher[source]

Bases: object

shutdown()[source]
start()[source]
watch_directory(tool_dir, callback=None)[source]
watch_file(tool_file, tool_id)[source]
class galaxy.tools.toolbox.watcher.ToolConfWatcher(reload_callback, tool_cache=None)[source]

Bases: object

check()[source]

Check for changes in self.paths or self.cache and call the event handler.

monitor(path)[source]
shutdown()[source]
start()[source]
watch_file(tool_conf_file)[source]
class galaxy.tools.toolbox.watcher.ToolDataWatcher(observer_class, tool_data_tables)[source]

Bases: object

monitor(dir)[source]
shutdown()[source]
start()[source]
watch_directory(tool_data_dir)[source]
class galaxy.tools.toolbox.watcher.ToolFileEventHandler(tool_watcher)[source]

Bases: object

on_any_event(event)[source]
class galaxy.tools.toolbox.watcher.ToolWatcher(toolbox, observer_class)[source]

Bases: object

monitor(dir)[source]
shutdown()[source]
start()[source]
watch_directory(tool_dir, callback)[source]
watch_file(tool_file, tool_id)[source]
galaxy.tools.toolbox.watcher.get_observer_class(config_value, default, monitor_what_str)[source]
galaxy.tools.toolbox.watcher.get_tool_conf_watcher(reload_callback, tool_cache=None)[source]
galaxy.tools.toolbox.watcher.get_tool_data_dir_watcher(tool_data_tables, config)[source]
galaxy.tools.toolbox.watcher.get_tool_watcher(toolbox, config)[source]

Module contents

API for this module containing functionality related to the toolbox.

class galaxy.tools.toolbox.AbstractToolBox(config_filenames, tool_root_dir, app)[source]

Bases: galaxy.util.dictifiable.Dictifiable, galaxy.tools.toolbox.integrated_panel.ManagesIntegratedToolPanelMixin

Abstract container for managing a ToolPanel - containing tools and workflows optionally in labelled sections.

add_tool_to_cache(tool, config_file)[source]
create_section(section_dict)[source]
create_tool(config_file, repository_id=None, guid=None, **kwds)[source]
dynamic_conf_filenames(include_migrated_tool_conf=False)[source]

Return list of dynamic tool configuration filenames (shed_tools). These must be used with various dynamic tool configuration update operations (e.g. with update_shed_config).

dynamic_confs(include_migrated_tool_conf=False)[source]
find_section_id(tool_panel_section_id)[source]

Find the section ID referenced by the key or return ‘’ indicating no such section id.

get_integrated_section_for_tool(tool)[source]
get_loaded_tools_by_lineage(tool_id)[source]

Get all loaded tools associated by lineage to the tool whose id is tool_id.

get_section(section_id, new_label=None, create_if_needed=False)[source]
get_sections()[source]
get_shed_config_dict_by_filename(filename, default=None)[source]
get_tool(tool_id, tool_version=None, get_all_versions=False, exact=False)[source]

Attempt to locate a tool in the tool box. Note that exact only refers to the tool_id, not the tool_version.

get_tool_id(tool_id)[source]

Take a tool id - potentially from a different Galaxy instance or that is no longer loaded - and find the closest match to the currently loaded tools (using get_tool for inexact matches which currently returns the oldest tool shed installed tool with the same short id).

get_tool_repository_from_xml_item(item, path)[source]
get_tool_to_dict(trans, tool)[source]

Return tool’s to_dict. Use cache if present, store to cache otherwise. Note: The cached tool’s to_dict is specific to the calls from toolbox.

handle_panel_update(section_dict)[source]

Extension-point for Galaxy-app specific reload logic.

This abstract representation of the toolbox shouldn’t have details about interacting with the rest of the Galaxy app or message queues, etc….

has_tool(tool_id, tool_version=None, exact=False)[source]
is_missing_shed_tool(tool_id)[source]

Confirm that the tool ID does reference a shed tool and is not installed.

load_hidden_lib_tool(path)[source]
load_hidden_tool(config_file, **kwds)[source]

Load a hidden tool (in this context meaning one that does not appear in the tool panel) and register it in _tools_by_id.

load_item(item, tool_path, panel_dict=None, integrated_panel_dict=None, load_panel_dict=True, guid=None, index=None, internal=False)[source]
load_tool(config_file, guid=None, repository_id=None, use_cached=False, **kwds)[source]

Load a single tool from the file named by config_file and return an instance of Tool.

load_tool_from_cache(config_file, recover_tool=False)[source]
package_tool(trans, tool_id)[source]

Create a tarball with the tool’s xml, help images, and test data. :param trans: the web transaction :param tool_id: the tool ID from app.toolbox :returns: tuple of tarball filename, success True/False, message/None

register_tool(tool)[source]
reload_tool_by_id(tool_id)[source]

Attempt to reload the tool identified by ‘tool_id’, if successful replace the old tool.

remove_tool_by_id(tool_id, remove_from_panel=True)[source]

Attempt to remove the tool identified by ‘tool_id’. Ignores tool lineage - so to remove a tool with potentially multiple versions send remove_from_panel=False and handle the logic of promoting the next newest version of the tool into the panel if needed.

to_dict(trans, in_panel=True, **kwds)[source]

Create a dictionary representation of the toolbox. Uses primitive cache for toolbox-specific tool ‘to_dict’s.

tool_panel_contents(trans, **kwds)[source]

Filter tool_panel contents for displaying for user.

tools()[source]
update_shed_config(shed_conf)[source]

Update the in-memory descriptions of tools and write out the changes to integrated tool panel unless we are just deactivating a tool (since that doesn’t affect that file).

watch_tool(tool)[source]
class galaxy.tools.toolbox.BaseGalaxyToolBox(config_filenames, tool_root_dir, app)[source]

Bases: galaxy.tools.toolbox.base.AbstractToolBox

Extend the AbstractToolBox with more Galaxy tooling-specific functionality. Adds dependencies on dependency resolution and tool loading modules, that an abstract description of panels shouldn’t really depend on.

reload_dependency_manager()[source]
sa_session

Returns a SQLAlchemy session

class galaxy.tools.toolbox.ToolSection(item=None)[source]

Bases: galaxy.util.dictifiable.Dictifiable, galaxy.tools.toolbox.panel.HasPanelItems

A group of tools with similar type/purpose that will be displayed as a group in the user interface.

copy()[source]
dict_collection_visible_keys = ['id', 'name', 'version']
panel_items()[source]

Return an ordered dictionary-like object describing tool panel items (such as workflows, tools, labels, and sections).

to_dict(trans, link_details=False, toolbox=None)[source]

Return a dict that includes section’s attributes.

class galaxy.tools.toolbox.ToolSectionLabel(item)[source]

Bases: galaxy.util.dictifiable.Dictifiable

A label for a set of tools that can be displayed above groups of tools and sections in the user interface

dict_collection_visible_keys = ['id', 'text', 'version']
to_dict(**kwds)[source]

Return item dictionary.