2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CWLAdvent Calendar 2017

Day 11

CWL User Guide 10: Array Outputs をやってみた

Last updated at Posted at 2017-12-10

CWL User Guide 10: Array Outputs

Common Workflow Language User Guide: Array Outputs

今回は配列形式や、ワイルドカードで出力を指定できることについて書かれています

この回にでてくる主なキーワード

  • glob

CWLファイル、array-outputs.cwl

array-outputs.cwl
#!/usr/bin/env cwl-runner

cwlVersion: v1.0
class: CommandLineTool
baseCommand: touch
inputs:
  touchfiles:
    type:
      type: array
      items: string
    inputBinding:
      position: 1
outputs:
  output:
    type:
      type: array
      items: File
    outputBinding:
      glob: "*.txt"

パラメータファイル

array-outputs-job.yml
touchfiles:
  - foo.txt
  - bar.dat
  - baz.txt

必要なファイル

実行

実行方法

cwltool array-outputs.cwl array-outputs-job.yml

実行結果

$ cwltool array-outputs.cwl array-outputs-job.yml
/usr/local/bin/cwltool 1.0.20171107133715
Resolved 'array-outputs.cwl' to 'file:///home/vagrant/cwl_user_guide_work/10-array-outputs/array-outputs.cwl'
[job array-outputs.cwl] /tmp/tmpXAVRki$ touch \
    foo.txt \
    bar.dat \
    baz.txt
[job array-outputs.cwl] completed success
{
    "output": [
        {
            "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
            "basename": "baz.txt",
            "location": "file:///home/vagrant/cwl_user_guide_work/10-array-outputs/baz.txt",
            "path": "/home/vagrant/cwl_user_guide_work/10-array-outputs/baz.txt",
            "class": "File",
            "size": 0
        },
        {
            "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
            "basename": "foo.txt",
            "location": "file:///home/vagrant/cwl_user_guide_work/10-array-outputs/foo.txt",
            "path": "/home/vagrant/cwl_user_guide_work/10-array-outputs/foo.txt",
            "class": "File",
            "size": 0
        }
    ]
}
Final process status is success

実行結果確認

以下の2つの点が確認できます

  • baz.txt foo.txt が存在すること
  • bar.dat が存在しないこと
$ ls
array-outputs.cwl  array-outputs-job.yml  baz.txt  foo.txt

今回使ったファイル

cwl_user_guide_work/10-array-outputs at master · manabuishii/cwl_user_guide_work

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?