galaxy.tools.parser package

Submodules

galaxy.tools.parser.cwl module

class galaxy.tools.parser.cwl.CwlPageSource(tool_proxy)[source]

Bases: galaxy.tools.parser.interface.PageSource

parse_input_sources()[source]

Return a list of InputSource objects.

class galaxy.tools.parser.cwl.CwlToolSource(tool_file, strict_cwl_validation=True)[source]

Bases: galaxy.tools.parser.interface.ToolSource

parse_command()[source]

Return string contianing command to run.

parse_description()[source]

Parse a description for tool. Longer than name, shorted than help.

parse_edam_operations()[source]
parse_edam_topics()[source]
parse_environment_variables()[source]

Return environment variable templates to expose.

parse_help()[source]

Return RST definition of help text for tool or None if the tool doesn’t define help text.

parse_id()[source]

Parse an ID describing the abstract tool. This is not the GUID tracked by the tool shed but the simple id (there may be multiple tools loaded in Galaxy with this same simple id).

parse_input_pages()[source]

Return a PagesSource representing inputs by page for tool.

parse_interpreter()[source]

Return string containing the interpreter to prepend to the command (for instance this might be ‘python’ to run a Python wrapper located adjacent to the tool).

parse_name()[source]

Parse a short name for tool (required).

parse_outputs(tool)[source]

Return a pair of output and output collections ordered dictionaries for use by Tool.

parse_profile()[source]

Return tool profile version as Galaxy major e.g. 16.01 or 16.04.

parse_requirements_and_containers()[source]

Return pair of ToolRequirement and ContainerDescription lists.

parse_sanitize()[source]

Return boolean indicating whether tool should be sanitized or not.

parse_stdio()[source]

Builds lists of ToolStdioExitCode and ToolStdioRegex objects to describe tool execution error conditions.

parse_strict_shell()[source]

Return True if tool commands should be executed with set -e.

parse_tool_type()[source]

Load simple tool type string (e.g. ‘data_source’, ‘default’).

parse_version()[source]

Parse a version describing the abstract tool.

tool_proxy

galaxy.tools.parser.factory module

Constructors for concrete tool and input source objects.

galaxy.tools.parser.factory.get_tool_source(config_file=None, xml_tree=None, enable_beta_formats=True, tool_location_fetcher=None)[source]

Return a ToolSource object corresponding to supplied source.

The supplied source may be specified as a file path (using the config_file parameter) or as an XML object loaded with load_tool_with_refereces.

galaxy.tools.parser.factory.get_input_source(content)[source]

Wrap an XML element in a XmlInputSource if needed.

If the supplied content is already an InputSource object, it is simply returned. This allow Galaxy to uniformly consume using the tool input source interface.

galaxy.tools.parser.interface module

class galaxy.tools.parser.interface.InputSource[source]

Bases: object

default_optional = False
elem()[source]
get(key, value=None)[source]

Return simple named properties as string for this input source. keys to be supported depend on the parameter type.

get_bool(key, default)[source]

Return simple named properties as boolean for this input source. keys to be supported depend on the parameter type.

parse_conversion_tuples()[source]

Return list of (name, extension) to describe explicit conversions.

parse_dynamic_options_elem()[source]

Return an XML elemnt describing dynamic options.

parse_help()[source]
parse_label()[source]
parse_nested_inputs_source()[source]
parse_optional(default=None)[source]

Return boolean indicating wheter parameter is optional.

parse_sanitizer_elem()[source]

Return an XML description of sanitizers. This is a stop gap until we can rework galaxy.tools.parameters.sanitize to not explicitly depend on XML.

parse_static_options()[source]

Return list of static options if this is a select type without defining a dynamic options.

parse_test_input_source()[source]
parse_validator_elems()[source]

Return an XML description of sanitizers. This is a stop gap until we can rework galaxy.tools.parameters.validation to not explicitly depend on XML.

parse_when_input_sources()[source]
class galaxy.tools.parser.interface.PageSource[source]

Bases: object

parse_display()[source]
parse_input_sources()[source]

Return a list of InputSource objects.

class galaxy.tools.parser.interface.PagesSource(page_sources)[source]

Bases: object

Contains a list of Pages - each a list of InputSources - each item in the outer list representing a page of inputs. Pages are deprecated so ideally this outer list will always be exactly a singleton.

