This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Strict validation for input and inputBinding values with same position?

Hi,

Is it valid in the CWL language to have two input parameters with the same inputBinding position? I thought that would raise an error (tried with --strict --verbose) but it actually appended the values of hello message and file.

#!/usr/bin/env cwl-runner

cwlVersion: v1.0
class: CommandLineTool
baseCommand: echo
inputs:
  message:
    type: string
    inputBinding:
      position: 1
  file:
    type: string
    inputBinding:
      position: 1
outputs: []

In the example above, with the reference cwlrunner, everything runs fine:

$ cwl-runner --strict --verbose 1st-tool.cwl echo-job.yml 
INFO /home/kinow/Development/python/workspace/cwl/venv/bin/cwl-runner 1.0.20190621234233
INFO Resolved '1st-tool.cwl' to 'file:///home/kinow/Development/python/workspace/cwl/1st-tool.cwl'
INFO [job 1st-tool.cwl] /tmp/wn7i3zwz$ echo \
    'Say what?' \
    'Hello world!'
Say what? Hello world!
INFO Could not collect memory usage, job ended before monitoring began.
INFO [job 1st-tool.cwl] completed success
{}
INFO Final process status is success

Content of echo-job.yml:

message: Hello world!
file: Say what?

Thanks Bruno

cwl validation

1 answer

The CWL specification has a section on how cwl-runners have to handle this situation: https://www.commonwl.org/v1.1/CommandLineTool.html#Input_binding

I'm not sure i understand correctly, but i think the runner can either use the order of the items in the document (message > file in your case) or their names. Whatever it might be, i would recommend not relying on your tool to produce the same output when using different runners.

Log in to answer this question.