问题当一个工具在多个文件中产生输出时,我该怎么做?我如何指定哪些输出文件应该被保存?目标学习如何创建输出文件数组。
您还可以使用glob将多个输出文件捕获到文件数组中。
array-outputs.cwl
#!/usr/bin/env cwl-runnercwlVersion: v1.0class: CommandLineToolbaseCommand: touchinputs:touchfiles:type:type: arrayitems: stringinputBinding:position: 1outputs:output:type:type: arrayitems: FileoutputBinding:glob: "*.txt"
array-outputs-job.yml
touchfiles:- foo.txt- bar.dat- baz.txt
现在调用cwl-runner
$ cwl-runner array-outputs.cwl array-outputs-job.yml[job 140190876078160] /home/example$ touch foo.txt bar.dat baz.txtFinal process status is success{"output": [{"size": 0,"location": "foo.txt","checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709","class": "File"},{"size": 0,"location": "baz.txt","checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709","class": "File"}]}
正如YAML指南中所描述的,预期输出的数组在array-outputs-job中指定。yml每个条目用一个前导符号-标记。也可以在CWL描述中使用这种格式来标记数组中的条目,如下面的几个部分所示。
