Question: CWL: array of files as an input
0
gravatar for djarecka
8 months ago by
djarecka0
djarecka0 wrote:

I'm trying to create a workflow wit scatter that takes also files and I'm not sure what should be the syntax for my input.yml file. This is my main cwl file:

#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: Workflow
requirements:
   - class: ScatterFeatureRequirement
inputs:
  file_orig: File
  script_mv: File
  script_edit:
    type:
      type: array
      items: File
outputs:
  file_changed:
    type:
      type: array
      items: File
    outputSource: edit/output_files

steps:
  move:
    run: cwl_move.cwl
    in:
      script: script_mv
      input_file: file_orig
    out: [output_files_mv]
  edit:
    run: cwl_edit.cwl
    scatter: [input_file, script]
    scatterMethod: dotproduct
    in:
      script: script_edit
      input_file: move/output_files_mv
    out: [output_files]

So the first field from scatter, input_file, is taken from previous step move, but the second field, script, I'd like to provide as an input to the workflow. I already changed my cwl file, so script_edit is an array, but I don't know what should be the syntax of input.yml (I only found a simple example with input that does not require additional filed like class or path). This is my current input.yml file with rather random syntax for script_edit array:

script_mv:
  class: File
  path: /path/mv.py
script_edit:[
  {class: File,
  path: /path/edit_0.py},
  {class: File,
  path: /path/edit_1.py}]
file_orig:
  class: File
  path: /path/myfile.txt
cwl • 723 views
ADD COMMENTlink modified 7 months ago by ionox0240 • written 8 months ago by djarecka0
2
gravatar for ionox0
7 months ago by
ionox0240
ionox0240 wrote:

I generally do arrays of files like this:

fastq:
- {class: File, path: sample1_R1_001.fastq.gz}
- {class: File, path: sample2_R1_001.fastq.gz}

But your way may also work, I would format it like:

script_edit: [
  {class: File, path: /path/edit_0.py},
  {class: File, path: /path/edit_1.py}
]

I think the space after script_edit: is necessary

ADD COMMENTlink modified 7 months ago • written 7 months ago by ionox0240
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: 1344 users visited in the last hour