inputs_defined
class galaxy.tools.parser.interface.TestCollectionDef(attrib, name, collection_type, elements)[source]

Bases: object

collect_inputs()[source]
static from_dict(as_dict)[source]
static from_xml(elem, parse_param_elem)[source]
to_dict()[source]
class galaxy.tools.parser.interface.TestCollectionOutputDef(name, attrib, element_tests)[source]

Bases: object

static from_dict(as_dict)[source]
to_dict()[source]
class galaxy.tools.parser.interface.ToolSource[source]

Bases: object

This interface represents an abstract source to parse tool information from.

default_is_multi_byte = False
macro_paths()[source]
parse_action_module()[source]

Load Tool class from a custom module. (Optional).

If not None, return pair containing module and class (as strings).

parse_command()[source]

Return string contianing command to run.

parse_description()[source]

Parse a description for tool. Longer than name, shorted than help.

parse_display_interface(default)[source]

Parse display_interface - fallback to default for the tool type (supplied as default parameter) if not specified.

parse_docker_env_pass_through()[source]
parse_environment_variables()[source]

Return environment variable templates to expose.

parse_help()[source]

Return RST definition of help text for tool or None if the tool doesn’t define help text.

parse_hidden()[source]

Return boolean indicating whether tool should be hidden in the tool menu.

parse_home_target()[source]

Should be “job_home”, “shared_home”, “job_tmp”, “pwd”, or None.

parse_id()[source]

Parse an ID describing the abstract tool. This is not the GUID tracked by the tool shed but the simple id (there may be multiple tools loaded in Galaxy with this same simple id).

parse_input_pages()[source]

Return a PagesSource representing inputs by page for tool.

parse_interpreter()[source]

Return string containing the interpreter to prepend to the command (for instance this might be ‘python’ to run a Python wrapper located adjacent to the tool).

parse_is_multi_byte()[source]

Parse is_multi_byte from tool - TODO: figure out what this is and document.

parse_name()[source]

Parse a short name for tool (required).

parse_outputs(tool)[source]

Return a pair of output and output collections ordered dictionaries for use by Tool.

parse_parallelism()[source]

Return a galaxy.jobs.ParallismInfo object describing task splitting or None.

parse_profile()[source]

Return tool profile version as Galaxy major e.g. 16.01 or 16.04.

parse_provided_metadata_file()[source]

Return location of provided metadata file (e.g. galaxy.json).

parse_provided_metadata_style()[source]

Return style of tool provided metadata file (e.g. galaxy.json).

A value of of “default” indicates the newer galaxy.json style (the default for XML-based tools with profile >= 17.09) and a value of “legacy” indicates the older galaxy.json style.

A short description of these two styles can be found at https://github.com/galaxyproject/galaxy/pull/4437.

parse_redirect_url_params_elem()[source]

Return an XML element describing redirect_url_params.

If we wish to support this feature for non-XML based tools this should be converted to return some sort of object interface instead of a RAW XML element.

parse_refresh()[source]

Return boolean indicating … I have no clue…

parse_request_param_translation_elem()[source]

Return an XML element describing require parameter translation.

If we wish to support this feature for non-XML based tools this should be converted to return some sort of object interface instead of a RAW XML element.

parse_require_login(default)[source]

Parse whether the tool requires login (as a bool).

parse_requirements_and_containers()[source]

Return pair of ToolRequirement and ContainerDescription lists.

parse_sanitize()[source]

Return boolean indicating whether tool should be sanitized or not.

parse_stdio()[source]

Builds lists of ToolStdioExitCode and ToolStdioRegex objects to describe tool execution error conditions.

parse_strict_shell()[source]

Return True if tool commands should be executed with set -e.

parse_tests_to_dict()[source]
parse_tmp_directory_vars()[source]

Directories to override if a tmp_target is not None.

parse_tmp_target()[source]

Should be “pwd”, “shared_home”, “job_tmp”, “job_tmp_if_explicit”, or None.

parse_tool_module()[source]

Load Tool class from a custom module. (Optional).

If not None, return pair containing module and class (as strings).

parse_tool_type()[source]

Load simple tool type string (e.g. ‘data_source’, ‘default’).

parse_version()[source]

Parse a version describing the abstract tool.

parse_version_command()[source]

