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.workflow package¶
Submodules¶
galaxy.workflow.extract module¶
This module contains functionality to aid in extracting workflows from histories.
galaxy.workflow.modules module¶
Modules used in building workflows
-
class
galaxy.workflow.modules.
WorkflowModule
(trans, content_id=None, **kwds)[source]¶ Bases:
object
-
get_content_id
()[source]¶ If this component has an identifier external to the step (such as a tool or another workflow) return the identifier for that content.
-
get_state
(nested=True)[source]¶ Return a serializable representation of the persistable state of the step.
-
recover_state
(state, **kwds)[source]¶ Recover state dict from simple dictionary describing configuration state (potentially from persisted step state).
Sub-classes should supply a default_state method which contains the initial state dict with key, value pairs for all available attributes.
-
check_and_update_state
()[source]¶ If the state is not in sync with the current implementation of the module, try to update. Returns a list of messages to be displayed
-
add_dummy_datasets
(connections=None, steps=None)[source]¶ Replace connected inputs with placeholder/dummy values.
-
get_runtime_inputs
(**kwds)[source]¶ Used internally by modules and when displaying inputs in workflow editor and run workflow templates.
-
compute_runtime_state
(trans, step_updates=None)[source]¶ Determine the runtime state (potentially different from self.state which describes configuration state). This (again unlike self.state) is currently always a DefaultToolState object.
If step_updates is None, this is likely for rendering the run form for instance and no runtime properties are available and state must be solely determined by the default runtime state described by the step.
If step_updates are available they describe the runtime properties supplied by the workflow runner.
-
encode_runtime_state
(runtime_state)[source]¶ Takes the computed runtime state and serializes it during run request creation.
-
decode_runtime_state
(runtime_state)[source]¶ Takes the serialized runtime state and decodes it when running the workflow.
-
execute
(trans, progress, invocation_step, use_cached_job=False)[source]¶ Execute the given workflow invocation step.
Use the supplied workflow progress object to track outputs, find inputs, etc….
Return a False if there is additional processing required to on subsequent workflow scheduling runs, None or True means the workflow step executed properly.
-
do_invocation_step_action
(step, action)[source]¶ Update or set the workflow invocation state action - generic extension point meant to allows users to interact with interactive workflow modules. The action object returned from this method will be attached to the WorkflowInvocationStep and be available the next time the workflow scheduler visits the workflow.
-
-
class
galaxy.workflow.modules.
SubWorkflowModule
(trans, content_id=None, **kwds)[source]¶ Bases:
galaxy.workflow.modules.WorkflowModule
-
type
= 'subworkflow'¶
-
name
= 'Subworkflow'¶
-
-
class
galaxy.workflow.modules.
InputDataModule
(trans, content_id=None, **kwds)[source]¶ Bases:
galaxy.workflow.modules.InputModule
-
type
= 'data_input'¶
-
name
= 'Input dataset'¶
-
-
class
galaxy.workflow.modules.
InputDataCollectionModule
(trans, content_id=None, **kwds)[source]¶ Bases:
galaxy.workflow.modules.InputModule
-
type
= 'data_collection_input'¶
-
name
= 'Input dataset collection'¶
-
default_collection_type
= 'list'¶
-
collection_type
= 'list'¶
-
-
class
galaxy.workflow.modules.
InputParameterModule
(trans, content_id=None, **kwds)[source]¶ Bases:
galaxy.workflow.modules.WorkflowModule
-
type
= 'parameter_input'¶
-
name
= 'Input parameter'¶
-
default_parameter_type
= 'text'¶
-
default_optional
= False¶
-
parameter_type
= 'text'¶
-
optional
= False¶
-
-
class
galaxy.workflow.modules.
PauseModule
(trans, content_id=None, **kwds)[source]¶ Bases:
galaxy.workflow.modules.WorkflowModule
Initially this module will unconditionally pause a workflow - will aim to allow conditional pausing later on.
-
type
= 'pause'¶
-
name
= 'Pause for dataset review'¶
-
do_invocation_step_action
(step, action)[source]¶ Update or set the workflow invocation state action - generic extension point meant to allows users to interact with interactive workflow modules. The action object returned from this method will be attached to the WorkflowInvocationStep and be available the next time the workflow scheduler visits the workflow.
-
-
class
galaxy.workflow.modules.
ToolModule
(trans, tool_id, tool_version=None, exact_tools=True, **kwds)[source]¶ Bases:
galaxy.workflow.modules.WorkflowModule
-
type
= 'tool'¶
-
name
= 'Tool'¶
-
-
galaxy.workflow.modules.
load_module_sections
(trans)[source]¶ Get abstract description of the workflow modules this Galaxy instance is configured with.
-
exception
galaxy.workflow.modules.
DelayedWorkflowEvaluation
(why=None)[source]¶ Bases:
exceptions.Exception
-
exception
galaxy.workflow.modules.
CancelWorkflowEvaluation
[source]¶ Bases:
exceptions.Exception
-
class
galaxy.workflow.modules.
WorkflowModuleInjector
(trans, allow_tool_state_corrections=False)[source]¶ Bases:
object
Injects workflow step objects from the ORM with appropriate module and module generated/influenced state.
-
inject
(step, step_args=None, steps=None, **kwargs)[source]¶ Pre-condition: step is an ORM object coming from the database, if supplied step_args is the representation of the inputs for that step supplied via web form.
Post-condition: The supplied step has new non-persistent attributes useful during workflow invocation. These include ‘upgrade_messages’, ‘state’, ‘input_connections_by_name’, and ‘module’.
If step_args is provided from a web form this is applied to generate ‘state’ else it is just obtained from the database.
-
galaxy.workflow.run module¶
-
galaxy.workflow.run.
invoke
(trans, workflow, workflow_run_config, workflow_invocation=None, populate_state=False)[source]¶
-
class
galaxy.workflow.run.
WorkflowRunConfig
(target_history, replacement_dict, copy_inputs_to_history=False, inputs=None, param_map=None, allow_tool_state_corrections=False, use_cached_job=False, resource_params=None)[source]¶ Bases:
object
Wrapper around all the ways a workflow execution can be parameterized.
Parameters: - target_history (galaxy.model.History.) – History to execute workflow in.
- replacement_dict (dict) – Workflow level parameters used for renaming post job actions.
- copy_inputs_to_history (bool) – Should input data parameters be copied to target_history. (Defaults to False)
- inputs (dict) – Map from step ids to dict’s containing HDA for these steps.
- inputs_by (str) – How inputs maps to inputs (datasets/collections) to workflows steps - by unencoded database id (‘step_id’), index in workflow ‘step_index’ (independent of database), or by input name for that step (‘name’).
- param_map (dict) – Override step parameters - should be dict with step id keys and tool param name-value dicts as values.
galaxy.workflow.run_request module¶
-
class
galaxy.workflow.run_request.
WorkflowRunConfig
(target_history, replacement_dict, copy_inputs_to_history=False, inputs=None, param_map=None, allow_tool_state_corrections=False, use_cached_job=False, resource_params=None)[source]¶ Bases:
object
Wrapper around all the ways a workflow execution can be parameterized.
Parameters: - target_history (galaxy.model.History.) – History to execute workflow in.
- replacement_dict (dict) – Workflow level parameters used for renaming post job actions.
- copy_inputs_to_history (bool) – Should input data parameters be copied to target_history. (Defaults to False)
- inputs (dict) – Map from step ids to dict’s containing HDA for these steps.
- inputs_by (str) – How inputs maps to inputs (datasets/collections) to workflows steps - by unencoded database id (‘step_id’), index in workflow ‘step_index’ (independent of database), or by input name for that step (‘name’).
- param_map (dict) – Override step parameters - should be dict with step id keys and tool param name-value dicts as values.
galaxy.workflow.scheduling_manager module¶
-
class
galaxy.workflow.scheduling_manager.
WorkflowSchedulingManager
(app)[source]¶ Bases:
galaxy.util.handlers.ConfiguresHandlers
A workflow scheduling manager based loosely on pattern established by
galaxy.manager.JobManager
. Only schedules workflows on handler processes.
galaxy.workflow.steps module¶
This module contains utility methods for reasoning about and ordering workflow steps.
-
galaxy.workflow.steps.
attach_ordered_steps
(workflow, steps)[source]¶ Attempt to topologically order steps and attach to workflow. If this fails - the workflow contains cycles so it mark it as such.
-
galaxy.workflow.steps.
order_workflow_steps
(steps)[source]¶ Perform topological sort of the steps, return ordered or None