Exclusive parameters in a workflow
3
0
Entering edit mode
5.9 years ago
pete.hague • 0

I've implemented a CommandLineTool that has exclusive parameters

inputs: 
  touchparam:
    type:
      - type: record
        name: touchcode
        fields: 
          touchcode:
            type: string 
            inputBinding:
              position: 1
      - type: record
        name: touchfile
        fields:
          touchfile:
            type: File
            inputBinding:
              prefix: -f

but I can't quite get the syntax to bind the inputs from a workflow:

steps:
  generate:
    run: Generate.cwl
    in: []
    out: [rannum]

  touch:
    run: Touch.cwl
    in: 
      touchparam:
        touchfile: generate/rannum
    out: [results]

This was just a guess based on how you bind them from a yml file. Any help?

cwl • 1.1k views
ADD COMMENT
0
Entering edit mode

Thanks for the answer

It looks like the workflow you've implemented there takes the exclusive parameter as an input to itself, which is not what I am intending.

The second step is the one with the exclusive parameter, although it always takes the same one from the previous step. The full workflow and tool files are here:

https://github.com/petehague/Stoa/blob/master/actions/workflow1.cwl https://github.com/petehague/Stoa/blob/master/actions/Generate.cwl https://github.com/petehague/Stoa/blob/master/actions/Touch.cwl

For this test case, the workflow itself should not take any inputs.

ADD REPLY
0
Entering edit mode

Please use ADD COMMENT/ADD REPLY when responding to existing posts to keep threads logically organized.

This comment belongs under the answer below.

ADD REPLY
1
Entering edit mode
5.9 years ago
Peter vH ▴ 130

I implemented a solution based on my reading of what you have done:

First, the tool:

cwlVersion: v1.0
class: CommandLineTool

inputs: 
  touchparam:
    type:
      - type: record
        name: touchcode
        fields: 
          touchcode:
            type: string 
            inputBinding:
              position: 1
      - type: record
        name: touchfile
        fields:
          touchfile:
            type: File
            inputBinding:
              prefix: -f

stdout: my_output.txt

outputs:
  out:
    type: stdout

baseCommand: echo

with a workflow:

cwlVersion: v1.0
class: Workflow
inputs:
  touchit:
   type:
    - type: record
      name: touchcode
      fields:
        touchcode: 
          type: string
    - type: record
      name: touchfile
      fields:
        touchfile:
          type: File

outputs:
  out:
   type: File
   outputSource: step1/out

steps:
  step1:
    run: tool/tool.cwl
    in:
      touchparam: touchit
    out: [out]

and then two input files, first a string input:

touchparam:
  touchcode: "foo"

and then a file input:

touchit:
  touchfile:
    class: File
    path: my_output.txt

I hope this helps!

ADD COMMENT
0
Entering edit mode

Peter vH : If the two answers below are duplicates then please delete them.

ADD REPLY

Login before adding your answer.

Traffic: 2021 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6