Parse command used to determine version of primary application driving the tool. Return None to not generate or record such a command.

parse_version_command_interpreter()[source]

Parse command used to determine version of primary application driving the tool. Return None to not generate or record such a command.

class galaxy.tools.parser.interface.ToolStdioExitCode[source]

Bases: object

This is a container for the <stdio> element’s <exit_code> subelement. The exit_code element has a range of exit codes and the error level.

class galaxy.tools.parser.interface.ToolStdioRegex[source]

Bases: object

This is a container for the <stdio> element’s regex subelement. The regex subelement has a “match” attribute, a “sources” attribute that contains “output” and/or “error”, and a “level” attribute that contains “warning” or “fatal”.

galaxy.tools.parser.output_actions module

Support for dynamically modifying output attributes.

class galaxy.tools.parser.output_actions.BooleanFilter(parent, elem)[source]

Bases: galaxy.tools.parser.output_actions.ToolOutputActionOptionFilter

filter_options(options, other_values)[source]
tag = 'boolean'
class galaxy.tools.parser.output_actions.ColumnReplaceFilter(parent, elem)[source]

Bases: galaxy.tools.parser.output_actions.ToolOutputActionOptionFilter

filter_options(options, other_values)[source]
tag = 'column_replace'
class galaxy.tools.parser.output_actions.ColumnStripFilter(parent, elem)[source]

Bases: galaxy.tools.parser.output_actions.ToolOutputActionOptionFilter

filter_options(options, other_values)[source]
tag = 'column_strip'
class galaxy.tools.parser.output_actions.DatatypeIsInstanceToolOutputActionConditionalWhen(parent, config_elem, value)[source]

Bases: galaxy.tools.parser.output_actions.ToolOutputActionConditionalWhen

is_case(output_dataset, other_values)[source]
tag = 'when datatype_isinstance'
class galaxy.tools.parser.output_actions.FormatToolOutputAction(parent, elem)[source]

Bases: galaxy.tools.parser.output_actions.ToolOutputAction

apply_action(output_dataset, other_values)[source]
tag = 'format'
class galaxy.tools.parser.output_actions.FromDataTableOutputActionOption(parent, elem)[source]

Bases: galaxy.tools.parser.output_actions.ToolOutputActionOption

get_value(other_values)[source]
tag = 'from_data_table'
class galaxy.tools.parser.output_actions.FromFileToolOutputActionOption(parent, elem)[source]

Bases: galaxy.tools.parser.output_actions.ToolOutputActionOption

get_value(other_values)[source]
tag = 'from_file'
class galaxy.tools.parser.output_actions.FromParamToolOutputActionOption(parent, elem)[source]

Bases: galaxy.tools.parser.output_actions.ToolOutputActionOption

get_value(other_values)[source]
tag = 'from_param'
class galaxy.tools.parser.output_actions.InsertColumnToolOutputActionOptionFilter(parent, elem)[source]

Bases: galaxy.tools.parser.output_actions.ToolOutputActionOptionFilter

filter_options(options, other_values)[source]
tag = 'insert_column'
class galaxy.tools.parser.output_actions.MetadataToolOutputAction(parent, elem)[source]

Bases: galaxy.tools.parser.output_actions.ToolOutputAction

apply_action(output_dataset, other_values)[source]
tag = 'metadata'
class galaxy.tools.parser.output_actions.MetadataValueFilter(parent, elem)[source]

Bases: galaxy.tools.parser.output_actions.ToolOutputActionOptionFilter

filter_options(options, other_values)[source]
tag = 'metadata_value'
class galaxy.tools.parser.output_actions.MultipleSplitterFilter(parent, elem)[source]

Bases: galaxy.tools.parser.output_actions.ToolOutputActionOptionFilter

filter_options(options, other_values)[source]
tag = 'multiple_splitter'
class galaxy.tools.parser.output_actions.NullToolOutputActionOption(parent, elem)[source]

Bases: galaxy.tools.parser.output_actions.ToolOutputActionOption

get_value(other_values)[source]
tag = 'null_option'
class galaxy.tools.parser.output_actions.ParamValueToolOutputActionOptionFilter(parent, elem)[source]

Bases: galaxy.tools.parser.output_actions.ToolOutputActionOptionFilter

filter_options(options, other_values)[source]
tag = 'param_value'
class galaxy.tools.parser.output_actions.StringFunctionFilter(parent, elem)[source]

