common-workflow-language / cwltool

Common Workflow Language reference implementation
https://cwltool.readthedocs.io/
Apache License 2.0
324 stars 225 forks source link

Auto-casting single item to array fails #171

Open briandoconnor opened 7 years ago

briandoconnor commented 7 years ago

Input

  inputFileName_markDups:
    type: File[]?
    inputBinding:
      position: 4
      prefix: INPUT=

The call uses a single BAM file from a previous step, not an array.

Causes the following error:

Workflow error, try again with --debug for more information:
  Type mismatch between source 'file:///home/ubuntu/gitroot/common-workflow-language/workflows/workflows/GATK/GATK-complete-Workflow-h3abionet.cwl#samtools-sort/sorted' (File) and sink 'file:///home/ubuntu/gitroot/common-workflow-language/workflows/workflows/GATK/GATK-complete-Workflow-h3abionet.cwl#MarkDuplicates/inputFileName_markDups' ([u'null', {u'items': 'File', u'type': u'array'}])

But it works fine when markdup's input is:

  inputFileName_markDups:
    type: File[]
    inputBinding:
      position: 4
      prefix: INPUT=
briandoconnor commented 7 years ago
cwltool 1.0.20160811184335
briandoconnor commented 7 years ago

Actually, I'm wrong, this fails even after the "fix" above:

  Type mismatch between source 'file:///home/ubuntu/gitroot/common-workflow-language/workflows/workflows/GATK/GATK-complete-Workflow-h3abionet.cwl#samtools-sort/sorted' (File) and sink 'file:///home/ubuntu/gitroot/common-workflow-language/workflows/workflows/GATK/GATK-complete-Workflow-h3abionet.cwl#MarkDuplicates/inputFileName_markDups' ({u'items': 'File', u'type': u'array'})

Is that the correct behaviour?

mr-c commented 7 years ago

This might not be a current CWL feature after all

briandoconnor commented 7 years ago

Workaround with javascript:

      inputFileName_markDups:
        source: samtools-sort/sorted
        valueFrom: ${return [ self ];}
tetron commented 7 years ago

Try this:

     inputFileName_markDups: [samtools-sort/sorted]