Do I understand correctly that listing in the InitialWorkDirRequirement does not support arrays (-) of arrays? Unfortunately it seems we have implemented a CWL creator that creates the first piece of code, but that does not work if the inputs.Input is already an array of files.
requirements:
- class: InlineJavascriptRequirement
- class: InitialWorkDirRequirement
listing:
- $(inputs.Inputs)
label: Create Reference Genome TAR bundle
doc: Bundles all the files for a reference genome bundle into a single TAR file
inputs:
Inputs:
type:
type: array
items: File
inputBinding:
valueFrom: $(self.basename)
inputBinding:
position: 99
Is not working, but this is:
requirements:
- class: InlineJavascriptRequirement
- class: InitialWorkDirRequirement
listing: $(inputs.Inputs)
label: Create Reference Genome TAR bundle
doc: Bundles all the files for a reference genome bundle into a single TAR file
inputs:
Inputs:
type:
type: array
items: File
inputBinding:
valueFrom: $(self.basename)
inputBinding:
position: 99
Your first example works for me?
Here it is again as a complete CommandLineTool
cwlVersion: v1.0
class: CommandLineTool
requirements:
- class: InitialWorkDirRequirement
listing:
- $(inputs.Inputs)
label: Create Reference Genome TAR bundle
doc: Bundles all the files for a reference genome bundle into a single TAR file
inputs:
Inputs:
type:
type: array
items: File
inputBinding:
inputBinding:
position: 99
outputs: []
baseCommand: ls
$ cwltool listing_array.cwl --Inputs README.rst --Inputs CONTRIBUTING.md
INFO /home/michael/cwltool/env3.7/bin/cwltool 1.0.20191022103248
INFO Resolved 'listing_array.cwl' to 'file:///home/michael/cwltool/listing_array.cwl'
INFO [job listing_array.cwl] /tmp/6dwv047p$ ls
CONTRIBUTING.md README.rst
INFO [job listing_array.cwl] completed success
{}
INFO Final process status is success
cwl-runner --debug /arrays.cwl /files.yml
/usr/bin/cwl-runner 1.0.20180302231433
Resolved '/arrays.cwl' to 'file:///arrays.cwl'
[job arrays.cwl] initializing from file:///arrays.cwl
[job arrays.cwl] {
"Inputs": [
{
"class": "File",
"location": "file:///aap/noot/mies/one.txt",
"size": 14,
"basename": "one.txt",
"nameroot": "one",
"nameext": ".txt"
},
{
"class": "File",
"location": "file:///tmp/two.txt",
"size": 4,
"basename": "two.txt",
"nameroot": "two",
"nameext": ".txt"
}
]
}
Got workflow error
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/cwltool/executors.py", line 98, in run_jobs
for r in jobiter:
File "/usr/lib/python2.7/dist-packages/cwltool/command_line_tool.py", line 417, in job
self.updatePathmap(builder.outdir, builder.pathmapper, l)
File "/usr/lib/python2.7/dist-packages/cwltool/command_line_tool.py", line 241, in updatePathmap
for sf in fn.get("secondaryFiles", []):
AttributeError: 'CommentedSeq' object has no attribute 'get'
Workflow error, try again with --debug for more information:
'CommentedSeq' object has no attribute 'get'
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/cwltool/main.py", line 588, in main
**vars(args))
File "/usr/lib/python2.7/dist-packages/cwltool/executors.py", line 29, in __call__
return self.execute(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/cwltool/executors.py", line 69, in execute
self.run_jobs(t, job_order_object, logger, **kwargs)
File "/usr/lib/python2.7/dist-packages/cwltool/executors.py", line 113, in run_jobs
raise WorkflowException(Text(e))
WorkflowException: 'CommentedSeq' object has no attribute 'get'
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: CommandLineTool
requirements:
- class: InitialWorkDirRequirement
listing: $(inputs.Inputs)
label: Create Reference Genome TAR bundle
doc: Bundles all the files for a reference genome bundle into a single TAR file
inputs:
Inputs:
type:
type: array
items: File
inputBinding:
inputBinding:
position: 99
outputs: []
baseCommand: ls
The only difference is the listing: $(inputs.Inputs)