Question: How to set exclusive parameters within a worklfow
0
gravatar for awilke1972
23 months ago by
awilke197220
awilke197220 wrote:

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 • 699 views
ADD COMMENTlink modified 23 months ago by Michael R. Crusoe1.2k • written 23 months ago by awilke197220
0
gravatar for Michael R. Crusoe
23 months ago by
currently based out of Vilnius, Lithuania / Common Workflow Language project
Michael R. Crusoe1.2k wrote:

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 COMMENTlink written 23 months ago by Michael R. Crusoe1.2k
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: 1625 users visited in the last hour