Question: Exclusive parameters in a workflow
0
gravatar for pete.hague
2.7 years ago by
pete.hague0
pete.hague0 wrote:

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 • 488 views
ADD COMMENTlink modified 2.7 years ago • written 2.7 years ago by pete.hague0

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 REPLYlink written 2.7 years ago by pete.hague0

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

This comment belongs under the answer below.

ADD REPLYlink written 2.7 years ago by GenoMax94k
1
gravatar for Peter vH
2.7 years ago by
Peter vH130
Peter vH130 wrote:

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 COMMENTlink written 2.7 years ago by Peter vH130

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

ADD REPLYlink written 2.7 years ago by GenoMax94k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2734 users visited in the last hour
_