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.tools.actions package

class galaxy.tools.actions.ToolExecutionCache(trans)[source]

Bases: object

An object mean to cache calculation caused by repeatedly evaluting the same tool by the same user with slightly different parameters.

__init__(trans)[source]
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).

execute(tool, trans, incoming={}, set_output_hid=True)[source]
class galaxy.tools.actions.DefaultToolAction[source]

Bases: object

Default tool action is to run an external command

collect_input_dataset_collections(tool, param_values)[source]
execute(tool, trans, incoming={}, return_job=False, set_output_hid=True, history=None, job_params=None, rerun_remap_job_id=None, mapping_over_collection=False, execution_cache=None)[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, tool, on_text, trans, incoming, history, params, job_params)[source]
set_metadata_defaults(output, dataset, tool, on_text, trans, incoming, history, params, job_params)[source]

This allows to map names of input files to metadata default values. Example:

<data format=”tabular” name=”output” label=”Tabular output, aggregates data from individual_inputs” >
<actions>
<action name=”column_names” type=”metadata” default=”${‘,’.join([input.name for input in $individual_inputs ])}” />

</actions>

</data>

class galaxy.tools.actions.ObjectStorePopulator(app)[source]

Bases: object

Small helper for interacting with the object store and making sure all datasets from a job end up with the same object_store_id.

__init__(app)[source]
set_object_store_id(data)[source]
class galaxy.tools.actions.OutputCollections(trans, history, tool, tool_action, input_collections, mapping_over_collection, on_text, incoming, params, job_params)[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, mapping_over_collection, on_text, incoming, params, job_params)[source]
create_collection(output, name, tags=None, **element_kwds)[source]
galaxy.tools.actions.on_text_for_names(input_names)[source]
galaxy.tools.actions.filter_output(output, incoming)[source]
galaxy.tools.actions.determine_output_format(output, parameter_context, input_datasets, input_dataset_collections, random_input_ext)[source]

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

TODO: Don’t deal with XML here - move this logic into ToolOutput. 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: galaxy.tools.actions.DefaultToolAction

Tool action used for Data Manager Tools

execute(tool, trans, **kwds)[source]

galaxy.tools.actions.data_source module

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

Bases: galaxy.tools.actions.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: galaxy.tools.actions.ToolAction

Tool action used for importing a history to an archive.

execute(tool, trans, incoming={}, set_output_hid=False, overwrite=True, history=None, **kwargs)[source]
class galaxy.tools.actions.history_imp_exp.ExportHistoryToolAction[source]

Bases: galaxy.tools.actions.ToolAction

Tool action used for exporting a history to an archive.

execute(tool, trans, incoming={}, set_output_hid=False, overwrite=True, history=None, **kwargs)[source]

galaxy.tools.actions.metadata module

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

Bases: galaxy.tools.actions.ToolAction

Tool action used for setting external metadata on an existing dataset

execute(tool, trans, incoming={}, set_output_hid=False, overwrite=True, history=None, job_params=None, **kwargs)[source]

Execute using a web transaction.

execute_via_app(tool, app, session_id, history_id, user=None, incoming={}, set_output_hid=False, overwrite=True, history=None, job_params=None)[source]

Execute using application.

galaxy.tools.actions.upload module

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

Bases: galaxy.tools.actions.ToolAction

execute(tool, trans, incoming={}, set_output_hid=True, history=None, **kwargs)[source]

galaxy.tools.actions.upload_common module

galaxy.tools.actions.upload_common.persist_uploads(params)[source]

Turn any uploads in the submitted form to persisted files.

galaxy.tools.actions.upload_common.handle_library_params(trans, params, folder_id, replace_dataset=None)[source]
galaxy.tools.actions.upload_common.get_precreated_datasets(trans, params, data_obj, controller='root')[source]

Get any precreated datasets (when using asynchronous uploads).

galaxy.tools.actions.upload_common.get_precreated_dataset(precreated_datasets, name)[source]

Return a dataset matching a name from the list of precreated (via async upload) datasets. If there’s more than one upload with the exact same name, we need to pop one (the first) so it isn’t chosen next time.

galaxy.tools.actions.upload_common.cleanup_unused_precreated_datasets(precreated_datasets)[source]
galaxy.tools.actions.upload_common.new_upload(trans, cntrller, uploaded_dataset, library_bunch=None, history=None, state=None)[source]
galaxy.tools.actions.upload_common.get_uploaded_datasets(trans, cntrller, params, precreated_datasets, 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, data_list, folder=None, history=None, job_params=None)[source]

Create the upload job.

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