Hello,
I’m learning CWL and I’ve this simple wrapper around cp
in which I’d like the target file to follow a specific pattern (foo.txt
→ foo.txt.copy
). For this, I use the fields default
and valueFrom
for the second parameter to cp
:
my_tool.cwl
:
#!/usr/bin/env cwl-runner
cwlVersion: v1.2
class: CommandLineTool
baseCommand: cp
inputs:
infile:
type: File
inputBinding:
position: 1
copied_file:
type: string
default: ""
inputBinding:
position: 2
valueFrom: $(inputs.infile.basename).copy
outputs:
outfile:
type: File
outputBinding:
glob: $(inputs.copied_file) ## <--- does not work
I cannot understand why explicitly setting the glob value to the desired file (via $(inputs.copied_file)
), it is not working.
i.e.:
$ touch foo.txt
$ cwltool --debug my_tool.cwl --infile foo.txt
# ERROR [job my_tool.cwl] Job error:
# ("Error collecting output for parameter 'outfile': my_tool.cwl:27:7: Did not find output file with glob pattern: '[]'.", {})
Whereas if I use either:
-
glob: "*.copy"
or, again, glob: $(inputs.infile.basename).copy
it works.
What am I missing?
It seems that inputs.copied_file
gets the default
value and not the valueFrom
value, or am I wrong?
Do you have any suggestions for a better approach?
Thanks!