Bases: galaxy.tools.parser.output_actions.ToolOutputActionOptionFilter

filter_options(options, other_values)[source]
tag = 'string_function'
class galaxy.tools.parser.output_actions.ToolOutputAction(parent, elem)[source]

Bases: object

apply_action(output_dataset, other_values)[source]
classmethod from_elem(parent, elem)[source]

Loads the proper action by the type attribute of elem

tag = 'action'
tool
class galaxy.tools.parser.output_actions.ToolOutputActionConditional(parent, config_elem)[source]

Bases: object

apply_action(output_dataset, other_values)[source]
tag = 'conditional'
tool
class galaxy.tools.parser.output_actions.ToolOutputActionConditionalWhen(parent, config_elem, value)[source]

Bases: galaxy.tools.parser.output_actions.ToolOutputActionGroup

apply_action(output_dataset, other_values)[source]
classmethod from_elem(parent, when_elem)[source]

Loads the proper when by attributes of elem

get_ref(output_dataset, other_values)[source]
is_case(output_dataset, other_values)[source]
tag = 'when'
class galaxy.tools.parser.output_actions.ToolOutputActionGroup(parent, config_elem)[source]

Bases: object

Manages a set of tool output dataset actions directives

apply_action(output_dataset, other_values)[source]
tag = 'group'
tool
class galaxy.tools.parser.output_actions.ToolOutputActionOption(parent, elem)[source]

Bases: object

classmethod from_elem(parent, elem)[source]

Loads the proper action by the type attribute of elem

get_value(other_values)[source]
tag = 'object'
tool
class galaxy.tools.parser.output_actions.ToolOutputActionOptionFilter(parent, elem)[source]

Bases: object

filter_options(options, other_values)[source]
classmethod from_elem(parent, elem)[source]

Loads the proper action by the type attribute of elem

tag = 'filter'
tool
class galaxy.tools.parser.output_actions.ValueToolOutputActionConditionalWhen(parent, config_elem, value)[source]

Bases: galaxy.tools.parser.output_actions.ToolOutputActionConditionalWhen

is_case(output_dataset, other_values)[source]
tag = 'when value'
galaxy.tools.parser.output_actions.action_type

alias of galaxy.tools.parser.output_actions.FormatToolOutputAction

galaxy.tools.parser.output_actions.compare_endswith(value1, value2)[source]
galaxy.tools.parser.output_actions.compare_eq(value1, value2)[source]
galaxy.tools.parser.output_actions.compare_gt(value1, value2)[source]
galaxy.tools.parser.output_actions.compare_gte(value1, value2)[source]
galaxy.tools.parser.output_actions.compare_in(value1, value2)[source]
galaxy.tools.parser.output_actions.compare_lt(value1, value2)[source]
galaxy.tools.parser.output_actions.compare_lte(value1, value2)[source]
galaxy.tools.parser.output_actions.compare_neq(value1, value2)[source]
galaxy.tools.parser.output_actions.compare_startswith(value1, value2)[source]
galaxy.tools.parser.output_actions.filter_type

alias of galaxy.tools.parser.output_actions.ColumnReplaceFilter

galaxy.tools.parser.output_actions.option_type

alias of galaxy.tools.parser.output_actions.FromDataTableOutputActionOption

galaxy.tools.parser.output_actions.parse_cast_attribute(cast)[source]
galaxy.tools.parser.output_actions.parse_compare_type(compare)[source]

galaxy.tools.parser.output_collection_def module

This module define an abstract class for reasoning about Galaxy’s dataset collection after jobs are finished.

class galaxy.tools.parser.output_collection_def.DatasetCollectionDescription(**kwargs)[source]

Bases: object

class galaxy.tools.parser.output_collection_def.FilePatternDatasetCollectionDescription(**kwargs)[source]

Bases: galaxy.tools.parser.output_collection_def.DatasetCollectionDescription

discover_via = 'pattern'
class galaxy.tools.parser.output_collection_def.ToolProvidedMetadataDatasetCollection(**kwargs)[source]

Bases: galaxy.tools.parser.output_collection_def.DatasetCollectionDescription

