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.

CWL User Guide 3: Essential Input Parameters をやってみた

Last updated at Posted at 2017-12-02

CWL User Guide 3: Essential Input Parameters

Common Workflow Language User Guide: Essential Input Parameters

今回は、入力パラメータの取扱について書いてあります

以下のようなことが解説されています。

  • inputs
  • id
  • type
  • class
  • File
  • path
  • inputBinding
  • prefix
  • separate
  • prefixと値を結びつけるときに、空白をいれるかどうかのフラグ
  • baseCommand
  • /tmp ディレクトリはどうしてできるのか?

用語の数は結構ありますが、1つ1つ短い解説なのとサンプルがあるのでよいとおもいます

CWLファイル、inp.cwl

#!/usr/bin/env cwl-runner

cwlVersion: v1.0
class: CommandLineTool
baseCommand: echo
inputs:
  example_flag:
    type: boolean
    inputBinding:
      position: 1
      prefix: -f
  example_string:
    type: string
    inputBinding:
      position: 3
      prefix: --example-string
  example_int:
    type: int
    inputBinding:
      position: 2
      prefix: -i
      separate: false
  example_file:
    type: File?
    inputBinding:
      prefix: --file=
      separate: false
      position: 4

outputs: []

パラメータファイル、inp-job.yml

inp-job.yml
example_flag: true
example_string: hello
example_int: 42
example_file:
  class: File
  path: whale.txt

実行に必要なファイル whale.txt

空のファイルを

touch whale.txt

で、作ると買いてありました

実行

実行方法

cwltool inp.cwl inp-job.yml

出力

$ cwltool inp.cwl inp-job.yml
/usr/local/bin/cwltool 1.0.20171107133715
Resolved 'inp.cwl' to 'file:///home/vagrant/cwl_user_guide_work/03-input/inp.cwl'
[job inp.cwl] /tmp/tmpY9KcLB$ echo \
    -f \
    -i42 \
    --example-string \
    hello \
    --file=/tmp/tmpS_fjZW/stg5cd096d0-2e2f-4011-badb-89a51c92a9ed/whale.txt
-f -i42 --example-string hello --file=/tmp/tmpS_fjZW/stg5cd096d0-2e2f-4011-badb-89a51c92a9ed/whale.txt
[job inp.cwl] completed success
{}
Final process status is success

使ったファイル

cwl_user_guide_work/03-input 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?