question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

failure running cwl workflow referencing external file

See original GitHub issue

This is the stacktrace:

Traceback (most recent call last):
  File "/home/thomas.e/.local/lib/python2.7/site-packages/toil/worker.py", line 340, in main
    job._runner(jobGraph=jobGraph, jobStore=jobStore, fileStore=fileStore)
  File "/home/thomas.e/.local/lib/python2.7/site-packages/toil/job.py", line 1289, in _runner
    returnValues = self._run(jobGraph, fileStore)
  File "/home/thomas.e/.local/lib/python2.7/site-packages/toil/job.py", line 1234, in _run
    return self.run(fileStore)
  File "/home/thomas.e/.local/lib/python2.7/site-packages/toil/cwl/cwltoil.py", line 301, in run
    existing=existing))
  File "/home/thomas.e/.local/lib/python2.7/site-packages/cwltool/process.py", line 183, in adjustFilesWithSecondary
    adjustFilesWithSecondary(rec[d], op)
  File "/home/thomas.e/.local/lib/python2.7/site-packages/cwltool/process.py", line 183, in adjustFilesWithSecondary
    adjustFilesWithSecondary(rec[d], op)
  File "/home/thomas.e/.local/lib/python2.7/site-packages/cwltool/process.py", line 177, in adjustFilesWithSecondary
    rec["path"] = op(rec["path"], primary=primary)
  File "/home/thomas.e/.local/lib/python2.7/site-packages/toil/cwl/cwltoil.py", line 146, in getFile
    fileStoreID, fileName = fileTuple
ValueError: too many values to unpack

This is the failing workflow step:

 trim:
    run: tools/trimmomatic.cwl

    in:
      reads1:
        source: read1
        valueFrom: >
          ${
              self.format = "http://edamontology.org/format_1930";
              return self;
          }
      reads2:
        source: read2
        valueFrom: >
          ${
              self.format = "http://edamontology.org/format_1930";
              return self;
          }
      end_mode:
        default: PE
      nthreads:
        valueFrom: ${ return 2; }
      illuminaClip:
        default:
          adapters:
            class: File
            location: "/stornext/System/data/apps/trimmomatic/trimmomatic-0.36/adapters/TruSeq3-PE.fa"
            path: "/stornext/System/data/apps/trimmomatic/trimmomatic-0.36/adapters/TruSeq3-PE.fa"
          seedMismatches: 1
          palindromeClipThreshold: 20
          simpleClipThreshold: 20
          minAdapterLength: 4
          keepBothReads: "true"

    out: [output_log, reads1_trimmed, reads1_trimmed_unpaired, reads2_trimmed_paired, reads2_trimmed_unpaired]

Using print statements I know it is failing on the adapters file - there is no fileStoreId for this file because it is not in the filestore.

The workflow works with the CWL reference implementation.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
evan-wehicommented, Aug 21, 2017

@mr-c That is a far simpler solution and possibly even consistent with my slowly developing understanding of how CWL works. It also works with both the reference implementation and toil.

Thanks!

0reactions
mr-ccommented, Aug 18, 2017

@evan-wehi I am truly sorry to hear that you’ve had such a frustrating time with CWL, the CWL reference implementation, and Toil.

The only difference in your JS is adapters": inputs.adapters, vs "adapters": inputs.illumima_adapters,, this suggests that there were other differences in your workflows.

I forget, did we try putting the JS expression in the valueFrom field? That works for me locally, I think this would be the equivalent code for you:

 trim:
    run: tools/trimmomatic.cwl

    in:
      reads1:
        source: read1
        valueFrom: >
          ${
              self.format = "http://edamontology.org/format_1930";
              return self;
          }
      reads2:
        source: read2
        valueFrom: >
          ${
              self.format = "http://edamontology.org/format_1930";
              return self;
          }
      end_mode:
        default: PE
      nthreads:
        valueFrom: ${ return 2; }
      illuminaClip:
        source: adaptersx
        valueFrom: |
          ${ return {
               "adapters": self,
               "seedMismatches": 1,
               "palindromeClipThreshold": 20,
               "simpleClipThreshold": 20,
               "minAdapterLength": 4,
               "keepBothReads": true };
           }

    out: [output_log, reads1_trimmed, reads1_trimmed_unpaired, reads2_trimmed_paired, reads2_trimmed_unpaired]

You’ll need to make sure the Workflow level requirements has something like this

requirements:
  SchemaDefRequirement:
    types:
      - $import: trimmomatic-illumina_clipping.yaml 
Read more comments on GitHub >

github_iconTop Results From Across the Web

Common Workflow Language User Guide
This guide will introduce you to writing workflows using the Common Workflow Language (CWL) open standards. This guide describes the latest specification v1.2...
Read more >
Common Workflow Language (CWL) Command Line Tool ...
Shortcuts for specifying the standard output and/or error streams as a (streamable) File output. SoftwareRequirement for describing software dependencies of ...
Read more >
Common Workflow Language User Guide 0.1 documentation
The CWL document echo-uppercase.cwl defines a workflow that runs the command-line tool, and the expression tool showed in the earlier examples. echo ...
Read more >
Common Workflow Language (CWL) Workflow Description, v1.2
When using loadContents it now must fail when attempting to load a file greater than 64 KiB instead of silently truncating the data....
Read more >
Common Workflow Language (CWL) Workflow Description, v1 ...
A document is a file containing a serialized object, or an array of objects. ... it is a fatal error and the implementation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found