discover_via = 'tool_provided_metadata'
galaxy.tools.parser.output_collection_def.dataset_collection_description(**kwargs)[source]
galaxy.tools.parser.output_collection_def.dataset_collector_descriptions_from_elem(elem, legacy=True)[source]
galaxy.tools.parser.output_collection_def.dataset_collector_descriptions_from_list(discover_datasets_dicts)[source]

galaxy.tools.parser.output_objects module

class galaxy.tools.parser.output_objects.ToolOutput(name, format=None, format_source=None, metadata_source=None, parent=None, label=None, filters=None, actions=None, hidden=False, implicit=False)[source]

Bases: galaxy.tools.parser.output_objects.ToolOutputBase

Represents an output datasets produced by a tool. For backward compatibility this behaves as if it were the tuple:

(format, metadata_source, parent)
dict_collection_visible_keys = ['name', 'format', 'label', 'hidden']
to_dict(view='collection', value_mapper=None, app=None)[source]

Return item dictionary.

class galaxy.tools.parser.output_objects.ToolOutputBase(name, label=None, filters=None, hidden=False)[source]

Bases: galaxy.util.dictifiable.Dictifiable

to_dict(view='collection', value_mapper=None, app=None)[source]

Return item dictionary.

class galaxy.tools.parser.output_objects.ToolOutputCollection(name, structure, label=None, filters=None, hidden=False, default_format='data', default_format_source=None, default_metadata_source=None, inherit_format=False, inherit_metadata=False)[source]

Bases: galaxy.tools.parser.output_objects.ToolOutputBase

Represents a HistoryDatasetCollectionAssociation of output datasets produced by a tool.

<outputs>
<collection type=”list” label=”${tool.name} on ${on_string} fasta”>
<discover_datasets pattern=”__name__” ext=”fasta” visible=”True” directory=”outputFiles” />

</collection> <collection type=”paired” label=”${tool.name} on ${on_string} paired reads”>

<data name=”forward” format=”fastqsanger” /> <data name=”reverse” format=”fastqsanger”/>

</collection>

<outputs>

dataset_collector_descriptions
dict_collection_visible_keys = ['name', 'default_format', 'label', 'hidden', 'inherit_format', 'inherit_metadata']
dynamic_structure
known_outputs(inputs, type_registry)[source]
class galaxy.tools.parser.output_objects.ToolOutputCollectionPart(output_collection_def, element_identifier, output_def, parent_ids=[])[source]

Bases: object

effective_output_name
static is_named_collection_part_name(name)[source]
static split_output_name(name)[source]
class galaxy.tools.parser.output_objects.ToolOutputCollectionStructure(collection_type, collection_type_source=None, collection_type_from_rules=None, structured_like=None, dataset_collector_descriptions=None)[source]

Bases: object

collection_prototype(inputs, type_registry)[source]

galaxy.tools.parser.util module

galaxy.tools.parser.util.aggressive_error_checks()[source]
galaxy.tools.parser.util.error_on_exit_code(out_of_memory_exit_code=None)[source]

galaxy.tools.parser.xml module

class galaxy.tools.parser.xml.StdioParser(root)[source]

Bases: object

parse_error_level(err_level)[source]

Parses error level and returns error level enumeration. If unparsable, returns ‘fatal’

parse_stdio_exit_codes(stdio_elem)[source]

Parse the tool’s <stdio> element’s <exit_code> subelements. This will add all of those elements, if any, to self.stdio_exit_codes.

parse_stdio_regexes(stdio_elem)[source]

Look in the tool’s <stdio> elem for all <regex> subelements that define how to look for warnings and fatal errors in stdout and stderr. This will add all such regex elements to the Tols’s stdio_regexes list.

class galaxy.tools.parser.xml.XmlInputSource(input_elem)[source]

Bases: galaxy.tools.parser.interface.InputSource

elem()[source]
get(key, value=None)[source]

Return simple named properties as string for this input source. keys to be supported depend on the parameter type.

get_bool(key, default)[source]

Return simple named properties as boolean for this input source. keys to be supported depend on the parameter type.

parse_conversion_tuples()[source]

Return list of (name, extension) to describe explicit conversions.

parse_dynamic_options_elem()[source]

Return a galaxy.tools.parameters.dynamic_options.DynamicOptions if appropriate.

parse_help()[source]
parse_input_type()[source]
parse_label()[source]
parse_nested_inputs_source()[source]
parse_optional(default=None)[source]

