LoginSignup
3
0

More than 5 years have passed since last update.

CWL User Guide 9: Array Inputs をやってみた

Last updated at Posted at 2017-12-09

CWL User Guide 9: Array Inputs

Common Workflow Language User Guide: Array Inputs

今回は、入力のパラメータを配列形式での受け付けが可能だとのべられています。
パラメータをカンマでつなげるとか、パラメータそれぞれに prefix をつけるなど、そういったことができるということについて書かれています

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

  • type
  • type: array
  • items
  • inputBinding
  • itemSeparator

CWLファイル、array-inputs.cwl

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

cwlVersion: v1.0
class: CommandLineTool
inputs:
  filesA:
    type: string[]
    inputBinding:
      prefix: -A
      position: 1

  filesB:
    type:
      type: array
      items: string
      inputBinding:
        prefix: -B=
        separate: false
    inputBinding:
      position: 2

  filesC:
    type: string[]
    inputBinding:
      prefix: -C=
      itemSeparator: ","
      separate: false
      position: 4

outputs: []
baseCommand: echo

パラメータファイル array-inputs-job.yml

array-inputs-job.yml
filesA: [one, two, three]
filesB: [four, five, six]
filesC: [seven, eight, nine]

実行

実行方法

cwltool array-inputs.cwl array-inputs-job.yml

実行結果

$ cwltool array-inputs.cwl array-inputs-job.yml
/usr/local/bin/cwltool 1.0.20171107133715
Resolved 'array-inputs.cwl' to 'file:///home/vagrant/cwl_user_guide_work/09-array-inputs/array-inputs.cwl'
[job array-inputs.cwl] /tmp/tmpUT2B6w$ echo \
    -A \
    one \
    two \
    three \
    -B=four \
    -B=five \
    -B=six \
    -C=seven,eight,nine
-A one two three -B=four -B=five -B=six -C=seven,eight,nine
[job array-inputs.cwl] completed success
{}
Final process status is success

 今回使ったファイル

cwl_user_guide_work/09-array-inputs at master · manabuishii/cwl_user_guide_work

3
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
3
0