Tools and Workflows

Manage creation of tools and workflows for workflow tracking.

Command-line tool

Represent a CommandLineToolFactory for tracking workflows.

class renku.core.models.cwl.command_line_tool.CommandLineToolFactory(command_line, explicit_inputs=[], explicit_outputs=[], directory='.', working_dir='.', stdin=None, stderr=None, stdout=None, successCodes=NOTHING, annotations=None, messages=None, warnings=None)[source]

Command Line Tool Factory.

add_indirect_inputs()[source]

Read indirect inputs list and add them to explicit inputs.

add_indirect_outputs()[source]

Read indirect outputs list and add them to explicit outputs.

delete_indirect_files_list()[source]

Remove indirect inputs and outputs list.

file_candidate(candidate, ignore=None)[source]

Return a path instance if it exists in current directory.

find_explicit_inputs()[source]

Yield explicit inputs and command line input bindings if any.

find_explicit_outputs(starting_output_id)[source]

Yield explicit output and changed command input parameter.

generate_process_run(client, commit, path)[source]

Return an instance of ProcessRun.

guess_inputs(*arguments)[source]

Yield command input parameters and command line bindings.

guess_outputs(paths)[source]

Yield detected output and changed command input parameter.

guess_type(value, ignore_filenames=None)[source]

Return new value and CWL parameter type.

iter_input_files(basedir)[source]

Yield tuples with input id and path.

read_files_list(files_list)[source]

Read files list where each line is a filepath.

split_command_and_args()[source]

Return tuple with command and args from command line arguments.

validate_command_line(attribute, value)[source]

Check the command line structure.

validate_path(attribute, value)[source]

Path must exists.

watch(client, no_output=False)[source]

Watch a Renku repository for changes to detect outputs.

Annotation

Represent an annotation for a workflow.

class renku.core.models.cwl.annotation.Annotation(*, id, body=None, source=None)[source]

Represents a custom annotation for a research object.

Type:

"oa:Annotation"

Context:

{
  "oa": "http://www.w3.org/ns/oa#",
  "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
  "dcterms": "http://purl.org/dc/terms/",
  "@version": 1.1,
  "_id": "@id",
  "body": "oa:hasBody",
  "source": "dcterms:creator"
}

Parameter

Represent parameters from the Common Workflow Language.

class renku.core.models.cwl.parameter.CommandInputParameter(id=None, streamable=None, type='string', description=None, default=None, inputBinding=None)[source]

An input parameter for a CommandLineTool.

classmethod from_cwl(data)[source]

Create instance from type definition.

to_argv(**kwargs)[source]

Format command input parameter as shell argument.

class renku.core.models.cwl.parameter.CommandLineBinding(position=None, prefix=None, separate: bool = True, itemSeparator=None, valueFrom=None, shellQuote: bool = True)[source]

Define the binding behavior when building the command line.

to_argv(default=None)[source]

Format command line binding as shell argument.

class renku.core.models.cwl.parameter.CommandOutputBinding(glob=None)[source]

Define the binding behavior for outputs.

class renku.core.models.cwl.parameter.CommandOutputParameter(id=None, streamable=None, type='string', description=None, format=None, outputBinding=None)[source]

Define an output parameter for a CommandLineTool.

class renku.core.models.cwl.parameter.InputParameter(id=None, streamable=None, type='string', description=None, default=None, inputBinding=None)[source]

An input parameter.

class renku.core.models.cwl.parameter.OutputParameter(id=None, streamable=None, type='string', description=None, format=None, outputBinding=None)[source]

An output parameter.

class renku.core.models.cwl.parameter.Parameter(streamable=None)[source]

Define an input or output parameter to a process.

class renku.core.models.cwl.parameter.WorkflowOutputParameter(id=None, streamable=None, type='string', description=None, format=None, outputBinding=None, outputSource=None)[source]

Define an output parameter for a Workflow.

renku.core.models.cwl.parameter.convert_default(value)[source]

Convert a default value.

Types

Represent the Common Workflow Language types.

class renku.core.models.cwl.types.Directory(path=None, listing=NOTHING)[source]

Represent a directory.

class renku.core.models.cwl.types.Dirent(entryname=None, entry=None, writable=False)[source]

Define a file or subdirectory.

class renku.core.models.cwl.types.File(path)[source]

Represent a file.

class renku.core.models.cwl.types.PathFormatterMixin[source]

Format path property.

Workflow

Represent workflows from the Common Workflow Language.

class renku.core.models.cwl.workflow.Workflow(steps=NOTHING)[source]

Define a workflow representation.

add_step(**kwargs)[source]

Add a workflow step.

class renku.core.models.cwl.workflow.WorkflowStep(run, id=NOTHING, in_=None, out=None)[source]

Define an executable element of a workflow.

renku.core.models.cwl.workflow.convert_run(value)[source]

Convert value to CWLClass if dict is given.