Question: Possible to combine inputs using valueFrom for scatter
1
gravatar for ionox0
2.3 years ago by
ionox0360
ionox0360 wrote:

Is it possible to combine multiple inputs from another step using valueFrom so that they can be scattered over?

For example something like:

inputs:

  input_one: Directory
  input_two: Directory

steps: 

  a_step:
    run: ../../cwl_tools/noise/calculate_noise.cwl
    in:
      input_thing:
        valueFrom: |
          ${
            return [
              inputs.input_one,
              inputs.input_two
            ]
          }

    out: [output_thing]
    scatter: input_thing

I get this error:

[workflow workflow.cwl] starting step a_step
Unhandled exception
Traceback (most recent call last):
  File "/home/johnsoni/virtualenvs/pipeline_test/lib/python2.7/site-packages/cwltool-1.0.20180306140409-py2.7.egg/cwltool/workflow.py", line 401, in try_make_job
    emptyscatter = [shortname(s) for s in scatter if len(inputobj[s]) == 0]
TypeError: object of type 'NoneType' has no len()
cwl • 639 views
ADD COMMENTlink modified 2.2 years ago by Michael R. Crusoe1.8k • written 2.3 years ago by ionox0360
0
gravatar for Michael R. Crusoe
2.2 years ago by
Common Workflow Language project
Michael R. Crusoe1.8k wrote:

Hello ionox0,

Yes, this is possible. Just wire up the other inputs to non-existent names and reference them from your expression

inputs:

  input_one: Directory
  input_two: Directory

steps: 

  a_step:
    run: ../../cwl_tools/noise/calculate_noise.cwl
    in:
      fake_input_two: input_two
      input_thing:
        source: input_one
        valueFrom: |
          ${
            return [
              self,
              inputs.fake_input_two
            ]
          }

    out: [output_thing]
    scatter: input_thing

Though, in your case this can be accomplished using linkMerge: merge_flattened

requirements:
  MultipleInputFeatureRequirement: {}

inputs:

  input_one: Directory
  input_two: Directory

steps: 

  a_step:
    run: ../../cwl_tools/noise/calculate_noise.cwl
    in:
      input_thing:
        source: input_one, input_two
        linkMerge: merge_flattened

    out: [output_thing]
    scatter: input_thing
ADD COMMENTlink written 2.2 years ago by Michael R. Crusoe1.8k
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: 2133 users visited in the last hour