How to get created directories out of CWL tmp path
1
1
Entering edit mode
7.4 years ago
DT ▴ 20

Hello,

I have a tool that takes a directory (--dir ~/Run4_forR) with a samples.csv file as input, and the tool creates and outputs a directory of folders and files in the same input directory as shown by tree below. It runs okay normally, but when I wrap it in CWL, it cannot create the directory tree because of the tmp paths prepended by CWL ('/tmp/tmpWCW3do/Run4_forR/L1'). How should I solve this issue? thanks

Command: Rscript /home/dz/MakeBarcodeTablesV3.R --dir ~/Run4_forR/

Output:

  dz@v:~/Run4_forR$ tree
    .
    ├── samples.csv
    ├── L1
    │   ├── barcode1.txt
    │   └── library_params1.txt
    ├── L2
    │   ├── barcode2.txt
    │   └── library_params2.txt
    ├── L3
    │   ├── barcode3.txt
    │   └── library_params3.txt
    ├── L4
    │   ├── barcode4.txt
    │   └── library_params4.txt
    ├── L5
    │   ├── barcode5.txt
    │   └── library_params5.txt
    ├── L6
    │   ├── barcode6.txt
    │   └── library_params6.txt
    ├── L7
    │   ├── barcode7.txt
    │   └── library_params7.txt
    └── L8
        ├── barcode8.txt
        └── library_params8.txt

cwl-runner warnings:

Warning messages: 1: In dir.create(paste(location, "L", l, sep = ""), showWarnings = TRUE, : cannot create dir '/tmp/tmpWCW3do/Run4_forR/L1', reason 'No such file or directory'

cwl Common Workflow Language • 2.4k views
ADD COMMENT
0
Entering edit mode
7.4 years ago

Hello DT.

You should use the InitialWorkDirRequirement to stage the input file into the writeable output directory.

http://www.commonwl.org/v1.0/UserGuide.html#Staging_input_files_in_the_output_directory

ADD COMMENT
0
Entering edit mode

Hello Michael,

Thank you for your reply.

I tried it, but cwl-runner prepended tmp paths to the directory input and then the wrapped tool cannot find the directory because of the prepend (see log below).

Also, in the 'cannot open file . . .' message below, it's missing a '/' before the file in the directory. It should be '...Run4_forR/hp1.csv'.

Any suggestions? Thanks!!

[job r-MakeBarLibParTables.cwl] /tmp/tmpfE4k3e$ Rscript \
    /home/dz/MakeBarcodeTablesV3.R \
    --dir \
    /tmp/tmpVTGQPt/stg43a89205-59fe-41d5-92ba-df9774192388/Run4_forR

Error in file(file, "rt") : cannot open the connection
Calls: read.table -> file
In addition: Warning message:
In file(file, "rt") :
  cannot open file '/tmp/tmpVTGQPt/stg43a89205-59fe-41d5-92ba-df9774192388/Run4_forRhp1.csv': No such file or directory
ADD REPLY
0
Entering edit mode

Could be an error with the script, it is normal to specify a directory without a trailing slash

If you absolutely can't fix the Rscript to add the directory separator ('/' on unix) then you will need to add valueFrom: ${ return self + '/'; } to the inputBinding with InlineJavascriptRequirement added to the requirements

ADD REPLY

Login before adding your answer.

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