LoginSignup
1
0

More than 5 years have passed since last update.

CWL User Guide 6: Parameter References をやってみた

Last updated at Posted at 2017-12-05

CWL User Guide 6: Parameter References

Common Workflow Language User Guide: Parameter References

今回は、パラメータを別の場所からもってくる方法について書かれています
またさらっとですがJavascript 文法のサブセットを使うことが示されています

第4回で作った hello.tar を一回消してあらたにつくるという流れで紹介されています。

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

  • $(...) Javascript

CWLファイル、tar-param.cwl

tar-param.cwl
#!/usr/bin/env cwl-runner

cwlVersion: v1.0
class: CommandLineTool
baseCommand: [tar, xf]
inputs:
  tarfile:
    type: File
    inputBinding:
      position: 1
  extractfile:
    type: string
    inputBinding:
      position: 2
outputs:
  example_out:
    type: File
    outputBinding:
      glob: $(inputs.extractfile)

パラメータファイル tar-param-job.yml

tar-param-job.yml
tarfile:
  class: File
  path: hello.tar
extractfile: goodbye.txt

必要なファイル

touch goodbye.txt && tar -cvf hello.tar goodbye.txt

実行

実行前確認

goodbye.txt がないことを確認しておく

$ rm goodbye.txt
$ ls goodbye.txt
ls: cannot access 'goodbye.txt': No such file or directory

実行方法

cwltool tar-param.cwl tar-param-job.yml

実行結果

$ cwltool tar-param.cwl tar-param-job.yml
/usr/local/bin/cwltool 1.0.20171107133715
Resolved 'tar-param.cwl' to 'file:///home/vagrant/cwl_user_guide_work/06-params/tar-param.cwl'
[job tar-param.cwl] /tmp/tmpPxBToM$ tar \
    xf \
    /tmp/tmpeStGJP/stg5a9b22b8-fb0a-4b3f-8b20-5a35736060c7/hello.tar \
    goodbye.txt
[job tar-param.cwl] completed success
{
    "example_out": {
        "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
        "basename": "goodbye.txt",
        "location": "file:///home/vagrant/cwl_user_guide_work/06-params/goodbye.txt",
        "path": "/home/vagrant/cwl_user_guide_work/06-params/goodbye.txt",
        "class": "File",
        "size": 0
    }
}
Final process status is success

実行結果確認

goodbye.txt ができたことが確認できた

$ ls goodbye.txt
goodbye.txt

今回使ったファイル

cwl_user_guide_work/06-params at master · manabuishii/cwl_user_guide_work

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