From ef67193f259999a431a57cf77f08935cb8fc1175 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Wed, 15 Jun 2016 16:39:20 +0200 Subject: [PATCH] Squashed 'cwltool/schemas/' changes from 3e1b02c..0c275b4 0c275b4 clarify that outputBinding must not be set c30b79f finish restoring allowable types for parameters 06c9ba7 Merge pull request #230 from common-workflow-language/stderr-out-types cbd7bc2 only allow use of stderr/stdout shortcuts as types for the Outputs. Better place the docs 0ba703d jsonldPredicate did it! a5a7516 nope, use an enum instead 24a611d use long ids? 52f6411 extend doc to stderr psuedotype 9d0fbe0 initial stdout & stderr shortcut support 392be2f fixing site build? 57a5bc8 Fix last test using "args" 3cc79d2 Port draft-3 changes to command line generation tests to draft-4. f2a18c3 Add missing args.py used by draft-3 tests. ac17f5d Port draft-2 changes to command line generation tests to draft-3. ddf417b Command line generation tests now work by executing a small script that copies the command line to the output. Allows cwl-runner implementations to drop the --conformance-test code path. c4cecad Merge pull request #228 from common-workflow-language/scoped-ref-and-typedsl d1d53b3 Merge pull request #227 from common-workflow-language/stderr 0b987d3 add test 71e9b3d add stderr object 347c28e Merge pull request #212 from common-workflow-language/cwl-runner-interface 28f64f0 clarify description d791500 add output stanza, fix syntax ee0bea3 add descriptions 04dfbf0 toolfile is optional b1e740e bind and order the tool and jobfiles 81bd8de description c7a2bf1 move to a better location 979453a initial description of cwl-runner interface git-subtree-dir: cwltool/schemas git-subtree-split: 0c275b476f055f77675027f9b26e25abf16cd9a8 --- draft-2/conformance_test_draft-2.yaml | 67 ++++----- draft-2/draft-2/args.py | 7 + draft-2/draft-2/binding-test.cwl | 11 +- draft-2/draft-2/bwa-mem-job.json | 6 +- draft-2/draft-2/bwa-mem-tool.cwl | 23 +++- draft-2/draft-2/cat1-testcli.cwl | 34 +++++ draft-2/draft-2/cat2-tool.cwl | 23 ---- draft-2/draft-2/chr20.fa | 0 .../draft-2/example_human_Illumina.pe_1.fastq | 0 .../draft-2/example_human_Illumina.pe_2.fastq | 0 draft-2/draft-2/reads.fastq | 0 draft-2/draft-2/template-tool.cwl | 9 +- draft-2/draft-2/tmap-tool.cwl | 21 ++- draft-3/conformance_test_draft-3.yaml | 70 ++++------ draft-3/cwl-runner.cwl | 78 +++++++++++ draft-3/draft-3/args.py | 7 + draft-3/draft-3/binding-test.cwl | 11 +- draft-3/draft-3/bwa-mem-job.json | 6 +- draft-3/draft-3/bwa-mem-tool.cwl | 22 ++- draft-3/draft-3/cat1-testcli.cwl | 35 +++++ draft-3/draft-3/chr20.fa | 0 .../draft-3/example_human_Illumina.pe_1.fastq | 0 .../draft-3/example_human_Illumina.pe_2.fastq | 0 draft-3/draft-3/reads.fastq | 0 draft-3/draft-3/template-tool.cwl | 9 +- draft-3/draft-3/tmap-tool.cwl | 18 ++- draft-4/CommandLineTool.yml | 130 ++++++++++++++++-- draft-4/Process.yml | 24 ---- draft-4/Workflow.yml | 22 +++ draft-4/conformance_test_draft-4.yaml | 107 ++++++++------ draft-4/draft-4/args.py | 7 + draft-4/draft-4/binding-test.cwl | 15 +- draft-4/draft-4/bwa-mem-job.json | 6 +- draft-4/draft-4/bwa-mem-tool.cwl | 36 +++-- draft-4/draft-4/cat1-testcli.cwl | 35 +++++ draft-4/draft-4/cat3-tool-mediumcut.cwl | 18 +++ draft-4/draft-4/cat3-tool-shortcut.cwl | 17 +++ draft-4/draft-4/chr20.fa | 0 draft-4/draft-4/egrep-stderr-mediumcut.cwl | 18 +++ draft-4/draft-4/egrep-stderr-shortcut.cwl | 16 +++ draft-4/draft-4/egrep-stderr.cwl | 15 ++ .../draft-4/example_human_Illumina.pe_1.fastq | 0 .../draft-4/example_human_Illumina.pe_2.fastq | 0 draft-4/draft-4/reads.fastq | 0 draft-4/draft-4/template-tool.cwl | 9 +- draft-4/draft-4/tmap-tool.cwl | 18 ++- site/draft4-deps.json | 4 + 47 files changed, 713 insertions(+), 241 deletions(-) create mode 100755 draft-2/draft-2/args.py create mode 100755 draft-2/draft-2/cat1-testcli.cwl delete mode 100755 draft-2/draft-2/cat2-tool.cwl create mode 100644 draft-2/draft-2/chr20.fa create mode 100644 draft-2/draft-2/example_human_Illumina.pe_1.fastq create mode 100644 draft-2/draft-2/example_human_Illumina.pe_2.fastq create mode 100644 draft-2/draft-2/reads.fastq create mode 100644 draft-3/cwl-runner.cwl create mode 100755 draft-3/draft-3/args.py create mode 100755 draft-3/draft-3/cat1-testcli.cwl create mode 100644 draft-3/draft-3/chr20.fa create mode 100644 draft-3/draft-3/example_human_Illumina.pe_1.fastq create mode 100644 draft-3/draft-3/example_human_Illumina.pe_2.fastq create mode 100644 draft-3/draft-3/reads.fastq create mode 100755 draft-4/draft-4/args.py create mode 100755 draft-4/draft-4/cat1-testcli.cwl create mode 100755 draft-4/draft-4/cat3-tool-mediumcut.cwl create mode 100755 draft-4/draft-4/cat3-tool-shortcut.cwl create mode 100644 draft-4/draft-4/chr20.fa create mode 100644 draft-4/draft-4/egrep-stderr-mediumcut.cwl create mode 100644 draft-4/draft-4/egrep-stderr-shortcut.cwl create mode 100644 draft-4/draft-4/egrep-stderr.cwl create mode 100644 draft-4/draft-4/example_human_Illumina.pe_1.fastq create mode 100644 draft-4/draft-4/example_human_Illumina.pe_2.fastq create mode 100644 draft-4/draft-4/reads.fastq diff --git a/draft-2/conformance_test_draft-2.yaml b/draft-2/conformance_test_draft-2.yaml index 1a6ca998b..a0ffecef1 100644 --- a/draft-2/conformance_test_draft-2.yaml +++ b/draft-2/conformance_test_draft-2.yaml @@ -1,63 +1,52 @@ -- args: [bwa, mem, -t, '4', -I, '1,2,3,4', -m, '3', draft-2/rabix/tests/test-files/chr20.fa, - draft-2/rabix/tests/test-files/example_human_Illumina.pe_1.fastq, draft-2/rabix/tests/test-files/example_human_Illumina.pe_2.fastq] +- args: job: draft-2/bwa-mem-job.json - stdout: output.sam tool: draft-2/bwa-mem-tool.cwl + output: + args: [bwa, mem, -t, '4', -I, '1,2,3,4', -m, '3', + chr20.fa, + example_human_Illumina.pe_1.fastq, + example_human_Illumina.pe_2.fastq] doc: General test of command line generation -- args: [bwa, mem, draft-2/rabix/tests/test-files/chr20.fa, - "-XXX", - "-YYY", draft-2/rabix/tests/test-files/example_human_Illumina.pe_1.fastq, - "-YYY", draft-2/rabix/tests/test-files/example_human_Illumina.pe_2.fastq] +- output: + args: [bwa, mem, chr20.fa, + "-XXX", + "-YYY", example_human_Illumina.pe_1.fastq, + "-YYY", example_human_Illumina.pe_2.fastq] job: draft-2/bwa-mem-job.json tool: draft-2/binding-test.cwl doc: Test nested prefixes with arrays -- args: [tmap, mapall, stage1, map1, --min-seq-length, '20', map2, --min-seq-length, +- output: + args: [tmap, mapall, stage1, map1, --min-seq-length, '20', map2, --min-seq-length, '20', stage2, map1, --max-seq-length, '20', --min-seq-length, '10', --seed-length, '16', map2, --max-seed-hits, '-1', --max-seq-length, '20', --min-seq-length, '10'] job: draft-2/tmap-job.json - stdin: draft-2/reads.fastq - stdout: output.sam tool: draft-2/tmap-tool.cwl - doc: Test nested command line bindings and stdin/stdout redirection + doc: Test nested command line bindings -- args: [cat, draft-2/hello.txt] +- output: + args: [cat, hello.txt] job: draft-2/cat-job.json - tool: draft-2/cat1-tool.cwl + tool: draft-2/cat1-testcli.cwl doc: Test command line with optional input (missing) -- args: [cat, -n, draft-2/hello.txt] +- output: + args: [cat, -n, hello.txt] job: draft-2/cat-n-job.json - tool: draft-2/cat1-tool.cwl + tool: draft-2/cat1-testcli.cwl doc: Test command line with optional input (provided) -- args: [cat] - job: draft-2/cat-job.json - stdin: draft-2/hello.txt - tool: draft-2/cat2-tool.cwl - doc: Test command line with stdin redirection - -- args: [cat, draft-2/hello.txt] - job: draft-2/cat-job.json - stdout: output.txt - tool: draft-2/cat3-tool.cwl - doc: Test command line with stdout redirection - -- args: [cat] - job: draft-2/cat-job.json - stdin: draft-2/hello.txt - stdout: output.txt - tool: draft-2/cat4-tool.cwl - doc: Test command line with stdin and stdout redirection - -- args: [cat, foo.txt] - createfiles: {foo.txt: 'The file is draft-2/hello.txt - - '} +- output: + "foo": { + "checksum": "sha1$63da67422622fbf9251a046d7a34b7ea0fd4fead", + "class": "File", + "path": "foo.txt", + "size": 22 + } job: draft-2/cat-job.json tool: draft-2/template-tool.cwl - doc: Test CreateFileRequirement ExpressionEngineRequirement.engineConfig features + doc: Test CreateFileRequirement ExpressionEngineRequirement.engineConfig feature - job: draft-2/cat-job.json output: diff --git a/draft-2/draft-2/args.py b/draft-2/draft-2/args.py new file mode 100755 index 000000000..1baf6a090 --- /dev/null +++ b/draft-2/draft-2/args.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python +import sys +import json +import os +args = [os.path.basename(a) for a in sys.argv[1:]] +with open("cwl.output.json", "w") as f: + json.dump({"args": args}, f) diff --git a/draft-2/draft-2/binding-test.cwl b/draft-2/draft-2/binding-test.cwl index 9f3914e98..cd3857861 100755 --- a/draft-2/draft-2/binding-test.cwl +++ b/draft-2/draft-2/binding-test.cwl @@ -14,6 +14,15 @@ inputs: inputBinding: { prefix: "-YYY" } inputBinding: { position: 3, prefix: "-XXX" } + - id: "#args.py" + type: File + default: + class: File + path: args.py + inputBinding: + position: -1 + outputs: [] -baseCommand: ["bwa", "mem"] +baseCommand: python +arguments: ["bwa", "mem"] diff --git a/draft-2/draft-2/bwa-mem-job.json b/draft-2/draft-2/bwa-mem-job.json index 331cc256b..299f75b31 100644 --- a/draft-2/draft-2/bwa-mem-job.json +++ b/draft-2/draft-2/bwa-mem-job.json @@ -1,18 +1,18 @@ { "reference": { "class": "File", - "path": "rabix/tests/test-files/chr20.fa", + "path": "chr20.fa", "size": 123, "checksum": "sha1$hash" }, "reads": [ { "class": "File", - "path": "rabix/tests/test-files/example_human_Illumina.pe_1.fastq" + "path": "example_human_Illumina.pe_1.fastq" }, { "class": "File", - "path": "rabix/tests/test-files/example_human_Illumina.pe_2.fastq" + "path": "example_human_Illumina.pe_2.fastq" } ], "min_std_max_min": [ diff --git a/draft-2/draft-2/bwa-mem-tool.cwl b/draft-2/draft-2/bwa-mem-tool.cwl index c6cdba102..c875ed2eb 100755 --- a/draft-2/draft-2/bwa-mem-tool.cwl +++ b/draft-2/draft-2/bwa-mem-tool.cwl @@ -4,11 +4,6 @@ class: CommandLineTool requirements: - import: node-engine.cwl -hints: - - class: DockerRequirement - dockerPull: images.sbgenomics.com/rabix/bwa - dockerImageId: 9d3b9b0359cf - inputs: - id: "#reference" type: File @@ -31,14 +26,28 @@ inputs: prefix: "-I" itemSeparator: "," + - id: "#args.py" + type: File + default: + class: File + path: args.py + inputBinding: + position: -1 + outputs: - id: "#sam" - type: "File" + type: ["null", "File"] outputBinding: { "glob": "output.sam" } + - id: "#args" + type: + type: array + items: string -baseCommand: ["bwa", "mem"] +baseCommand: python arguments: + - "bwa" + - "mem" - valueFrom: engine: "node-engine.cwl" script: "$job.allocatedResources.cpu" diff --git a/draft-2/draft-2/cat1-testcli.cwl b/draft-2/draft-2/cat1-testcli.cwl new file mode 100755 index 000000000..410833193 --- /dev/null +++ b/draft-2/draft-2/cat1-testcli.cwl @@ -0,0 +1,34 @@ +#!/usr/bin/env cwl-runner +{ + "class": "CommandLineTool", + "description": "Print the contents of a file to stdout using 'cat' running in a docker container.", + "inputs": [ + { + "id": "#file1", + "type": "File", + "inputBinding": {"position": 1} + }, + { + "id": "#numbering", + "type": ["null", "boolean"], + "inputBinding": { + "position": 0, + "prefix": "-n" + } + }, + { + id: "#args.py", + type: File, + default: { + class: File, + path: args.py + }, + inputBinding: { + position: -1 + } + } + ], + "outputs": [], + "baseCommand": "python", + "arguments": ["cat"] +} diff --git a/draft-2/draft-2/cat2-tool.cwl b/draft-2/draft-2/cat2-tool.cwl deleted file mode 100755 index a7c3f44b3..000000000 --- a/draft-2/draft-2/cat2-tool.cwl +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env cwl-runner -{ - "class": "CommandLineTool", - "description": "Print the contents of a file to stdout using 'cat' running in a docker container.", - "hints": [ - { - "class": "DockerRequirement", - "dockerPull": "debian:wheezy" - } - ], - "inputs": [ - { - "id": "#file1", - "type": "File" - } - ], - "outputs": [], - "baseCommand": "cat", - "stdin": { - "engine": "cwl:JsonPointer", - "script": "job/file1/path" - } -} diff --git a/draft-2/draft-2/chr20.fa b/draft-2/draft-2/chr20.fa new file mode 100644 index 000000000..e69de29bb diff --git a/draft-2/draft-2/example_human_Illumina.pe_1.fastq b/draft-2/draft-2/example_human_Illumina.pe_1.fastq new file mode 100644 index 000000000..e69de29bb diff --git a/draft-2/draft-2/example_human_Illumina.pe_2.fastq b/draft-2/draft-2/example_human_Illumina.pe_2.fastq new file mode 100644 index 000000000..e69de29bb diff --git a/draft-2/draft-2/reads.fastq b/draft-2/draft-2/reads.fastq new file mode 100644 index 000000000..e69de29bb diff --git a/draft-2/draft-2/template-tool.cwl b/draft-2/draft-2/template-tool.cwl index 50dc7e563..2543600ae 100755 --- a/draft-2/draft-2/template-tool.cwl +++ b/draft-2/draft-2/template-tool.cwl @@ -17,9 +17,14 @@ requirements: - filename: foo.txt fileContent: engine: "#js" - script: 't("The file is <%= $job.file1.path %>\n")' + script: > + t("The file is <%= $job.file1.path.split('/').slice(-1)[0] %>\n") inputs: - id: "#file1" type: File -outputs: [] +outputs: + - id: "#foo" + type: File + outputBinding: + glob: foo.txt baseCommand: ["cat", "foo.txt"] diff --git a/draft-2/draft-2/tmap-tool.cwl b/draft-2/draft-2/tmap-tool.cwl index a9c8ac62e..3f9ee02c5 100755 --- a/draft-2/draft-2/tmap-tool.cwl +++ b/draft-2/draft-2/tmap-tool.cwl @@ -16,7 +16,18 @@ "type": "array", "items": "Stage" } + }, + { + id: "#args.py", + type: File, + default: { + class: File, + path: args.py + }, + inputBinding: { + position: -1 } + } ], "outputs": [ { @@ -24,7 +35,7 @@ "outputBinding": { "glob": "output.sam" }, - "type": "File" + "type": ["null", "File"] } ], "requirements": [ @@ -233,10 +244,6 @@ ] } ]}], - "baseCommand": ["tmap", "mapall"], - "stdin": { - "engine": "cwl:JsonPointer", - "script": "job/reads/path" - }, - "stdout": "output.sam" + "baseCommand": "python", + "arguments": ["tmap", "mapall"] } diff --git a/draft-3/conformance_test_draft-3.yaml b/draft-3/conformance_test_draft-3.yaml index 724853d6c..f187afc52 100644 --- a/draft-3/conformance_test_draft-3.yaml +++ b/draft-3/conformance_test_draft-3.yaml @@ -1,63 +1,51 @@ -- args: [bwa, mem, -t, '4', -I, '1,2,3,4', -m, '3', draft-3/rabix/tests/test-files/chr20.fa, - draft-3/rabix/tests/test-files/example_human_Illumina.pe_1.fastq, draft-3/rabix/tests/test-files/example_human_Illumina.pe_2.fastq] - job: draft-3/bwa-mem-job.json - stdout: output.sam +- job: draft-3/bwa-mem-job.json tool: draft-3/bwa-mem-tool.cwl + output: + args: [bwa, mem, -t, '4', -I, '1,2,3,4', -m, '3', + chr20.fa, + example_human_Illumina.pe_1.fastq, + example_human_Illumina.pe_2.fastq] doc: General test of command line generation -- args: [bwa, mem, draft-3/rabix/tests/test-files/chr20.fa, - "-XXX", - "-YYY", draft-3/rabix/tests/test-files/example_human_Illumina.pe_1.fastq, - "-YYY", draft-3/rabix/tests/test-files/example_human_Illumina.pe_2.fastq] +- output: + args: [bwa, mem, chr20.fa, + "-XXX", + "-YYY", example_human_Illumina.pe_1.fastq, + "-YYY", example_human_Illumina.pe_2.fastq] job: draft-3/bwa-mem-job.json tool: draft-3/binding-test.cwl doc: Test nested prefixes with arrays -- args: [tmap, mapall, stage1, map1, --min-seq-length, '20', map2, --min-seq-length, +- output: + args: [tmap, mapall, stage1, map1, --min-seq-length, '20', map2, --min-seq-length, '20', stage2, map1, --max-seq-length, '20', --min-seq-length, '10', --seed-length, '16', map2, --max-seed-hits, '-1', --max-seq-length, '20', --min-seq-length, '10'] job: draft-3/tmap-job.json - stdin: draft-3/reads.fastq - stdout: output.sam tool: draft-3/tmap-tool.cwl - doc: Test nested command line bindings and stdin/stdout redirection + doc: Test nested command line bindings -- args: [cat, draft-3/hello.txt] +- output: + args: [cat, hello.txt] job: draft-3/cat-job.json - tool: draft-3/cat1-tool.cwl + tool: draft-3/cat1-testcli.cwl doc: Test command line with optional input (missing) -- args: [cat, -n, draft-3/hello.txt] +- output: + args: [cat, -n, hello.txt] job: draft-3/cat-n-job.json - tool: draft-3/cat1-tool.cwl + tool: draft-3/cat1-testcli.cwl doc: Test command line with optional input (provided) -- args: [cat] - job: draft-3/cat-job.json - stdin: draft-3/hello.txt - tool: draft-3/cat2-tool.cwl - doc: Test command line with stdin redirection - -- args: [cat, draft-3/hello.txt] - job: draft-3/cat-job.json - stdout: output.txt - tool: draft-3/cat3-tool.cwl - doc: Test command line with stdout redirection - -- args: [cat] - job: draft-3/cat-job.json - stdin: draft-3/hello.txt - stdout: output.txt - tool: draft-3/cat4-tool.cwl - doc: Test command line with stdin and stdout redirection - -- args: [cat, foo.txt] - createfiles: {foo.txt: 'The file is draft-3/hello.txt - - '} +- output: + "foo": { + "checksum": "sha1$63da67422622fbf9251a046d7a34b7ea0fd4fead", + "class": "File", + "path": "foo.txt", + "size": 22 + } job: draft-3/cat-job.json tool: draft-3/template-tool.cwl - doc: Test CreateFileRequirement ExpressionEngineRequirement.engineConfig features + doc: Test CreateFileRequirement ExpressionEngineRequirement.engineConfig feature - job: draft-3/cat-job.json output: @@ -504,7 +492,7 @@ doc: | Test parameter evaluation, with support for JS expressions -- args: [cat, draft-3/hello.txt] +- output: {} job: draft-3/cat-job.json tool: draft-3/metadata.cwl doc: Test metadata diff --git a/draft-3/cwl-runner.cwl b/draft-3/cwl-runner.cwl new file mode 100644 index 000000000..7304f9633 --- /dev/null +++ b/draft-3/cwl-runner.cwl @@ -0,0 +1,78 @@ +#!/usr/bin/env cwl-runner +class: CommandLineTool +cwlVersion: "cwl:draft-3" + +description: | + Generic interface to run a Common Workflow Language tool or workflow from the + command line. To be implemented by each CWL compliant execution platform for + testing conformance to the standard and optionally for use by users. + +inputs: + - id: outdir + type: string + default: outdir + description: | + Output directory, defaults to the current directory + inputBinding: + prefix: "--outdir" + + - id: quiet + type: boolean + description: no diagnostic output + inputBinding: + prefix: "--quiet" + + - id: toolfile + type: [ "null", File ] + description: | + The tool or workflow description to run. Optional if the jobfile has a + `cwl:tool` field to indicate the tool or workflow description to run. + inputBinding: + position: 1 + + - id: jobfile + type: File + inputBinding: + position: 2 + + - id: conformance-test + type: boolean + inputBinding: + prefix: "--conformance-test" + + - id: basedir + type: string + inputBinding: + prefix: "--basedir" + + - id: no-container + type: boolean + description: | + Do not execute jobs in a Docker container, even when listed as a Requirement + inputBinding: + prefix: "--no-container" + + - id: tmp-outdir-prefix + type: string + description: | + Path prefix for temporary directories. Useful for OS X so that boot2docker + writes to /Users + inputBinding: + prefix: "--tmp-outdir-prefix" + + - id: tmpdir-prefix + type: string + description: | + Path prefix for temporary directories + inputBinding: + prefix: "--tmpdir-prefix" + +baseCommand: cwl-runner + +stdout: output-object.json + +outputs: + - id: output-object + type: File + outputBinding: + glob: output-object.json diff --git a/draft-3/draft-3/args.py b/draft-3/draft-3/args.py new file mode 100755 index 000000000..1baf6a090 --- /dev/null +++ b/draft-3/draft-3/args.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python +import sys +import json +import os +args = [os.path.basename(a) for a in sys.argv[1:]] +with open("cwl.output.json", "w") as f: + json.dump({"args": args}, f) diff --git a/draft-3/draft-3/binding-test.cwl b/draft-3/draft-3/binding-test.cwl index 2905c511c..50271f53f 100755 --- a/draft-3/draft-3/binding-test.cwl +++ b/draft-3/draft-3/binding-test.cwl @@ -15,6 +15,15 @@ inputs: inputBinding: { prefix: "-YYY" } inputBinding: { position: 3, prefix: "-XXX" } + - id: "#args.py" + type: File + default: + class: File + path: args.py + inputBinding: + position: -1 + outputs: [] -baseCommand: [bwa, mem] +baseCommand: python +arguments: ["bwa", "mem"] diff --git a/draft-3/draft-3/bwa-mem-job.json b/draft-3/draft-3/bwa-mem-job.json index b6b290140..48d7d6cfe 100644 --- a/draft-3/draft-3/bwa-mem-job.json +++ b/draft-3/draft-3/bwa-mem-job.json @@ -1,18 +1,18 @@ { "reference": { "class": "File", - "path": "rabix/tests/test-files/chr20.fa", + "path": "chr20.fa", "size": 123, "checksum": "sha1$hash" }, "reads": [ { "class": "File", - "path": "rabix/tests/test-files/example_human_Illumina.pe_1.fastq" + "path": "example_human_Illumina.pe_1.fastq" }, { "class": "File", - "path": "rabix/tests/test-files/example_human_Illumina.pe_2.fastq" + "path": "example_human_Illumina.pe_2.fastq" } ], "min_std_max_min": [ diff --git a/draft-3/draft-3/bwa-mem-tool.cwl b/draft-3/draft-3/bwa-mem-tool.cwl index 7144a4bdd..985b15316 100755 --- a/draft-3/draft-3/bwa-mem-tool.cwl +++ b/draft-3/draft-3/bwa-mem-tool.cwl @@ -5,10 +5,6 @@ cwlVersion: cwl:draft-3 class: CommandLineTool hints: - - class: DockerRequirement - dockerPull: images.sbgenomics.com/rabix/bwa - dockerImageId: 9d3b9b0359cf - - class: ResourceRequirement coresMin: 4 @@ -34,14 +30,28 @@ inputs: prefix: -I itemSeparator: "," + - id: args.py + type: File + default: + class: File + path: args.py + inputBinding: + position: -1 + outputs: - id: sam - type: File + type: ["null", File] outputBinding: { glob: output.sam } + - id: args + type: + type: array + items: string -baseCommand: [bwa, mem] +baseCommand: python arguments: + - bwa + - mem - valueFrom: $(runtime.cores) position: 1 prefix: -t diff --git a/draft-3/draft-3/cat1-testcli.cwl b/draft-3/draft-3/cat1-testcli.cwl new file mode 100755 index 000000000..31f3a94d6 --- /dev/null +++ b/draft-3/draft-3/cat1-testcli.cwl @@ -0,0 +1,35 @@ +#!/usr/bin/env cwl-runner +{ + "class": "CommandLineTool", + "cwlVersion": "cwl:draft-3", + "description": "Print the contents of a file to stdout using 'cat' running in a docker container.", + "inputs": [ + { + "id": "file1", + "type": "File", + "inputBinding": {"position": 1} + }, + { + "id": "numbering", + "type": ["null", "boolean"], + "inputBinding": { + "position": 0, + "prefix": "-n" + } + }, + { + id: "args.py", + type: File, + default: { + class: File, + path: args.py + }, + inputBinding: { + position: -1 + } + } + ], + "outputs": [], + "baseCommand": "python", + "arguments": ["cat"] +} diff --git a/draft-3/draft-3/chr20.fa b/draft-3/draft-3/chr20.fa new file mode 100644 index 000000000..e69de29bb diff --git a/draft-3/draft-3/example_human_Illumina.pe_1.fastq b/draft-3/draft-3/example_human_Illumina.pe_1.fastq new file mode 100644 index 000000000..e69de29bb diff --git a/draft-3/draft-3/example_human_Illumina.pe_2.fastq b/draft-3/draft-3/example_human_Illumina.pe_2.fastq new file mode 100644 index 000000000..e69de29bb diff --git a/draft-3/draft-3/reads.fastq b/draft-3/draft-3/reads.fastq new file mode 100644 index 000000000..e69de29bb diff --git a/draft-3/draft-3/template-tool.cwl b/draft-3/draft-3/template-tool.cwl index 744227868..9af5f0e01 100755 --- a/draft-3/draft-3/template-tool.cwl +++ b/draft-3/draft-3/template-tool.cwl @@ -11,9 +11,14 @@ requirements: - class: CreateFileRequirement fileDef: - filename: foo.txt - fileContent: $(t("The file is <%= inputs.file1.path %>\n")) + fileContent: > + $(t("The file is <%= inputs.file1.path.split('/').slice(-1)[0] %>\n")) inputs: - id: file1 type: File -outputs: [] +outputs: + - id: foo + type: File + outputBinding: + glob: foo.txt baseCommand: [cat, foo.txt] diff --git a/draft-3/draft-3/tmap-tool.cwl b/draft-3/draft-3/tmap-tool.cwl index c25a887d5..514816a9f 100755 --- a/draft-3/draft-3/tmap-tool.cwl +++ b/draft-3/draft-3/tmap-tool.cwl @@ -18,7 +18,18 @@ "type": "array", "items": "#Stage" } + }, + { + id: "#args.py", + type: File, + default: { + class: File, + path: args.py + }, + inputBinding: { + position: -1 } + } ], "outputs": [ { @@ -26,7 +37,7 @@ "outputBinding": { "glob": "output.sam" }, - "type": "File" + "type": ["null", "File"] } ], "requirements": [ @@ -235,7 +246,6 @@ ] } ]}], - "baseCommand": ["tmap", "mapall"], - "stdin": "$(inputs.reads.path)", - "stdout": "output.sam" + "baseCommand": "python", + "arguments": ["tmap", "mapall"] } diff --git a/draft-4/CommandLineTool.yml b/draft-4/CommandLineTool.yml index 81329a840..89f180bf1 100644 --- a/draft-4/CommandLineTool.yml +++ b/draft-4/CommandLineTool.yml @@ -359,14 +359,31 @@ $graph: extends: "#InputParameter" doc: An input parameter for a CommandLineTool. specialize: - - specializeFrom: "#InputRecordSchema" - specializeTo: "#CommandInputRecordSchema" - - specializeFrom: "#InputEnumSchema" - specializeTo: "#CommandInputEnumSchema" - - specializeFrom: "#InputArraySchema" - specializeTo: "#CommandInputArraySchema" - specializeFrom: "#InputBinding" specializeTo: "#CommandLineBinding" + fields: + - name: type + type: + - "null" + - "#CWLType" + - "#CommandInputRecordSchema" + - "#CommandInputEnumSchema" + - "#CommandInputArraySchema" + - string + - type: array + items: + - "#CWLType" + - "#CommandInputRecordSchema" + - "#CommandInputEnumSchema" + - "#CommandInputArraySchema" + - string + jsonldPredicate: + "_id": "sld:type" + "_type": "@vocab" + refScope: 2 + typeDSL: True + doc: | + Specify valid types of data that may be assigned to this parameter. - type: record @@ -374,15 +391,90 @@ $graph: extends: "#OutputParameter" doc: An output parameter for a CommandLineTool. specialize: - - specializeFrom: "#OutputRecordSchema" - specializeTo: "#CommandOutputRecordSchema" - - specializeFrom: "#OutputEnumSchema" - specializeTo: "#CommandOutputEnumSchema" - - specializeFrom: "#OutputArraySchema" - specializeTo: "#CommandOutputArraySchema" - specializeFrom: "#OutputBinding" specializeTo: "#CommandOutputBinding" + fields: + - name: type + type: + - "null" + - "#CWLType" + - "#stdout" + - "#stderr" + - "#CommandOutputRecordSchema" + - "#CommandOutputEnumSchema" + - "#CommandOutputArraySchema" + - string + - type: array + items: + - "#CWLType" + - "#CommandOutputRecordSchema" + - "#CommandOutputEnumSchema" + - "#CommandOutputArraySchema" + - string + jsonldPredicate: + "_id": "sld:type" + "_type": "@vocab" + refScope: 2 + typeDSL: True + doc: | + Specify valid types of data that may be assigned to this parameter. +- name: stdout + type: enum + symbols: [ "cwl:stdout" ] + docParent: "#CommandOutputParameter" + doc: | + Only valid as a `type` for a `CommandLineTool` output with no + `outputBinding` set. + + The following + ``` + outputs: + an_output_name: + type: stdout + + stdout: a_stdout_file + ``` + is equivalent to + ``` + outputs: + an_output_name: + type: File + outputBinding: + glob: a_stdout_file + + stdout: a_stdout_file + ``` + + If there is no `stdout` name provided, a random filename will be created. + + +- name: stderr + type: enum + symbols: [ "cwl:stderr" ] + docParent: "#CommandOutputParameter" + doc: | + Only valid as a `type` for a `CommandLineTool` output with no + `outputBinding` set. + + The following + ``` + outputs: + an_output_name: + type: stderr + + stderr: a_stderr_file + ``` + is equivalent to + ``` + outputs: + an_output_name: + type: File + outputBinding: + glob: a_stderr_file + ``` + + If there is no `stderr` name provided, a random filename will be created. - type: record name: CommandLineTool @@ -434,8 +526,22 @@ $graph: doc: | A path to a file whose contents must be piped into the command's standard input stream. + - name: stderr + type: ["null", string, "#Expression"] + jsonldPredicate: "https://w3id.org/cwl/cwl#stderr" + doc: | + Capture the command's standard error stream to a file written to + the designated output directory. + + If `stderr` is a string, it specifies the file name to use. + + If `stderr` is an expression, the expression is evaluated and must + return a string with the file name to use to capture stderr. If the + return value is not a string, or the resulting path contains illegal + characters (such as the path separator `/`) it is an error. - name: stdout type: ["null", string, "#Expression"] + jsonldPredicate: "https://w3id.org/cwl/cwl#stdout" doc: | Capture the command's standard output stream to a file written to the designated output directory. diff --git a/draft-4/Process.yml b/draft-4/Process.yml index d50eaa289..8be63b935 100644 --- a/draft-4/Process.yml +++ b/draft-4/Process.yml @@ -138,7 +138,6 @@ $graph: # type: ["null", long] # doc: Optional directory size. - - name: SchemaBase type: record abstract: true @@ -209,29 +208,6 @@ $graph: Define an input or output parameter to a process. fields: - - name: type - type: - - "null" - - "#CWLType" - - "sld:RecordSchema" - - "sld:EnumSchema" - - "sld:ArraySchema" - - string - - type: array - items: - - "#CWLType" - - "sld:RecordSchema" - - "sld:EnumSchema" - - "sld:ArraySchema" - - string - jsonldPredicate: - "_id": "sld:type" - "_type": "@vocab" - refScope: 2 - typeDSL: True - doc: | - Specify valid types of data that may be assigned to this parameter. - - name: label type: - "null" diff --git a/draft-4/Workflow.yml b/draft-4/Workflow.yml index 9103eb0dd..5a2413966 100644 --- a/draft-4/Workflow.yml +++ b/draft-4/Workflow.yml @@ -104,6 +104,28 @@ $graph: doc: | The method to use to merge multiple sources into a single array. If not specified, the default method is "merge_nested". + - name: type + type: + - "null" + - "#CWLType" + - "#OutputRecordSchema" + - "#OutputEnumSchema" + - "#OutputArraySchema" + - string + - type: array + items: + - "#CWLType" + - "#OutputRecordSchema" + - "#OutputEnumSchema" + - "#OutputArraySchema" + - string + jsonldPredicate: + "_id": "sld:type" + "_type": "@vocab" + refScope: 2 + typeDSL: True + doc: | + Specify valid types of data that may be assigned to this parameter. - name: Sink diff --git a/draft-4/conformance_test_draft-4.yaml b/draft-4/conformance_test_draft-4.yaml index e0d4043d2..ae839ba0a 100644 --- a/draft-4/conformance_test_draft-4.yaml +++ b/draft-4/conformance_test_draft-4.yaml @@ -1,63 +1,51 @@ -- args: [bwa, mem, -t, '4', -I, '1,2,3,4', -m, '3', draft-4/rabix/tests/test-files/chr20.fa, - draft-4/rabix/tests/test-files/example_human_Illumina.pe_1.fastq, draft-4/rabix/tests/test-files/example_human_Illumina.pe_2.fastq] - job: draft-4/bwa-mem-job.json - stdout: output.sam +- job: draft-4/bwa-mem-job.json tool: draft-4/bwa-mem-tool.cwl + output: + args: [bwa, mem, -t, '4', -I, '1,2,3,4', -m, '3', + chr20.fa, + example_human_Illumina.pe_1.fastq, + example_human_Illumina.pe_2.fastq] doc: General test of command line generation -- args: [bwa, mem, draft-4/rabix/tests/test-files/chr20.fa, - "-XXX", - "-YYY", draft-4/rabix/tests/test-files/example_human_Illumina.pe_1.fastq, - "-YYY", draft-4/rabix/tests/test-files/example_human_Illumina.pe_2.fastq] +- output: + args: [bwa, mem, chr20.fa, + "-XXX", + "-YYY", example_human_Illumina.pe_1.fastq, + "-YYY", example_human_Illumina.pe_2.fastq] job: draft-4/bwa-mem-job.json tool: draft-4/binding-test.cwl doc: Test nested prefixes with arrays -- args: [tmap, mapall, stage1, map1, --min-seq-length, '20', map2, --min-seq-length, +- output: + args: [tmap, mapall, stage1, map1, --min-seq-length, '20', map2, --min-seq-length, '20', stage2, map1, --max-seq-length, '20', --min-seq-length, '10', --seed-length, '16', map2, --max-seed-hits, '-1', --max-seq-length, '20', --min-seq-length, '10'] job: draft-4/tmap-job.json - stdin: draft-4/reads.fastq - stdout: output.sam tool: draft-4/tmap-tool.cwl - doc: Test nested command line bindings and stdin/stdout redirection + doc: Test nested command line bindings -- args: [cat, draft-4/hello.txt] +- output: + args: [cat, hello.txt] job: draft-4/cat-job.json - tool: draft-4/cat1-tool.cwl + tool: draft-4/cat1-testcli.cwl doc: Test command line with optional input (missing) -- args: [cat, -n, draft-4/hello.txt] +- output: + args: [cat, -n, hello.txt] job: draft-4/cat-n-job.json - tool: draft-4/cat1-tool.cwl + tool: draft-4/cat1-testcli.cwl doc: Test command line with optional input (provided) -- args: [cat] - job: draft-4/cat-job.json - stdin: draft-4/hello.txt - tool: draft-4/cat2-tool.cwl - doc: Test command line with stdin redirection - -- args: [cat, draft-4/hello.txt] - job: draft-4/cat-job.json - stdout: output.txt - tool: draft-4/cat3-tool.cwl - doc: Test command line with stdout redirection - -- args: [cat] - job: draft-4/cat-job.json - stdin: draft-4/hello.txt - stdout: output.txt - tool: draft-4/cat4-tool.cwl - doc: Test command line with stdin and stdout redirection - -- args: [cat, foo.txt] - createfiles: {foo.txt: 'The file is draft-4/hello.txt - - '} +- output: + "foo": { + "checksum": "sha1$63da67422622fbf9251a046d7a34b7ea0fd4fead", + "class": "File", + "path": "foo.txt", + "size": 22 + } job: draft-4/cat-job.json tool: draft-4/template-tool.cwl - doc: Test CreateFileRequirement ExpressionEngineRequirement.engineConfig features + doc: Test CreateFileRequirement ExpressionEngineRequirement.engineConfig feature - job: draft-4/cat-job.json output: @@ -69,6 +57,43 @@ tool: draft-4/cat3-tool.cwl doc: Test command execution in Docker with stdout redirection +- job: draft-4/cat-job.json + tool: draft-4/cat3-tool-shortcut.cwl + doc: Test command execution in Docker with stdout redirection + +- job: draft-4/cat-job.json + output: + output_file: + class: File + checksum: sha1$47a013e660d408619d894b20806b1d5086aab03b + path: cat-out + size: 13 + tool: draft-4/cat3-tool-mediumcut.cwl + doc: Test command execution in Docker with stdout redirection + +- args: [egrep] + stderr: error.txt + job: + tool: draft-4/egrep-stderr.cwl + doc: Test command line with stderr redirection + +- args: [egrep] + job: + tool: draft-4/egrep-stderr-shortcut.cwl + doc: Test command line with stderr redirection, brief syntax + +- args: [egrep] + stderr: std.err + output: + output_file: + class: File + size: 84 + checksum: sha1$cec7b8746a78c42060c96505887449bca0142976 + path: std.err + job: + tool: draft-4/egrep-stderr-mediumcut.cwl + doc: Test command line with stderr redirection, named brief syntax + - job: draft-4/cat-job.json output: output_txt: @@ -504,7 +529,7 @@ doc: | Test parameter evaluation, with support for JS expressions -- args: [cat, draft-4/hello.txt] +- output: {} job: draft-4/cat-job.json tool: draft-4/metadata.cwl doc: Test metadata diff --git a/draft-4/draft-4/args.py b/draft-4/draft-4/args.py new file mode 100755 index 000000000..1baf6a090 --- /dev/null +++ b/draft-4/draft-4/args.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python +import sys +import json +import os +args = [os.path.basename(a) for a in sys.argv[1:]] +with open("cwl.output.json", "w") as f: + json.dump({"args": args}, f) diff --git a/draft-4/draft-4/binding-test.cwl b/draft-4/draft-4/binding-test.cwl index 085145df9..7e6c3c826 100755 --- a/draft-4/draft-4/binding-test.cwl +++ b/draft-4/draft-4/binding-test.cwl @@ -4,17 +4,26 @@ class: CommandLineTool cwlVersion: cwl:draft-4.dev2 inputs: - reference: + - id: reference type: File inputBinding: { position: 2 } - reads: + - id: reads type: type: array items: File inputBinding: { prefix: "-YYY" } inputBinding: { position: 3, prefix: "-XXX" } + - id: "#args.py" + type: File + default: + class: File + path: args.py + inputBinding: + position: -1 + outputs: [] -baseCommand: [bwa, mem] +baseCommand: python +arguments: ["bwa", "mem"] diff --git a/draft-4/draft-4/bwa-mem-job.json b/draft-4/draft-4/bwa-mem-job.json index b6b290140..48d7d6cfe 100644 --- a/draft-4/draft-4/bwa-mem-job.json +++ b/draft-4/draft-4/bwa-mem-job.json @@ -1,18 +1,18 @@ { "reference": { "class": "File", - "path": "rabix/tests/test-files/chr20.fa", + "path": "chr20.fa", "size": 123, "checksum": "sha1$hash" }, "reads": [ { "class": "File", - "path": "rabix/tests/test-files/example_human_Illumina.pe_1.fastq" + "path": "example_human_Illumina.pe_1.fastq" }, { "class": "File", - "path": "rabix/tests/test-files/example_human_Illumina.pe_2.fastq" + "path": "example_human_Illumina.pe_2.fastq" } ], "min_std_max_min": [ diff --git a/draft-4/draft-4/bwa-mem-tool.cwl b/draft-4/draft-4/bwa-mem-tool.cwl index 830d071c8..b0722effa 100755 --- a/draft-4/draft-4/bwa-mem-tool.cwl +++ b/draft-4/draft-4/bwa-mem-tool.cwl @@ -1,47 +1,57 @@ #!/usr/bin/env cwl-runner -cwlVersion: cwl:draft-4.dev2 +cwlVersion: draft-4.dev2 class: CommandLineTool hints: - DockerRequirement: - dockerPull: images.sbgenomics.com/rabix/bwa - dockerImageId: 9d3b9b0359cf - - ResourceRequirement: + - class: ResourceRequirement coresMin: 4 inputs: - reference: + - id: reference type: File inputBinding: { position: 2 } - reads: + - id: reads type: type: array items: File inputBinding: { position: 3 } - minimum_seed_length: + - id: minimum_seed_length type: int inputBinding: { position: 1, prefix: -m } - min_std_max_min: + - id: min_std_max_min type: { type: array, items: int } inputBinding: position: 1 prefix: -I itemSeparator: "," -outputs: - sam: + - id: args.py type: File + default: + class: File + path: args.py + inputBinding: + position: -1 + +outputs: + - id: sam + type: ["null", File] outputBinding: { glob: output.sam } + - id: args + type: + type: array + items: string -baseCommand: [bwa, mem] +baseCommand: python arguments: + - bwa + - mem - valueFrom: $(runtime.cores) position: 1 prefix: -t diff --git a/draft-4/draft-4/cat1-testcli.cwl b/draft-4/draft-4/cat1-testcli.cwl new file mode 100755 index 000000000..3bad2b662 --- /dev/null +++ b/draft-4/draft-4/cat1-testcli.cwl @@ -0,0 +1,35 @@ +#!/usr/bin/env cwl-runner +{ + "class": "CommandLineTool", + "cwlVersion": "cwl:draft-4.dev2", + "description": "Print the contents of a file to stdout using 'cat' running in a docker container.", + "inputs": [ + { + "id": "file1", + "type": "File", + "inputBinding": {"position": 1} + }, + { + "id": "numbering", + "type": ["null", "boolean"], + "inputBinding": { + "position": 0, + "prefix": "-n" + } + }, + { + id: "args.py", + type: File, + default: { + class: File, + path: args.py + }, + inputBinding: { + position: -1 + } + } + ], + "outputs": [], + "baseCommand": "python", + "arguments": ["cat"] +} diff --git a/draft-4/draft-4/cat3-tool-mediumcut.cwl b/draft-4/draft-4/cat3-tool-mediumcut.cwl new file mode 100755 index 000000000..1c29102eb --- /dev/null +++ b/draft-4/draft-4/cat3-tool-mediumcut.cwl @@ -0,0 +1,18 @@ +#!/usr/bin/env cwl-runner +class: CommandLineTool +cwlVersion: cwl:draft-4.dev2 +description: "Print the contents of a file to stdout using 'cat' running in a docker container." +hints: + DockerRequirement: + dockerPull: debian:wheezy +inputs: + file1: + type: File + label: Input File + description: "The file that will be copied using 'cat'" + inputBinding: {position: 1} +outputs: + output_file: + type: stdout +baseCommand: cat +stdout: cat-out diff --git a/draft-4/draft-4/cat3-tool-shortcut.cwl b/draft-4/draft-4/cat3-tool-shortcut.cwl new file mode 100755 index 000000000..4d12a4df4 --- /dev/null +++ b/draft-4/draft-4/cat3-tool-shortcut.cwl @@ -0,0 +1,17 @@ +#!/usr/bin/env cwl-runner +class: CommandLineTool +cwlVersion: cwl:draft-4.dev2 +description: "Print the contents of a file to stdout using 'cat' running in a docker container." +hints: + DockerRequirement: + dockerPull: debian:wheezy +inputs: + file1: + type: File + label: Input File + description: "The file that will be copied using 'cat'" + inputBinding: {position: 1} +outputs: + output_file: + type: stdout +baseCommand: cat diff --git a/draft-4/draft-4/chr20.fa b/draft-4/draft-4/chr20.fa new file mode 100644 index 000000000..e69de29bb diff --git a/draft-4/draft-4/egrep-stderr-mediumcut.cwl b/draft-4/draft-4/egrep-stderr-mediumcut.cwl new file mode 100644 index 000000000..f780c7319 --- /dev/null +++ b/draft-4/draft-4/egrep-stderr-mediumcut.cwl @@ -0,0 +1,18 @@ +#!/usr/bin/env cwl-runner +class: CommandLineTool +cwlVersion: cwl:draft-4.dev2 +description: "Test of capturing stderr output in a docker container." +hints: + DockerRequirement: + dockerPull: debian:wheezy + +inputs: [] + +outputs: + output_file: + type: stderr + +baseCommand: egrep +successCodes: [2] + +stderr: std.err diff --git a/draft-4/draft-4/egrep-stderr-shortcut.cwl b/draft-4/draft-4/egrep-stderr-shortcut.cwl new file mode 100644 index 000000000..9a70aa1d5 --- /dev/null +++ b/draft-4/draft-4/egrep-stderr-shortcut.cwl @@ -0,0 +1,16 @@ +#!/usr/bin/env cwl-runner +class: CommandLineTool +cwlVersion: cwl:draft-4.dev2 +description: "Test of capturing stderr output in a docker container." +hints: + DockerRequirement: + dockerPull: debian:wheezy + +inputs: [] + +outputs: + output_file: + type: stderr + +baseCommand: egrep +successCodes: [2] diff --git a/draft-4/draft-4/egrep-stderr.cwl b/draft-4/draft-4/egrep-stderr.cwl new file mode 100644 index 000000000..4bba74962 --- /dev/null +++ b/draft-4/draft-4/egrep-stderr.cwl @@ -0,0 +1,15 @@ +#!/usr/bin/env cwl-runner +class: CommandLineTool +cwlVersion: cwl:draft-4.dev2 +description: "Test of capturing stderr output in a docker container." +hints: + DockerRequirement: + dockerPull: debian:wheezy +inputs: [] +outputs: + output_file: + type: File + outputBinding: {glob: error.txt} +baseCommand: egrep +successCodes: [2] +stderr: error.txt diff --git a/draft-4/draft-4/example_human_Illumina.pe_1.fastq b/draft-4/draft-4/example_human_Illumina.pe_1.fastq new file mode 100644 index 000000000..e69de29bb diff --git a/draft-4/draft-4/example_human_Illumina.pe_2.fastq b/draft-4/draft-4/example_human_Illumina.pe_2.fastq new file mode 100644 index 000000000..e69de29bb diff --git a/draft-4/draft-4/reads.fastq b/draft-4/draft-4/reads.fastq new file mode 100644 index 000000000..e69de29bb diff --git a/draft-4/draft-4/template-tool.cwl b/draft-4/draft-4/template-tool.cwl index ac4014e54..7e3521382 100755 --- a/draft-4/draft-4/template-tool.cwl +++ b/draft-4/draft-4/template-tool.cwl @@ -11,9 +11,14 @@ requirements: - class: CreateFileRequirement fileDef: - filename: foo.txt - fileContent: $(t("The file is <%= inputs.file1.path %>\n")) + fileContent: > + $(t("The file is <%= inputs.file1.path.split('/').slice(-1)[0] %>\n")) inputs: - id: file1 type: File -outputs: [] +outputs: + - id: foo + type: File + outputBinding: + glob: foo.txt baseCommand: [cat, foo.txt] diff --git a/draft-4/draft-4/tmap-tool.cwl b/draft-4/draft-4/tmap-tool.cwl index f33b01f5c..8f8aca16a 100755 --- a/draft-4/draft-4/tmap-tool.cwl +++ b/draft-4/draft-4/tmap-tool.cwl @@ -18,7 +18,18 @@ "type": "array", "items": "#Stage" } + }, + { + id: "#args.py", + type: File, + default: { + class: File, + path: args.py + }, + inputBinding: { + position: -1 } + } ], "outputs": [ { @@ -26,7 +37,7 @@ "outputBinding": { "glob": "output.sam" }, - "type": "File" + "type": ["null", "File"] } ], "requirements": [ @@ -235,7 +246,6 @@ ] } ]}], - "baseCommand": ["tmap", "mapall"], - "stdin": "$(inputs.reads.path)", - "stdout": "output.sam" + "baseCommand": "python", + "arguments": ["tmap", "mapall"] } diff --git a/site/draft4-deps.json b/site/draft4-deps.json index 72477ac88..157ccb1ec 100644 --- a/site/draft4-deps.json +++ b/site/draft4-deps.json @@ -11,6 +11,10 @@ "path": "../draft-4/salad/schema_salad/metaschema/metaschema.yml", "class": "File" }, + { + "path": "../draft-4/salad/schema_salad/metaschema/metaschema_base.yml", + "class": "File" + }, { "path": "../draft-4/salad/schema_salad/metaschema/salad.md", "class": "File"