Question: CWL: Is there a way to only pass certain fields from a `record` type to a step?
1
gravatar for ionox0
4 months ago by
ionox0120
ionox0120 wrote:

Is there a way to only pass certain fields from a record type to a step? As opposed to the whole record object?

This is my best guess, but I was wondering if there was a cleaner way:

inputs:
  samples:
    type:
      type: array
      items:
        type: record
        fields:
          fastq1: File
          fastq2: File
          SM: string

steps:
  step_1: 
    in:
      samples: samples
    out: [bams]

  step_2:
    in:
      bams: step_1/bams
      SM: 
        valueFrom: ${ return inputs.samples.map(function(x) { return x.SM }) }
    out: [changed_bams]
cwl • 171 views
ADD COMMENTlink modified 3 months ago by Michael R. Crusoe1.0k • written 4 months ago by ionox0120

Is this because you are sharing that record among many steps in a workflow, like this use case?

ADD REPLYlink written 3 months ago by kaushik.ghose30

Yes exactly, for the purpose of not having to list all the fields from the record type at each subworkflow layer of inputs

ADD REPLYlink written 12 weeks ago by ionox0120
2
gravatar for Michael R. Crusoe
3 months ago by
currently based out of Vilnius, Lithuania / Common Workflow Language project
Michael R. Crusoe1.0k wrote:

You almost have it:

steps:
  step_2:
    in:
      SM:
        source: samples
        valueFrom: ${ return self.map(function(x) { return x.SM })
ADD COMMENTlink written 3 months ago by Michael R. Crusoe1.0k
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: 751 users visited in the last hour