hard copies instead of symlinks from InitialWorkDirRequirement ? - SOLVED
0
0
Entering edit mode
7.4 years ago

NOTE: The below was due to using an older version of cwl-runner.

I am trying to debug https://github.com/Sage-Bionetworks/SMC-RNA-Examples/blob/master/workflow/smcFusionQuant-INTEGRATE-workflow.cwl One of the issues is that I can't figure out how to get the input and output of a tool in the same location so that I can pass them to the next step in the workflow.

Details: As part of this workflow, I am trying to run samtools index on bam files created earlier in the pipeline.

requirements:
  - class: InlineJavascriptRequirement
  - class: InitialWorkDirRequirement
    listing:
      - $(inputs.bam)

What this creates though is a symlink to the local docker container:

lrwxrwxrwx  1 ubuntu ubuntu   65 Dec  6 09:55 unmapped.bam -> /var/lib/cwl/stg80eb5f7c-d51f-4ca0-898d-175a1c487761/unmapped.bam
-rw-r--r--  1 ubuntu root    216 Dec  6 09:55 unmapped.bam.bai

The next program in the workflow looks for a bam file and assumes a bam.bai file. And of course the link is now broken, so the workflow crashes with

  Missing input file [Errno 2] No such file or directory: '/mnt/integrate/tempdir7Np3TT/unmapped.bam

How do I create a workflow so that the bam and the bam.bai file end up in the same spot?

cwl • 2.0k views
ADD COMMENT
0
Entering edit mode

How did you solve this problem?

ADD REPLY
0
Entering edit mode

I was using an older version of cwl. Once I upgraded, the problem went away.

One thing I couldn't figure out for a while is how to call initialWorkDir properly. Here's the relevant piece of cwl:

requirements:
  - class: InlineJavascriptRequirement
  - class: InitialWorkDirRequirement
    listing:
      - $(inputs.src)

inputs:
  src:
    type: File
    inputBinding:
      position: 1
      valueFrom: $(self.basename)

Note the $(self.basename) For some reason this is necessary to make the requirements section understand which file to stage.

ADD REPLY

Login before adding your answer.

Traffic: 2491 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6