How to set exclusive parameters within a worklfow
1
0
Entering edit mode
7.7 years ago
awilke1972 ▴ 20

How to set exclusive parameters within a worklfow?

Following the example for command line tools the job document looks like:

myDir:
  class: Directory
  path: /pipeline/CWL/Data/Inputs
myFile:
  class: File
  path: /pipeline/CWL/Tools/ls.tool.yaml  
exclusive_parameters:
  sortBySize: true

where sortBySize is the parameter within the workflow and bysize the exclusive parameter for the tool.
Workflow:

cwlVersion: v1.0
class: Workflow

inputs:
 myFile: File
 myDir: Directory
 sortBySize: 
   type: boolean?
   default: true

outputs:
  summary:
    type: File
    outputSource: getSummary/output

steps:
  getSummary:
    run: ../Tools/ls.tool.yaml
    in:
      myfile: myFile
      mydir: myDir
      exclusive_parameters:
        bysize: sortBySize

    out: [output,error]

Tool:

cwlVersion: v1.0
class: CommandLineTool
baseCommand: [ls , .]

stdout: ls.log
stderr: error.log

inputs:
  mydir:
    type: Directory
  myfile:
    type: File
  exclusive_parameters:
    type:
      - type: record
        name: listingByTime
        fields:
          longlisting:
            type: boolean
            inputBinding:
              prefix: -ltr
      - type: record
        name: size
        fields:
          bysize:
            type: boolean
            inputBinding:
              prefix: -S  

outputs:
  output:
    type: stdout
  error: 
    type: stderr
cwl • 1.4k views
ADD COMMENT
0
Entering edit mode
7.7 years ago

Hello awilke1972,

Here is how to wrap a simple value into a record before passing it into another CWL CommandLineTool or Workflow.

cwlVersion: v1.0
class: Workflow

requirements:
 StepInputExpressionRequirement: {}
 InlineJavascriptRequirement: {}

inputs:
 myFile: File
 myDir: Directory
 sortBySize: 
   type: boolean?
   default: true

outputs:
  summary:
    type: File
    outputSource: getSummary/output

steps:
  getSummary:
    run: ls.tool.cwl
    in:
      myfile: myFile
      mydir: myDir
      exclusive_parameters:
        source: sortBySize
        valueFrom: |
          ${ return { "bysize": self }; }

    out: [output,error]
ADD COMMENT

Login before adding your answer.

Traffic: 1535 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