Warning

This document is for an in-development version 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.tools.actions package

class galaxy.tools.actions.ToolAction[source]

Bases: object

The actions to be taken when a tool is run (after parameters have been converted and validated).

abstract execute(tool, trans, incoming: Dict[str, Any] | None = None, history: History | None = None, job_params=None, rerun_remap_job_id: int | None = None, execution_cache: ToolExecutionCache | None = None, dataset_collection_elements: Dict[str, DatasetCollectionElement] | None = None, completed_job: Job | None = None, collection_info: MatchingCollections | None = None, job_callback: Callable | None = None, preferred_object_store_id: str | None = None, set_output_hid: bool = True, flush_job: bool = True, skip: bool = False) Tuple[Job, Dict[str, DatasetInstance], History | None] | Tuple[Job, Dict[str, DatasetInstance]][source]

Perform target tool action.

abstract get_output_name(output, dataset=None, tool=None, on_text=None, trans=None, incoming=None, history=None, params=None, job_params=None) str[source]

Get name to assign a tool output.

class galaxy.tools.actions.DefaultToolAction[source]

Bases: ToolAction

Default tool action is to run an external command

produces_real_jobs: bool = True
collect_input_dataset_collections(tool, param_values)[source]
execute(tool, trans, incoming: Dict[str, Any] | None = None, history: History | None = None, job_params=None, rerun_remap_job_id: int | None = None, execution_cache: ToolExecutionCache | None = None, dataset_collection_elements=None, completed_job: Job | None = None, collection_info: MatchingCollections | None = None, job_callback: Callable | None = None, preferred_object_store_id: str | None = None, set_output_hid: bool = True, flush_job: bool = True, skip: bool = False) Tuple[Job, Dict[str, DatasetInstance], History | None] | Tuple[Job, Dict[str, DatasetInstance]][source]

Executes a tool, creating job and tool outputs, associating them, and submitting the job to the job queue. If history is not specified, use trans.history as destination for tool’s output datasets.

get_output_name(output, dataset=None, tool=None, on_text=None, trans=None, incoming=None, history=None, params=None, job_params=None) str[source]

Get name to assign a tool output.

class galaxy.tools.actions.OutputCollections(trans, history, tool, tool_action, input_collections, dataset_collection_elements, on_text, incoming, params, job_params, tags, hdca_tags)[source]

Bases: object

Keeps track of collections (DC or HDCA) created by actions.

Actions do fairly different things depending on whether we are creating just part of an collection or a whole output collection (mapping_over_collection parameter).

__init__(trans, history, tool, tool_action, input_collections, dataset_collection_elements, on_text, incoming, params, job_params, tags, hdca_tags)[source]
create_collection(output, name, collection_type=None, completed_job=None, propagate_hda_tags=True, **element_kwds)[source]
galaxy.tools.actions.get_ext_or_implicit_ext(hda)[source]
galaxy.tools.actions.determine_output_format(output: ToolOutput, parameter_context, input_datasets, input_dataset_collections, random_input_ext, python_template_version='3', execution_cache=None)[source]

Determines the output format for a dataset based on an abstract description of the output (galaxy.tool_util.parser.ToolOutput), the parameter wrappers, a map of the input datasets (name => HDA), and the last input extensions in the tool form.

TODO: Make the input extension used deterministic instead of random.

Submodules

galaxy.tools.actions.data_manager module

class galaxy.tools.actions.data_manager.DataManagerToolAction[source]

Bases: DefaultToolAction

Tool action used for Data Manager Tools

execute(tool, trans, incoming: Dict[str, Any] | None = None, history: History | None = None, job_params=None, rerun_remap_job_id: int | None = None, execution_cache: ToolExecutionCache | None = None, dataset_collection_elements: Dict[str, DatasetCollectionElement] | None = None, completed_job: Job | None = None, collection_info: MatchingCollections | None = None, job_callback: Callable | None = None, preferred_object_store_id: str | None = None, set_output_hid: bool = True, flush_job: bool = True, skip: bool = False) Tuple[Job, Dict[str, DatasetInstance], History | None] | Tuple[Job, Dict[str, DatasetInstance]][source]

Executes a tool, creating job and tool outputs, associating them, and submitting the job to the job queue. If history is not specified, use trans.history as destination for tool’s output datasets.

galaxy.tools.actions.data_source module

class galaxy.tools.actions.data_source.DataSourceToolAction[source]

Bases: DefaultToolAction

Tool action used for Data Source Tools

galaxy.tools.actions.history_imp_exp module

class galaxy.tools.actions.history_imp_exp.ImportHistoryToolAction[source]

Bases: ToolAction

Tool action used for importing a history to an archive.

produces_real_jobs: bool = True
execute(tool, trans, incoming: Dict[str, Any] | None = None, history: History | None = None, job_params=None, rerun_remap_job_id: int | None = None, execution_cache: ToolExecutionCache | None = None, dataset_collection_elements: Dict[str, DatasetCollectionElement] | None = None, completed_job: Job | None = None, collection_info: MatchingCollections | None = None, job_callback: Callable | None = None, preferred_object_store_id: str | None = None, set_output_hid: bool = True, flush_job: bool = True, skip: bool = False) Tuple[Job, Dict[str, DatasetInstance], History | None] | Tuple[Job, Dict[str, DatasetInstance]][source]

Perform target tool action.

class galaxy.tools.actions.history_imp_exp.ExportHistoryToolAction[source]

Bases: ToolAction

Tool action used for exporting a history to an archive.

