Question: CWL: Gathering outputs in folders.
0
gravatar for lon.lightly
19 months ago by
lon.lightly0 wrote:

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 • 931 views
ADD COMMENTlink modified 19 months ago by Michael R. Crusoe1.5k • written 19 months ago by lon.lightly0
0
gravatar for Michael R. Crusoe
19 months ago by
Common Workflow Language project
Michael R. Crusoe1.5k wrote:

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 COMMENTlink written 19 months ago by Michael R. Crusoe1.5k
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: 1532 users visited in the last hour