Hello, I'm new to bioinformatics and the common workflow language. I could not find an answer to this question on the common workflow language user guide nor on this forum, and I appreciate any help or pointers to the right resources.
I'm creating a CWL workflow, and I have some steps that require an array of integer inputs. What is the syntax to specify default values for an array of integers? I have tried several things that all throw exceptions when I use cwltool
to validate the workflow definition.
Input definition:
pcs:
type:
type: array
items: int
label: 'Principal Components'
The step definition:
in:
data: output_data
pcs:
- 1
- 2
Results in an error:
checking field `in`
checking object `test.yaml#test/pcs`
`source` field is int, expected string, list, or a dict.
`source` field is int, expected string, list, or a dict.
I have also tried variants like:
pcs: [1 2 3]
pcs: [1, 2, 3]
pcs:
1
2
3
pcs: 1
pcs: 2
pcs: 3
All throw errors of some sort. I read this section in the guide on Maps, but that does not seem to help in this case.
Thanks for your help!
cwl
official support has moved to a new forum. Someone may answer here but you may want to post there as well.Thanks, I was not aware of this!
Hello cole.shaw,
The concept you are trying to fill out is called WorkflowStepInput inside the WorkflowStep in the CWL reference specification https://www.commonwl.org/v1.0/Workflow.html#WorkflowStepInput & https://www.commonwl.org/v1.0/Workflow.html#WorkflowStep
So your
key_field
is theid
ofWorkflowStepInput
, and if you don't use a map as the value then the value you provide gets evaluated as if it is thesource
field. Checking the definition ofWorkflowStepInput
we see that thedefault
field may be helpful to you.So give this a try:
Thanks, got it to work! The pointer to the correct concept name for my mental map is very useful, thank you!