Warning
This document is for an old release of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.
galaxy.tool_util.parser package¶
Package responsible for parsing tools from files/abstract tool sources.
-
galaxy.tool_util.parser.
get_input_source
(content)[source]¶ Wrap dicts or XML elements as InputSource 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.tool_util.parser.
get_tool_source
(config_file=None, xml_tree=None, enable_beta_formats=True, tool_location_fetcher=None, macro_paths=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.tool_util.parser.
get_tool_source_from_representation
(tool_format, tool_representation)[source]¶
-
class
galaxy.tool_util.parser.
RequiredFiles
(includes: List[Dict], excludes: List[Dict], extend_default_excludes: bool)[source]¶ Bases:
object
-
class
galaxy.tool_util.parser.
ToolOutputCollectionPart
(output_collection_def, element_identifier, output_def, parent_ids=None)[source]¶ Bases:
object
-
__init__
(output_collection_def, element_identifier, output_def, parent_ids=None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
property
effective_output_name
¶
-
-
class
galaxy.tool_util.parser.
ToolSource
[source]¶ Bases:
object
This interface represents an abstract source to parse tool information from.
-
default_is_multi_byte
= False¶
-
abstract
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_tool_module
()[source]¶ Load Tool class from a custom module. (Optional).
If not None, return pair containing module and class (as strings).
-
parse_action_module
()[source]¶ Load Tool class from a custom module. (Optional).
If not None, return pair containing module and class (as strings).
-
abstract
parse_description
()[source]¶ Parse a description for tool. Longer than name, shorted than help.
-
parse_is_multi_byte
()[source]¶ Parse is_multi_byte from tool - TODO: figure out what this is and document.
-
parse_display_interface
(default)[source]¶ Parse display_interface - fallback to default for the tool type (supplied as default parameter) if not specified.
-
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_tmp_target
()[source]¶ Should be “pwd”, “shared_home”, “job_tmp”, “job_tmp_if_explicit”, or None.
-
abstract
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_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_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.
-
parse_parallelism
()[source]¶ Return a galaxy.jobs.ParallismInfo object describing task splitting or None.
Return boolean indicating whether tool should be hidden in the tool menu.
-
parse_required_files
() → Optional[galaxy.tool_util.parser.interface.RequiredFiles][source]¶ Parse explicit RequiredFiles object or return None to let Galaxy decide implicit logic.
-
abstract
parse_requirements_and_containers
()[source]¶ Return pair of ToolRequirement and ContainerDescription lists.
-
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_provided_metadata_file
()[source]¶ Return location of provided metadata file (e.g. galaxy.json).
-
abstract
parse_outputs
(tool)[source]¶ Return a pair of output and output collections ordered dictionaries for use by Tool.
-
abstract
parse_stdio
()[source]¶ Builds lists of ToolStdioExitCode and ToolStdioRegex objects to describe tool execution error conditions.
-
abstract
parse_help
()[source]¶ Return RST definition of help text for tool or None if the tool doesn’t define help text.
-
abstract
parse_python_template_version
()[source]¶ Return minimum python version that the tool template has been developed against.
-
parse_creator
()[source]¶ Return list of metadata relating to creator/author of tool.
Result should be list of schema.org data model Person or Organization objects.
-
property
macro_paths
¶
-
property
source_path
¶
-
Submodules¶
galaxy.tool_util.parser.cwl module¶
-
class
galaxy.tool_util.parser.cwl.
CwlToolSource
(tool_file, strict_cwl_validation=True)[source]¶ Bases:
galaxy.tool_util.parser.interface.ToolSource
-
__init__
(tool_file, strict_cwl_validation=True)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
property
source_path
¶
-
property
tool_proxy
¶
-
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_help
()[source]¶ Return RST definition of help text for tool or None if the tool doesn’t define help text.
-
parse_stdio
()[source]¶ Builds lists of ToolStdioExitCode and ToolStdioRegex objects to describe tool execution error conditions.
-
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_outputs
(tool)[source]¶ Return a pair of output and output collections ordered dictionaries for use by Tool.
-
galaxy.tool_util.parser.factory module¶
Constructors for concrete tool and input source objects.
-
galaxy.tool_util.parser.factory.
get_tool_source
(config_file=None, xml_tree=None, enable_beta_formats=True, tool_location_fetcher=None, macro_paths=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.tool_util.parser.interface module¶
-
class
galaxy.tool_util.parser.interface.
ToolSource
[source]¶ Bases:
object
This interface represents an abstract source to parse tool information from.
-
default_is_multi_byte
= False¶
-
abstract
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_tool_module
()[source]¶ Load Tool class from a custom module. (Optional).
If not None, return pair containing module and class (as strings).
-
parse_action_module
()[source]¶ Load Tool class from a custom module. (Optional).
If not None, return pair containing module and class (as strings).
-
abstract
parse_description
()[source]¶ Parse a description for tool. Longer than name, shorted than help.
-
parse_is_multi_byte
()[source]¶ Parse is_multi_byte from tool - TODO: figure out what this is and document.
-
parse_display_interface
(default)[source]¶ Parse display_interface - fallback to default for the tool type (supplied as default parameter) if not specified.
-
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_tmp_target
()[source]¶ Should be “pwd”, “shared_home”, “job_tmp”, “job_tmp_if_explicit”, or None.
-
abstract
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_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_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.
-
parse_parallelism
()[source]¶ Return a galaxy.jobs.ParallismInfo object describing task splitting or None.
Return boolean indicating whether tool should be hidden in the tool menu.
-
parse_required_files
() → Optional[galaxy.tool_util.parser.interface.RequiredFiles][source]¶ Parse explicit RequiredFiles object or return None to let Galaxy decide implicit logic.
-
abstract
parse_requirements_and_containers
()[source]¶ Return pair of ToolRequirement and ContainerDescription lists.
-
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_provided_metadata_file
()[source]¶ Return location of provided metadata file (e.g. galaxy.json).
-
abstract
parse_outputs
(tool)[source]¶ Return a pair of output and output collections ordered dictionaries for use by Tool.
-
abstract
parse_stdio
()[source]¶ Builds lists of ToolStdioExitCode and ToolStdioRegex objects to describe tool execution error conditions.
-
abstract
parse_help
()[source]¶ Return RST definition of help text for tool or None if the tool doesn’t define help text.
-
abstract
parse_python_template_version
()[source]¶ Return minimum python version that the tool template has been developed against.
-
parse_creator
()[source]¶ Return list of metadata relating to creator/author of tool.
Result should be list of schema.org data model Person or Organization objects.
-
property
macro_paths
¶
-
property
source_path
¶
-
-
class
galaxy.tool_util.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.
-
property
inputs_defined
¶
-
property
-
class
galaxy.tool_util.parser.interface.
InputSource
[source]¶ Bases:
object
-
default_optional
= False¶
-
abstract
get
(key, value=None)[source]¶ Return simple named properties as string for this input source. keys to be supported depend on the parameter type.
-
abstract
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_name
()[source]¶ Return name of an input source returns the name or if absent the argument property In the latter case, leading dashes are stripped and all remaining dashes are replaced by underscores.
-
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_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_static_options
()[source]¶ Return list of static options if this is a select type without defining a dynamic options.
-
-
class
galaxy.tool_util.parser.interface.
TestCollectionDef
(attrib, name, collection_type, elements)[source]¶ Bases:
object
-
class
galaxy.tool_util.parser.interface.
RequiredFiles
(includes: List[Dict], excludes: List[Dict], extend_default_excludes: bool)[source]¶ Bases:
object
galaxy.tool_util.parser.output_actions module¶
Support for dynamically modifying output attributes.
-
class
galaxy.tool_util.parser.output_actions.
ToolOutputActionGroup
(parent, config_elem)[source]¶ Bases:
object
Manages a set of tool output dataset actions directives
-
tag
= 'group'¶
-
__init__
(parent, config_elem)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
property
tool
¶
-
-
class
galaxy.tool_util.parser.output_actions.
ToolOutputActionConditionalWhen
(parent, config_elem, value)[source]¶ Bases:
galaxy.tool_util.parser.output_actions.ToolOutputActionGroup
-
tag
= 'when'¶
-
-
class
galaxy.tool_util.parser.output_actions.
ValueToolOutputActionConditionalWhen
(parent, config_elem, value)[source]¶ Bases:
galaxy.tool_util.parser.output_actions.ToolOutputActionConditionalWhen
-
tag
= 'when value'¶
-
-
class
galaxy.tool_util.parser.output_actions.
DatatypeIsInstanceToolOutputActionConditionalWhen
(parent, config_elem, value)[source]¶ Bases:
galaxy.tool_util.parser.output_actions.ToolOutputActionConditionalWhen
-
tag
= 'when datatype_isinstance'¶
-
-
class
galaxy.tool_util.parser.output_actions.
ToolOutputActionConditional
(parent, config_elem)[source]¶ Bases:
object
-
tag
= 'conditional'¶
-
__init__
(parent, config_elem)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
property
tool
¶
-
-
class
galaxy.tool_util.parser.output_actions.
ToolOutputAction
(parent, elem)[source]¶ Bases:
object
-
tag
= 'action'¶
-
property
tool
¶
-
-
class
galaxy.tool_util.parser.output_actions.
ToolOutputActionOption
(parent, elem)[source]¶ Bases:
object
-
tag
= 'object'¶
-
property
tool
¶
-
-
class
galaxy.tool_util.parser.output_actions.
NullToolOutputActionOption
(parent, elem)[source]¶ Bases:
galaxy.tool_util.parser.output_actions.ToolOutputActionOption
-
tag
= 'null_option'¶
-
-
class
galaxy.tool_util.parser.output_actions.
FromFileToolOutputActionOption
(parent, elem)[source]¶ Bases:
galaxy.tool_util.parser.output_actions.ToolOutputActionOption
-
tag
= 'from_file'¶
-
-
class
galaxy.tool_util.parser.output_actions.
FromParamToolOutputActionOption
(parent, elem)[source]¶ Bases:
galaxy.tool_util.parser.output_actions.ToolOutputActionOption
-
tag
= 'from_param'¶
-
-
class
galaxy.tool_util.parser.output_actions.
FromDataTableOutputActionOption
(parent, elem)[source]¶ Bases:
galaxy.tool_util.parser.output_actions.ToolOutputActionOption
-
tag
= 'from_data_table'¶
-
-
class
galaxy.tool_util.parser.output_actions.
MetadataToolOutputAction
(parent, elem)[source]¶ Bases:
galaxy.tool_util.parser.output_actions.ToolOutputAction
-
tag
= 'metadata'¶
-
-
class
galaxy.tool_util.parser.output_actions.
FormatToolOutputAction
(parent, elem)[source]¶ Bases:
galaxy.tool_util.parser.output_actions.ToolOutputAction
-
tag
= 'format'¶
-
-
class
galaxy.tool_util.parser.output_actions.
ToolOutputActionOptionFilter
(parent, elem)[source]¶ Bases:
object
-
tag
= 'filter'¶
-
property
tool
¶
-
-
class
galaxy.tool_util.parser.output_actions.
ParamValueToolOutputActionOptionFilter
(parent, elem)[source]¶ Bases:
galaxy.tool_util.parser.output_actions.ToolOutputActionOptionFilter
-
tag
= 'param_value'¶
-
-
class
galaxy.tool_util.parser.output_actions.
InsertColumnToolOutputActionOptionFilter
(parent, elem)[source]¶ Bases:
galaxy.tool_util.parser.output_actions.ToolOutputActionOptionFilter
-
tag
= 'insert_column'¶
-
-
class
galaxy.tool_util.parser.output_actions.
MultipleSplitterFilter
(parent, elem)[source]¶ Bases:
galaxy.tool_util.parser.output_actions.ToolOutputActionOptionFilter
-
tag
= 'multiple_splitter'¶
-
-
class
galaxy.tool_util.parser.output_actions.
ColumnStripFilter
(parent, elem)[source]¶ Bases:
galaxy.tool_util.parser.output_actions.ToolOutputActionOptionFilter
-
tag
= 'column_strip'¶
-
-
class
galaxy.tool_util.parser.output_actions.
ColumnReplaceFilter
(parent, elem)[source]¶ Bases:
galaxy.tool_util.parser.output_actions.ToolOutputActionOptionFilter
-
tag
= 'column_replace'¶
-
-
class
galaxy.tool_util.parser.output_actions.
MetadataValueFilter
(parent, elem)[source]¶ Bases:
galaxy.tool_util.parser.output_actions.ToolOutputActionOptionFilter
-
tag
= 'metadata_value'¶
-
-
class
galaxy.tool_util.parser.output_actions.
BooleanFilter
(parent, elem)[source]¶ Bases:
galaxy.tool_util.parser.output_actions.ToolOutputActionOptionFilter
-
tag
= 'boolean'¶
-
-
galaxy.tool_util.parser.output_actions.
action_type
¶ alias of
galaxy.tool_util.parser.output_actions.FormatToolOutputAction
-
galaxy.tool_util.parser.output_actions.
filter_type
¶ alias of
galaxy.tool_util.parser.output_actions.ColumnReplaceFilter
-
galaxy.tool_util.parser.output_actions.
option_type
¶ alias of
galaxy.tool_util.parser.output_actions.FromDataTableOutputActionOption
-
class
galaxy.tool_util.parser.output_actions.
StringFunctionFilter
(parent, elem)[source]¶ Bases:
galaxy.tool_util.parser.output_actions.ToolOutputActionOptionFilter
-
tag
= 'string_function'¶
-
galaxy.tool_util.parser.output_collection_def module¶
This module define an abstract class for reasoning about Galaxy’s dataset collection after jobs are finished.
-
galaxy.tool_util.parser.output_collection_def.
dataset_collector_descriptions_from_elem
(elem, legacy=True)[source]¶
-
galaxy.tool_util.parser.output_collection_def.
dataset_collector_descriptions_from_output_dict
(as_dict)[source]¶
-
galaxy.tool_util.parser.output_collection_def.
dataset_collector_descriptions_from_list
(discover_datasets_dicts)[source]¶
-
class
galaxy.tool_util.parser.output_collection_def.
DatasetCollectionDescription
(**kwargs)[source]¶ Bases:
object
-
property
discover_patterns
¶
-
property
-
class
galaxy.tool_util.parser.output_collection_def.
ToolProvidedMetadataDatasetCollection
(**kwargs)[source]¶ Bases:
galaxy.tool_util.parser.output_collection_def.DatasetCollectionDescription
-
discover_via
= 'tool_provided_metadata'¶
-
-
class
galaxy.tool_util.parser.output_collection_def.
FilePatternDatasetCollectionDescription
(**kwargs)[source]¶ Bases:
galaxy.tool_util.parser.output_collection_def.DatasetCollectionDescription
-
discover_via
= 'pattern'¶
-
property
discover_patterns
¶
-
galaxy.tool_util.parser.output_objects module¶
-
class
galaxy.tool_util.parser.output_objects.
ToolOutputBase
(name, label=None, filters=None, hidden=False, from_expression=None)[source]¶ Bases:
galaxy.util.dictifiable.Dictifiable
-
__init__
(name, label=None, filters=None, hidden=False, from_expression=None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
property
output_discover_patterns
¶
-
-
class
galaxy.tool_util.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, from_expression=None)[source]¶ Bases:
galaxy.tool_util.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', 'output_type', 'format_source', 'default_identifier_source', 'metadata_source', 'parent', 'count', 'from_work_dir']¶
-
__init__
(name, format=None, format_source=None, metadata_source=None, parent=None, label=None, filters=None, actions=None, hidden=False, implicit=False, from_expression=None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
property
output_discover_patterns
¶
-
-
class
galaxy.tool_util.parser.output_objects.
ToolExpressionOutput
(name, output_type, from_expression, label=None, filters=None, actions=None, hidden=False)[source]¶ Bases:
galaxy.tool_util.parser.output_objects.ToolOutputBase
-
dict_collection_visible_keys
= ('name', 'format', 'label', 'hidden', 'output_type')¶
-
-
class
galaxy.tool_util.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.tool_util.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>
-
dict_collection_visible_keys
= ['name', 'format', 'label', 'hidden', 'output_type', 'default_format', 'default_format_source', 'default_metadata_source', 'inherit_format', 'inherit_metadata']¶
-
__init__
(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]¶ Initialize self. See help(type(self)) for accurate signature.
-
property
dynamic_structure
¶
-
property
dataset_collector_descriptions
¶
-
property
output_discover_patterns
¶
-
-
class
galaxy.tool_util.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
-
__init__
(collection_type, collection_type_source=None, collection_type_from_rules=None, structured_like=None, dataset_collector_descriptions=None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
property
output_discover_patterns
¶
-
-
class
galaxy.tool_util.parser.output_objects.
ToolOutputCollectionPart
(output_collection_def, element_identifier, output_def, parent_ids=None)[source]¶ Bases:
object
-
__init__
(output_collection_def, element_identifier, output_def, parent_ids=None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
property
effective_output_name
¶
-
galaxy.tool_util.parser.stdio module¶
-
class
galaxy.tool_util.parser.stdio.
StdioErrorLevel
[source]¶ Bases:
object
These determine stdio-based error levels from matching on regular expressions and exit codes. They are meant to be used comparatively, such as showing that warning < fatal. This is really meant to just be an enum.
-
NO_ERROR
= 0¶
-
LOG
= 1¶
-
QC
= 1.1¶
-
WARNING
= 2¶
-
FATAL
= 3¶
-
FATAL_OOM
= 4¶
-
MAX
= 4¶
-
descs
= {0: 'No error', 1: 'Log', 1.1: 'QC', 2: 'Warning', 3: 'Fatal error', 4: 'Out of memory error'}¶
-
-
class
galaxy.tool_util.parser.stdio.
ToolStdioExitCode
(as_dict=None)[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.tool_util.parser.stdio.
ToolStdioRegex
(as_dict=None)[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.tool_util.parser.xml module¶
-
class
galaxy.tool_util.parser.xml.
XmlToolSource
(xml_tree, source_path=None, macro_paths=None)[source]¶ Bases:
galaxy.tool_util.parser.interface.ToolSource
Responsible for parsing a tool from classic Galaxy representation.
-
__init__
(xml_tree, source_path=None, macro_paths=None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
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_tool_module
()[source]¶ Load Tool class from a custom module. (Optional).
If not None, return pair containing module and class (as strings).
-
parse_action_module
()[source]¶ Load Tool class from a custom module. (Optional).
If not None, return pair containing module and class (as strings).
-
parse_is_multi_byte
()[source]¶ Parse is_multi_byte from tool - TODO: figure out what this is and document.
-
parse_display_interface
(default)[source]¶ Parse display_interface - fallback to default for the tool type (supplied as default parameter) if not specified.
-
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_tmp_target
()[source]¶ Should be “pwd”, “shared_home”, “job_tmp”, “job_tmp_if_explicit”, or None.
-
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_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.
-
parse_parallelism
()[source]¶ Return a galaxy.jobs.ParallismInfo object describing task splitting or None.
Return boolean indicating whether tool should be hidden in the tool menu.
-
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_required_files
() → Optional[galaxy.tool_util.parser.interface.RequiredFiles][source]¶ Parse explicit RequiredFiles object or return None to let Galaxy decide implicit logic.
-
parse_requirements_and_containers
()[source]¶ Return pair of ToolRequirement and ContainerDescription lists.
-
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_provided_metadata_file
()[source]¶ Return location of provided metadata file (e.g. galaxy.json).
-
parse_outputs
(tool)[source]¶ Return a pair of output and output collections ordered dictionaries for use by Tool.
-
parse_stdio
()[source]¶ parse error handling from command and stdio tag
returns list of exit codes, list of regexes
exit_codes contain all non-zero exit codes (:-1 and 1:) if detect_errors is default (if not legacy), exit_code, or aggressive
the oom_exit_code if given and detect_errors is exit_code
exit codes and regexes from the stdio tag these are prepended to the list, i.e. are evaluated prior to regexes and exit codes derived from the properties of the command tag. thus more specific regexes of the same or more severe error level are triggered first.
-
parse_help
()[source]¶ Return RST definition of help text for tool or None if the tool doesn’t define help text.
-
property
macro_paths
¶
-
property
source_path
¶
-
-
class
galaxy.tool_util.parser.xml.
StdioParser
(root)[source]¶ Bases:
object
-
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.
-
-
class
galaxy.tool_util.parser.xml.
XmlPagesSource
(root)[source]¶ Bases:
galaxy.tool_util.parser.interface.PagesSource
-
property
inputs_defined
¶
-
property
-
class
galaxy.tool_util.parser.xml.
XmlInputSource
(input_elem)[source]¶ Bases:
galaxy.tool_util.parser.interface.InputSource
-
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_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_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_dynamic_options_elem
()[source]¶ Return a galaxy.tools.parameters.dynamic_options.DynamicOptions if appropriate.
-
parse_static_options
()[source]¶ Return list of static options if this is a select type without defining a dynamic options.
-
galaxy.tool_util.parser.yaml module¶
-
class
galaxy.tool_util.parser.yaml.
YamlToolSource
(root_dict, source_path=None)[source]¶ Bases:
galaxy.tool_util.parser.interface.ToolSource
-
__init__
(root_dict, source_path=None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
property
source_path
¶
-
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_is_multi_byte
()[source]¶ Parse is_multi_byte from tool - TODO: figure out what this is and document.
-
parse_display_interface
(default)[source]¶ Parse display_interface - fallback to default for the tool type (supplied as default parameter) if not specified.
-
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_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.
-
parse_requirements_and_containers
()[source]¶ Return pair of ToolRequirement and ContainerDescription lists.
-
parse_stdio
()[source]¶ Builds lists of ToolStdioExitCode and ToolStdioRegex objects to describe tool execution error conditions.
-
parse_help
()[source]¶ Return RST definition of help text for tool or None if the tool doesn’t define help text.
-
-
class
galaxy.tool_util.parser.yaml.
YamlInputSource
(input_dict)[source]¶ Bases:
galaxy.tool_util.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.
-