Return boolean indicating wheter parameter is optional.

parse_sanitizer_elem()[source]

Return an XML description of sanitizers. This is a stop gap until we can rework galaxy.tools.parameters.sanitize to not explicitly depend on XML.

parse_static_options()[source]

Return list of static options if this is a select type without defining a dynamic options.

parse_test_input_source()[source]
parse_validator_elems()[source]

Return an XML description of sanitizers. This is a stop gap until we can rework galaxy.tools.parameters.validation to not explicitly depend on XML.

parse_when_input_sources()[source]
class galaxy.tools.parser.xml.XmlPageSource(parent_elem)[source]

Bases: galaxy.tools.parser.interface.PageSource

parse_display()[source]
parse_input_sources()[source]

Return a list of InputSource objects.

class galaxy.tools.parser.xml.XmlPagesSource(root)[source]

Bases: galaxy.tools.parser.interface.PagesSource

inputs_defined
class galaxy.tools.parser.xml.XmlToolSource(xml_tree, source_path=None, macro_paths=None)[source]

Bases: galaxy.tools.parser.interface.ToolSource

Responsible for parsing a tool from classic Galaxy representation.

macro_paths()[source]
parse_action_module()[source]

Load Tool class from a custom module. (Optional).

If not None, return pair containing module and class (as strings).

parse_command()[source]

Return string contianing command to run.

parse_description()[source]

Parse a description for tool. Longer than name, shorted than help.

parse_display_interface(default)[source]

Parse display_interface - fallback to default for the tool type (supplied as default parameter) if not specified.

parse_docker_env_pass_through()[source]
parse_edam_operations()[source]
parse_edam_topics()[source]
parse_environment_variables()[source]

Return environment variable templates to expose.

parse_help()[source]

Return RST definition of help text for tool or None if the tool doesn’t define help text.

parse_hidden()[source]

Return boolean indicating whether tool should be hidden in the tool menu.

parse_home_target()[source]

Should be “job_home”, “shared_home”, “job_tmp”, “pwd”, or None.

parse_id()[source]

Parse an ID describing the abstract tool. This is not the GUID tracked by the tool shed but the simple id (there may be multiple tools loaded in Galaxy with this same simple id).

parse_input_pages()[source]

Return a PagesSource representing inputs by page for tool.

parse_interpreter()[source]

Return string containing the interpreter to prepend to the command (for instance this might be ‘python’ to run a Python wrapper located adjacent to the tool).

parse_is_multi_byte()[source]

Parse is_multi_byte from tool - TODO: figure out what this is and document.

parse_name()[source]

Parse a short name for tool (required).

parse_outputs(tool)[source]

Return a pair of output and output collections ordered dictionaries for use by Tool.

parse_parallelism()[source]

Return a galaxy.jobs.ParallismInfo object describing task splitting or None.

parse_profile()[source]

Return tool profile version as Galaxy major e.g. 16.01 or 16.04.

parse_provided_metadata_file()[source]

Return location of provided metadata file (e.g. galaxy.json).

parse_provided_metadata_style()[source]

Return style of tool provided metadata file (e.g. galaxy.json).

A value of of “default” indicates the newer galaxy.json style (the default for XML-based tools with profile >= 17.09) and a value of “legacy” indicates the older galaxy.json style.

A short description of these two styles can be found at https://github.com/galaxyproject/galaxy/pull/4437.

parse_redirect_url_params_elem()[source]

Return an XML element describing redirect_url_params.

If we wish to support this feature for non-XML based tools this should be converted to return some sort of object interface instead of a RAW XML element.

parse_refresh()[source]

Return boolean indicating … I have no clue…

parse_request_param_translation_elem()[source]

Return an XML element describing require parameter translation.

If we wish to support this feature for non-XML based tools this should be converted to return some sort of object interface instead of a RAW XML element.

parse_require_login(default)[source]

Parse whether the tool requires login (as a bool).

parse_requirements_and_containers()[source]

Return pair of ToolRequirement and ContainerDescription lists.

parse_sanitize()[source]

Return boolean indicating whether tool should be sanitized or not.

parse_stdio()[source]

Builds lists of ToolStdioExitCode and ToolStdioRegex objects to describe tool execution error conditions.

parse_strict_shell()[source]

Return True if tool commands should be executed with set -e.

