CWL: Gathering outputs in folders.
1
0
Entering edit mode
7.0 years ago

Hi, this is a cwl syntax question. I have a simple python script that creates two files:

with open("A.txt", "w") as f:  
    f.write("lpha")

with open("x/x/B.txt", "w") as f:  
    f.write("eta")

And I want to run this with cwl.

The first file creation runs and works fine, because it deposits the file in the working directory. The second does not work because the folders "x/x" seem to not be recreated in the temporary folder that cwl uses. I've tried to specify these folders as inputs (which I think is correct?) with the following attempt:

cwlVersion: v1.0
class: CommandLineTool
baseCommand: python

inputs:
  - id: xdir
    type: Directory

  - id: src
    type: File
    inputBinding:
      position: 1

outputs:
  - id: A
    type: File
    outputBinding:
      glob: "A.txt"

Here is the .yml:

src:
  class: File
  path: makefile.py

xdir:
  class: Directory
  path: x/x

How should I write these so that this will run? Thanks!

cwl • 2.4k views
ADD COMMENT
0
Entering edit mode
7.0 years ago

Hello lon.lightly,

The best thing would be to modify the script so that the user can specify the location (if not the filename) of "B.txt".

One workaround involves the InitialWorkDirRequirement but in testing it using nested directories I found a bug in the reference CWL runner: https://github.com/common-workflow-language/cwltool/issues/578

ADD COMMENT

Login before adding your answer.

Traffic: 1614 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