produces_real_jobs: bool = True
execute(tool, trans, incoming: Dict[str, Any] | None = None, history: History | None = None, job_params=None, rerun_remap_job_id: int | None = None, execution_cache: ToolExecutionCache | None = None, dataset_collection_elements: Dict[str, DatasetCollectionElement] | None = None, completed_job: Job | None = None, collection_info: MatchingCollections | None = None, job_callback: Callable | None = None, preferred_object_store_id: str | None = None, set_output_hid: bool = True, flush_job: bool = True, skip: bool = False) Tuple[Job, Dict[str, DatasetInstance], History | None] | Tuple[Job, Dict[str, DatasetInstance]][source]

Perform target tool action.

galaxy.tools.actions.metadata module

class galaxy.tools.actions.metadata.SetMetadataToolAction[source]

Bases: ToolAction

Tool action used for setting external metadata on an existing dataset

produces_real_jobs: bool = False
set_output_hid: bool = False
execute(tool, trans, incoming: Dict[str, Any] | None = None, history: History | None = None, job_params=None, rerun_remap_job_id: int | None = None, execution_cache: ToolExecutionCache | None = None, dataset_collection_elements: Dict[str, DatasetCollectionElement] | None = None, completed_job: Job | None = None, collection_info: MatchingCollections | None = None, job_callback: Callable | None = None, preferred_object_store_id: str | None = None, set_output_hid: bool = True, flush_job: bool = True, skip: bool = False)[source]

Execute using a web transaction.

execute_via_trans(tool, trans, incoming: Dict[str, Any] | None, overwrite: bool = True, history: History | None = None, job_params: Dict[str, Any] | None = None)[source]
execute_via_app(tool, app, session_id: int | None, history_id: int | None, user: User | None = None, incoming: Dict[str, Any] | None = None, overwrite: bool = True, history: History | None = None, job_params: Dict[str, Any] | None = None)[source]

Execute using application.

galaxy.tools.actions.model_operations module

class galaxy.tools.actions.model_operations.ModelOperationToolAction[source]

Bases: DefaultToolAction

produces_real_jobs: bool = False
check_inputs_ready(tool, trans, incoming, history, execution_cache=None, collection_info=None)[source]
execute(tool, trans, incoming: Dict[str, Any] | None = None, history: History | None = None, job_params=None, rerun_remap_job_id: int | None = None, execution_cache: ToolExecutionCache | None = None, dataset_collection_elements: Dict[str, DatasetCollectionElement] | None = None, completed_job: Job | None = None, collection_info: MatchingCollections | None = None, job_callback: Callable | None = None, preferred_object_store_id: str | None = None, set_output_hid: bool = True, flush_job: bool = True, skip: bool = False) Tuple[Job, Dict[str, DatasetInstance], History | None] | Tuple[Job, Dict[str, DatasetInstance]][source]

Executes a tool, creating job and tool outputs, associating them, and submitting the job to the job queue. If history is not specified, use trans.history as destination for tool’s output datasets.

galaxy.tools.actions.upload module

class galaxy.tools.actions.upload.BaseUploadToolAction[source]

Bases: ToolAction

produces_real_jobs = True
execute(tool, trans, incoming: Dict[str, Any] | None = None, history: History | None = None, job_params=None, rerun_remap_job_id: int | None = None, execution_cache: ToolExecutionCache | None = None, dataset_collection_elements: Dict[str, DatasetCollectionElement] | None = None, completed_job: Job | None = None, collection_info: MatchingCollections | None = None, job_callback: Callable | None = None, preferred_object_store_id: str | None = None, set_output_hid: bool = True, flush_job: bool = True, skip: bool = False) Tuple[Job, Dict[str, DatasetInstance], History | None] | Tuple[Job, Dict[str, DatasetInstance]][source]

Perform target tool action.

class galaxy.tools.actions.upload.UploadToolAction[source]

Bases: BaseUploadToolAction

class galaxy.tools.actions.upload.FetchUploadToolAction[source]

Bases: BaseUploadToolAction

galaxy.tools.actions.upload_common module

galaxy.tools.actions.upload_common.validate_datatype_extension(datatypes_registry, ext)[source]
galaxy.tools.actions.upload_common.persist_uploads(params, trans)[source]

Turn any uploads in the submitted form to persisted files.

class galaxy.tools.actions.upload_common.LibraryParams(roles: List[galaxy.model.Role], tags: List[str] | NoneType, template: galaxy.model.FormDefinition | NoneType, template_field_contents: Dict[str, str], folder: galaxy.model.LibraryFolder, message: str, replace_dataset: galaxy.model.LibraryDataset | NoneType)[source]

Bases: object

roles: List[Role]
tags: List[str] | None
template: FormDefinition | None
template_field_contents: Dict[str, str]
folder: LibraryFolder
message: str
replace_dataset: LibraryDataset | None
__init__(roles: List[Role], tags: List[str] | None, template: FormDefinition | None, template_field_contents: Dict[str, str], folder: LibraryFolder, message: str, replace_dataset: LibraryDataset | None) None
galaxy.tools.actions.upload_common.handle_library_params(trans, params, folder_id: int, replace_dataset: LibraryDataset | None = None) LibraryParams[source]
galaxy.tools.actions.upload_common.new_upload(trans: ProvidesUserContext, cntrller, uploaded_dataset, library_bunch=None, history=None, state=None, tag_list=None)[source]
galaxy.tools.actions.upload_common.get_uploaded_datasets(trans, cntrller, params, dataset_upload_inputs, library_bunch=None, history=None)[source]
galaxy.tools.actions.upload_common.create_paramfile(trans, uploaded_datasets)[source]

Create the upload tool’s JSON “param” file.

galaxy.tools.actions.upload_common.create_job(trans, params, tool, json_file_path, outputs, folder=None, history=None, job_params=None)[source]

Create the upload job.

galaxy.tools.actions.upload_common.active_folders(trans, folder)[source]