parse_tests_to_dict()[source]
parse_tmp_target()[source]

Should be “pwd”, “shared_home”, “job_tmp”, “job_tmp_if_explicit”, or None.

parse_tool_module()[source]

Load Tool class from a custom module. (Optional).

If not None, return pair containing module and class (as strings).

parse_tool_type()[source]

Load simple tool type string (e.g. ‘data_source’, ‘default’).

parse_version()[source]

Parse a version describing the abstract tool.

parse_version_command()[source]

Parse command used to determine version of primary application driving the tool. Return None to not generate or record such a command.

parse_version_command_interpreter()[source]

Parse command used to determine version of primary application driving the tool. Return None to not generate or record such a command.

galaxy.tools.parser.yaml module

class galaxy.tools.parser.yaml.YamlInputSource(input_dict)[source]

Bases: galaxy.tools.parser.interface.InputSource

get(key, default=None)[source]

Return simple named properties as string for this input source. keys to be supported depend on the parameter type.

get_bool(key, default)[source]

Return simple named properties as boolean for this input source. keys to be supported depend on the parameter type.

parse_input_type()[source]
parse_nested_inputs_source()[source]
parse_static_options()[source]

Return list of static options if this is a select type without defining a dynamic options.

parse_test_input_source()[source]
parse_when_input_sources()[source]
class galaxy.tools.parser.yaml.YamlPageSource(inputs_list)[source]

Bases: galaxy.tools.parser.interface.PageSource

parse_input_sources()[source]

Return a list of InputSource objects.

class galaxy.tools.parser.yaml.YamlToolSource(root_dict, source_path=None)[source]

Bases: galaxy.tools.parser.interface.ToolSource

parse_command()[source]

Return string contianing command to run.

parse_description()[source]

Parse a description for tool. Longer than name, shorted than help.

parse_display_interface(default)[source]

Parse display_interface - fallback to default for the tool type (supplied as default parameter) if not specified.

parse_edam_operations()[source]
parse_edam_topics()[source]
parse_environment_variables()[source]

Return environment variable templates to expose.

parse_help()[source]

Return RST definition of help text for tool or None if the tool doesn’t define help text.

parse_id()[source]

Parse an ID describing the abstract tool. This is not the GUID tracked by the tool shed but the simple id (there may be multiple tools loaded in Galaxy with this same simple id).

parse_input_pages()[source]

Return a PagesSource representing inputs by page for tool.

parse_interpreter()[source]

Return string containing the interpreter to prepend to the command (for instance this might be ‘python’ to run a Python wrapper located adjacent to the tool).

parse_is_multi_byte()[source]

Parse is_multi_byte from tool - TODO: figure out what this is and document.

parse_name()[source]

Parse a short name for tool (required).

parse_outputs(tool)[source]

Return a pair of output and output collections ordered dictionaries for use by Tool.

parse_profile()[source]

Return tool profile version as Galaxy major e.g. 16.01 or 16.04.

parse_require_login(default)[source]

Parse whether the tool requires login (as a bool).

parse_requirements_and_containers()[source]

Return pair of ToolRequirement and ContainerDescription lists.

parse_sanitize()[source]

Return boolean indicating whether tool should be sanitized or not.

parse_stdio()[source]

Builds lists of ToolStdioExitCode and ToolStdioRegex objects to describe tool execution error conditions.

parse_strict_shell()[source]

Return True if tool commands should be executed with set -e.

parse_tests_to_dict()[source]
parse_version()[source]

Parse a version describing the abstract tool.

parse_version_command()[source]

Parse command used to determine version of primary application driving the tool. Return None to not generate or record such a command.

parse_version_command_interpreter()[source]

Parse command used to determine version of primary application driving the tool. Return None to not generate or record such a command.

Module contents

Package responsible for parsing tools from files/abstract tool sources.

galaxy.tools.parser.get_input_source(content)[source]

Wrap an XML element in a XmlInputSource if needed.

If the supplied content is already an InputSource object, it is simply returned. This allow Galaxy to uniformly consume using the tool input source interface.

galaxy.tools.parser.get_tool_source(config_file=None, xml_tree=None, enable_beta_formats=True, tool_location_fetcher=None)[source]

Return a ToolSource object corresponding to supplied source.

