blue_cwl.core.cwl¶
CWL workflow construction module.
Classes
|
CommandInputArraySchema. |
|
CommandInputParameter shema. |
|
Dataclass for a command line's tool input binding. |
|
Dataclass for a command line tool's output. |
|
CommandOutputbinding schema. |
|
CommandOutputParameter schema. |
|
Dataclass for cwl config. |
|
Dataclass for config's input entries. |
|
InputArraySchema. |
|
Dataclass for an entire workflow. |
|
WorkflowInputParameter schema. |
|
Dataclass for a workflow's output. |
|
Dataclass for a workflow's step. |
|
Dataclass for a workflow'steps input. |
- class blue_cwl.core.cwl.CommandInputArraySchema(*, items: Literal['null', 'boolean', 'int', 'long', 'float', 'double', 'string', 'File', 'Directory', 'stdin', 'stdout', 'stderr', 'Any', 'NexusType'], type: Literal['array'], label: str | None = None, doc: str | None = None, name: str | None = None, inputBinding: CommandLineBinding | None = None)¶
CommandInputArraySchema.
See: https://www.commonwl.org/v1.2/CommandLineTool.html#CommandInputArraySchema
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class blue_cwl.core.cwl.CommandInputParameter(*, id: str, label: str | None = None, doc: str | None = None, inputBinding: CommandLineBinding | None = None, default: Any = None, type: Literal['null', 'boolean', 'int', 'long', 'float', 'double', 'string', 'File', 'Directory', 'stdin', 'stdout', 'stderr', 'Any', 'NexusType'] | CommandInputArraySchema)¶
CommandInputParameter shema.
See: https://www.commonwl.org/v1.2/CommandLineTool.html#CommandInputParameter
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class blue_cwl.core.cwl.CommandLineBinding(*, position: int = 0, prefix: str | None = None, separate: bool = True, itemSeparator: str = ' ')¶
Dataclass for a command line’s tool input binding.
- position¶
Integer signifying the position in the command line. Default 0.
- Type:
int
- prefix¶
Optional prefix for named argument.
- Type:
str | None
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class blue_cwl.core.cwl.CommandLineTool(*, cwlVersion: Literal['v1.2'], id: str = 'CommandLineTool', baseCommand: list[str], inputs: dict[str, CommandInputParameter], outputs: dict[str, CommandOutputParameter], environment: dict | None = None, executor: LocalExecutor | SallocExecutor | None = None, label: str | None = None, stdout: str | None = None)¶
Dataclass for a command line tool’s output.
- id¶
The unique identifier for this object.
- Type:
str
- label¶
A short, human-readable label of this object.
- Type:
str | None
- baseCommand¶
Specifies the program to execute.
- Type:
list[str]
- inputs¶
Defines the input parameters of the process.
- Type:
dict[str, blue_cwl.core.cwl.CommandInputParameter]
- outputs¶
Defines the parameters representing the output of the process.
- Type:
dict[str, blue_cwl.core.cwl.CommandOutputParameter]
- stdout¶
Capture the command’s standard output stream to a file written to the designated output directory.
- Type:
str | None
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- make(input_values: dict)¶
Make an executable process out of the template and the inputs.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class blue_cwl.core.cwl.CommandOutputBinding(*, glob: str | None = None)¶
CommandOutputbinding schema.
See: https://www.commonwl.org/v1.2/CommandLineTool.html#CommandOutputBinding
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class blue_cwl.core.cwl.CommandOutputParameter(*, id: str | None = None, type: Literal['null', 'boolean', 'int', 'long', 'float', 'double', 'string', 'File', 'Directory', 'stdin', 'stdout', 'stderr', 'Any', 'NexusType'], label: str | None = None, doc: str | None = None, outputBinding: CommandOutputBinding | None = None)¶
CommandOutputParameter schema.
See https://www.commonwl.org/v1.2/CommandLineTool.html#CommandOutputParameter
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class blue_cwl.core.cwl.Config(*, inputs: dict[str, ConfigInput])¶
Dataclass for cwl config.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class blue_cwl.core.cwl.ConfigInput(*, type: Literal['null', 'boolean', 'int', 'long', 'float', 'double', 'string', 'File', 'Directory', 'stdin', 'stdout', 'stderr', 'Any', 'NexusType'], value: str)¶
Dataclass for config’s input entries.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class blue_cwl.core.cwl.InputArraySchema(*, items: Literal['null', 'boolean', 'int', 'long', 'float', 'double', 'string', 'File', 'Directory', 'stdin', 'stdout', 'stderr', 'Any', 'NexusType'], type: Literal['array'], label: str | None = None, doc: str | None = None, name: str | None = None)¶
InputArraySchema.
See: https://www.commonwl.org/v1.2/Workflow.html#InputArraySchema
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class blue_cwl.core.cwl.Workflow(*, cwlVersion: str, id: str = 'Workflow', label: str, inputs: dict[str, WorkflowInputParameter], outputs: dict[str, WorkflowOutputParameter], steps: list[WorkflowStep])¶
Dataclass for an entire workflow.
- cwlVersion¶
Version of the cwl specication.
- Type:
str
- id¶
Name of the workflow.
- Type:
str
- label¶
Description of the workflow.
- Type:
str
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- get_step_by_name(name)¶
Return the workflow step with given name.
- get_step_source_names(name: str) list[str]¶
Get source names for workflow step.
- iter_steps()¶
Iterate over steps.
- make(input_values)¶
Make a concretized workflow process.
- make_workflow_step(step_name, input_values, sources)¶
Make workflow step.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- show_image()¶
Show workflow graph image.
- step_names() list[str]¶
Return the names of the workflow steps.
- write_image(filepath)¶
Save workflow graph as an image.
- class blue_cwl.core.cwl.WorkflowInputParameter(*, type: InputArraySchema | Literal['null', 'boolean', 'int', 'long', 'float', 'double', 'string', 'File', 'Directory', 'stdin', 'stdout', 'stderr', 'Any', 'NexusType'], id: str | None = None, doc: str | None = None, label: str | None = None, default: Any = None)¶
WorkflowInputParameter schema.
See: https://www.commonwl.org/v1.2/Workflow.html#WorkflowInputParameter
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class blue_cwl.core.cwl.WorkflowOutputParameter(*, id: str | None = None, type: Literal['null', 'boolean', 'int', 'long', 'float', 'double', 'string', 'File', 'Directory', 'stdin', 'stdout', 'stderr', 'Any', 'NexusType'], label: str | None = None, doc: str | None = None, outputSource: str)¶
Dataclass for a workflow’s output.
See: https://www.commonwl.org/v1.2/Workflow.html#WorkflowOutputParameter
- type¶
The type of the output.
- Type:
Literal[‘null’, ‘boolean’, ‘int’, ‘long’, ‘float’, ‘double’, ‘string’, ‘File’, ‘Directory’, ‘stdin’, ‘stdout’, ‘stderr’, ‘Any’, ‘NexusType’]
- outputSource¶
- Type:
str
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- split_source_output() list[str]¶
Return step and output names for source.
- class blue_cwl.core.cwl.WorkflowStep(*, id: str, inputs: dict[str, WorkflowStepInput], outputs: list[str], run: CommandLineTool)¶
Dataclass for a workflow’s step.
- id¶
The unique identifier for this object.
- Type:
str
- inputs¶
The inputs of the step.
- Type:
dict[str, blue_cwl.core.cwl.WorkflowStepInput]
- outputs¶
The outputs of the step.
- Type:
list[str]
- run¶
The comannd line tool executed by the step.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class blue_cwl.core.cwl.WorkflowStepInput(*, id: str, label: str | None = None, source: list[str] | str | None = None, default: Any = None, valueFrom: list[str] | str | None = None)¶
Dataclass for a workflow’steps input.
See https://www.commonwl.org/v1.2/Workflow.html#WorkflowStepInput
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True, 'strict': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- split_source_output() list[tuple[str | None, str]] | None¶
Split source and return source and outputs names if any.