galaxy.tools.cwl package

Submodules

galaxy.tools.cwl.cwltool_deps module

Logic for dealing with cwltool as an optional dependency.

Use this as the import interface for cwltool and just call ensure_cwltool_available() before using any of the imported functionality at runtime.

galaxy.tools.cwl.cwltool_deps.ensure_cwltool_available()[source]

Assert optional dependencies proxied via this module are available at runtime.

Throw an ImportError with a description of the problem if they do not exist.

galaxy.tools.cwl.cwltool_deps.needs_shell_quoting()

search(string[, pos[, endpos]]) –> match object or None. Scan through string looking for a match, and return a corresponding match object instance. Return None if no position in the string matches.

galaxy.tools.cwl.parser module

This module provides proxy objects around objects from the common workflow language reference implementation library cwltool. These proxies adapt cwltool to Galaxy features and abstract the library away from the rest of the framework.

galaxy.tools.cwl.parser.tool_proxy(tool_path=None, tool_object=None, strict_cwl_validation=True)[source]

Provide a proxy object to cwltool data structures to just grab relevant data.

galaxy.tools.cwl.parser.load_job_proxy(job_directory, strict_cwl_validation=True)[source]

galaxy.tools.cwl.representation module

This module is responsible for converting between Galaxy’s tool input description and the CWL description for a job json.

class galaxy.tools.cwl.representation.TypeRepresentation(name, galaxy_param_type, label, collection_type)

Bases: tuple

collection_type

Alias for field number 3

galaxy_param_type

Alias for field number 1

label

Alias for field number 2

name

Alias for field number 0

uses_param()
galaxy.tools.cwl.representation.collection_wrapper_to_array(inputs_dir, wrapped_value)[source]
galaxy.tools.cwl.representation.collection_wrapper_to_record(inputs_dir, wrapped_value)[source]
galaxy.tools.cwl.representation.dataset_wrapper_to_directory_json(inputs_dir, dataset_wrapper)[source]
galaxy.tools.cwl.representation.dataset_wrapper_to_file_json(inputs_dir, dataset_wrapper)[source]
galaxy.tools.cwl.representation.field_to_field_type(field)[source]
galaxy.tools.cwl.representation.to_cwl_job(tool, param_dict, local_working_directory)[source]

tool is Galaxy’s representation of the tool and param_dict is the parameter dictionary with wrapped values.

galaxy.tools.cwl.representation.to_galaxy_parameters(tool, as_dict)[source]

Tool is Galaxy’s representation of the tool and as_dict is a Galaxified representation of the input json (no paths, HDA references for instance).

galaxy.tools.cwl.representation.type_descriptions_for_field_types(field_types)[source]
galaxy.tools.cwl.representation.type_representation_from_name(type_representation_name)[source]

galaxy.tools.cwl.runtime_actions module

galaxy.tools.cwl.runtime_actions.handle_outputs(job_directory=None)[source]

galaxy.tools.cwl.schema module

Abstraction around cwltool and related libraries for loading a CWL artifact.

class galaxy.tools.cwl.schema.ProcessDefinition(process_object, metadata, document_loader, avsc_names, raw_process_reference)

Bases: tuple

avsc_names

Alias for field number 3

document_loader

Alias for field number 2

metadata

Alias for field number 1

process_object

Alias for field number 0

raw_process_reference

Alias for field number 4

class galaxy.tools.cwl.schema.RawProcessReference(process_object, uri)

Bases: tuple

process_object

Alias for field number 0

uri

Alias for field number 1

class galaxy.tools.cwl.schema.SchemaLoader(strict=True)[source]

Bases: object

process_definition(raw_reference)[source]
raw_document_loader
raw_process_reference(path)[source]
raw_process_reference_for_object(object, uri=None)[source]
tool(**kwds)[source]

galaxy.tools.cwl.util module

Client-centric CWL-related utilities.

Used to share code between the Galaxy test framework and other Galaxy CWL clients (e.g. Planemo).

class galaxy.tools.cwl.util.DirectoryUploadTarget(tar_path)[source]

Bases: object

class galaxy.tools.cwl.util.FileUploadTarget(path, secondary_files=None, **kwargs)[source]

Bases: object

class galaxy.tools.cwl.util.GalaxyOutput(history_id, history_content_type, history_content_id)

Bases: tuple

history_content_id

Alias for field number 2

history_content_type

Alias for field number 1

history_id

Alias for field number 0

class galaxy.tools.cwl.util.ObjectUploadTarget(the_object)[source]

Bases: object

galaxy.tools.cwl.util.abs_path_or_uri(path_or_uri, relative_to)[source]

Return an absolute path if this isn’t a URI, otherwise keep the URI the same.

galaxy.tools.cwl.util.galactic_job_json(job, test_data_directory, upload_func, collection_create_func, tool_or_workflow='workflow')[source]

Adapt a CWL job object to the Galaxy API.

CWL derived tools in Galaxy can consume a job description sort of like CWL job objects via the API but paths need to be replaced with datasets and records and arrays with collection references. This function will stage files and modify the job description to adapt to these changes for Galaxy.

galaxy.tools.cwl.util.invocation_to_output(invocation, history_id, output_id)[source]
galaxy.tools.cwl.util.output_properties(path=None, content=None, basename=None, pseduo_location=False)[source]
galaxy.tools.cwl.util.output_to_cwl_json(galaxy_output, get_metadata, get_dataset, get_extra_files, pseduo_location=False)[source]

Convert objects in a Galaxy history into a CWL object.

Useful in running conformance tests and implementing the cwl-runner interface via Galaxy.

galaxy.tools.cwl.util.path_or_uri_to_uri(path_or_uri)[source]
galaxy.tools.cwl.util.set_basename_and_derived_properties(properties, basename)[source]
galaxy.tools.cwl.util.tool_response_to_output(tool_response, history_id, output_id)[source]

Module contents

galaxy.tools.cwl.tool_proxy(tool_path=None, tool_object=None, strict_cwl_validation=True)[source]

Provide a proxy object to cwltool data structures to just grab relevant data.

galaxy.tools.cwl.tool_proxy_from_persistent_representation(persisted_tool, strict_cwl_validation=True)[source]
galaxy.tools.cwl.workflow_proxy(workflow_path, strict_cwl_validation=True)[source]
galaxy.tools.cwl.handle_outputs(job_directory=None)[source]
galaxy.tools.cwl.to_cwl_job(tool, param_dict, local_working_directory)[source]

tool is Galaxy’s representation of the tool and param_dict is the parameter dictionary with wrapped values.

galaxy.tools.cwl.to_galaxy_parameters(tool, as_dict)[source]

Tool is Galaxy’s representation of the tool and as_dict is a Galaxified representation of the input json (no paths, HDA references for instance).

galaxy.tools.cwl.needs_shell_quoting()

search(string[, pos[, endpos]]) –> match object or None. Scan through string looking for a match, and return a corresponding match object instance. Return None if no position in the string matches.