The supplied source may be specified as a file path (using the config_file parameter) or as an XML object loaded with load_tool_with_refereces.

class galaxy.tools.parser.ToolOutputCollectionPart(output_collection_def, element_identifier, output_def, parent_ids=[])[source]

Bases: object

effective_output_name
static is_named_collection_part_name(name)[source]
static split_output_name(name)[source]
class galaxy.tools.parser.ToolSource[source]

Bases: object

This interface represents an abstract source to parse tool information from.

default_is_multi_byte = False
macro_paths()[source]
parse_action_module()[source]

Load Tool class from a custom module. (Optional).

If not None, return pair containing module and class (as strings).

parse_command()[source]

Return string contianing command to run.

parse_description()[source]

Parse a description for tool. Longer than name, shorted than help.

parse_display_interface(default)[source]

Parse display_interface - fallback to default for the tool type (supplied as default parameter) if not specified.

parse_docker_env_pass_through()[source]
parse_environment_variables()[source]

Return environment variable templates to expose.

parse_help()[source]

Return RST definition of help text for tool or None if the tool doesn’t define help text.

parse_hidden()[source]

Return boolean indicating whether tool should be hidden in the tool menu.

parse_home_target()[source]

Should be “job_home”, “shared_home”, “job_tmp”, “pwd”, or None.

parse_id()[source]

Parse an ID describing the abstract tool. This is not the GUID tracked by the tool shed but the simple id (there may be multiple tools loaded in Galaxy with this same simple id).

parse_input_pages()[source]

Return a PagesSource representing inputs by page for tool.

parse_interpreter()[source]

Return string containing the interpreter to prepend to the command (for instance this might be ‘python’ to run a Python wrapper located adjacent to the tool).

parse_is_multi_byte()[source]

Parse is_multi_byte from tool - TODO: figure out what this is and document.

parse_name()[source]

Parse a short name for tool (required).

parse_outputs(tool)[source]

Return a pair of output and output collections ordered dictionaries for use by Tool.

parse_parallelism()[source]

Return a galaxy.jobs.ParallismInfo object describing task splitting or None.

parse_profile()[source]

Return tool profile version as Galaxy major e.g. 16.01 or 16.04.

parse_provided_metadata_file()[source]

Return location of provided metadata file (e.g. galaxy.json).

parse_provided_metadata_style()[source]

Return style of tool provided metadata file (e.g. galaxy.json).

A value of of “default” indicates the newer galaxy.json style (the default for XML-based tools with profile >= 17.09) and a value of “legacy” indicates the older galaxy.json style.

A short description of these two styles can be found at https://github.com/galaxyproject/galaxy/pull/4437.

parse_redirect_url_params_elem()[source]

Return an XML element describing redirect_url_params.

If we wish to support this feature for non-XML based tools this should be converted to return some sort of object interface instead of a RAW XML element.

parse_refresh()[source]

Return boolean indicating … I have no clue…

parse_request_param_translation_elem()[source]

Return an XML element describing require parameter translation.

If we wish to support this feature for non-XML based tools this should be converted to return some sort of object interface instead of a RAW XML element.

parse_require_login(default)[source]

Parse whether the tool requires login (as a bool).

parse_requirements_and_containers()[source]

Return pair of ToolRequirement and ContainerDescription lists.

parse_sanitize()[source]

Return boolean indicating whether tool should be sanitized or not.

parse_stdio()[source]

Builds lists of ToolStdioExitCode and ToolStdioRegex objects to describe tool execution error conditions.

parse_strict_shell()[source]

Return True if tool commands should be executed with set -e.

parse_tests_to_dict()[source]
parse_tmp_directory_vars()[source]

Directories to override if a tmp_target is not None.

parse_tmp_target()[source]

Should be “pwd”, “shared_home”, “job_tmp”, “job_tmp_if_explicit”, or None.

parse_tool_module()[source]

Load Tool class from a custom module. (Optional).

If not None, return pair containing module and class (as strings).

parse_tool_type()[source]

Load simple tool type string (e.g. ‘data_source’, ‘default’).

parse_version()[source]

Parse a version describing the abstract tool.

parse_version_command()[source]

Parse command used to determine version of primary application driving the tool. Return None to not generate or record such a command.

parse_version_command_interpreter()[source]

Parse command used to determine version of primary application driving the tool. Return None to not generate or record such a command.