Question: How to step dependency in a step based on the output from 2 previous steps in CWL workflow
0
gravatar for a.james
4 months ago by
a.james210
Germany
a.james210 wrote:

Hello All,

I have a CWL workflow with 7 steps. And fourth step takes input from 2nd and 3rd step. How would I specify this dependency in CWL.

For example the workflow looks like following,

        #!/usr/bin/env cwl-runner
        cwlVersion: v1.0
        class: Workflow
        inputs:
    -------------
    ---------

outputs:
 alignment_out:
  type: File
  outputSource: star/star_bam
 expression_out:
  type: File
  outputSource: expressioncount/expression_out
 libsize:
  type: File
  outputSource: libsize_calculator/libsize
 Hypoxiaresult:
  type: Directory
  outputSource: hypoxia_calculator/Hypoxiaresult
 outFile:
   type: File[]
   outputSource: mdsum_generator/outFile
 results_move:
  type: Directory
  outputSource: results_mover/results_move

steps:
  star:
    run: star.cwl
    in:
     ........
    ...........
    out: [star_bam]
  expressioncount:
   run: count_expression.cwl
   in:
    ....................
    bam: star/star_bam
    exp_out: exp_out
   out: [expression_out]
  libsize_calculator:
   run: libsize_calculator.cwl
   in:
    samples: expressioncount/expression_out
    outputfile: outputfile
   out: [libsize]
  score_calculator:
   run:score.cwl
   in:
    **sample_input: **
    outputdir: outputdir
    ..............................
   out: [result]

Here in the above example *sample_input: * needs files from both libsize_calculator: and expressioncount: steps, in this case how can I specify it. Also the outputdir is directory, where I need the scores to written to.

The score.cwl looks like this:

cwlVersion: v1.0
class: CommandLineTool

requirements:
 InlineJavascriptRequirement: {}

baseCommand: [Rscript, scorefinder.R]

inputs:
 sample_input:
  type: File
  inputBinding:
   position: 1
 outputdir:
  type: string
  inputBinding:
   position: 2
 cancertype:
  type: string?
  inputBinding:
   position: 3
 sample_id:
  type: string?
  inputBinding:
   position: 4

outputs:
 Hypoxiaresult:
  type: Directory
  outputBinding:
   glob: $(runtime.outdir)

So this is what I tried:

   score_calculator:
       run: score.cwl
       in:
        sample_input: [expressioncount/expression_out, libsize_calculator/libsize]
        outputdir: outputdir

which is throwing error as:

Source
                                                                                                          'expression_out' of
                                                                                                          type "File" is
                                                                                                          incompatible
pipeline_part1.cwl:146:5:    with sink
                                                                                                            'sample_input' of
                                                                                                            type "File"
                                                                                                            source has
                                                                                                            linkMerge method
                                                                                                            merge_nested
pipeline_part1.cwl:142:10: Source 'libsize' of
                                                                                                          type "File" is
                                                                                                          incompatible
pipeline_part1.cwl:146:5:    with sink
                                                                                                            'sample_input' of
                                                                                                            type "File"
                                                                                                            source has
                                                                                                            linkMerge method
                                                                                                            merge_nested
cw • 147 views
ADD COMMENTlink modified 4 months ago • written 4 months ago by a.james210
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: 989 users visited in the last hour