Skip to content

cwltool workflow execution can't find relative path #131

Closed

Description

@portah

The latest cwltool and the latest workflow:
https://github.com/SciDAP/workflows/blob/master/workflows/scidap/bam-genomecov-bigwig.cwl

When you start it from ./scidap folder cwltool maps correctly input parameters and processes first two steps, but the last steps failed if output file name with relative path ./test-files/rna.SRR948778.bigwig. Without ./test-file/ there is no problem with last step. The directory is the symlink to a writable directory and .cwls from tools can write there.

{
    "type": "rna",
    "input": {
        "class": "File",
        "path": "./test-files/rna.SRR948778.bam"
    },
    "genomeFile": {
        "class": "File",
        "path": "./test-files/mm10-chrNameLength.txt"
    },
    "scale": 1,
    "dept":"-bg",
    "bigWig": "./test-files/rna.SRR948778.bigwig"
}

Error:

root@vagrant-ubuntu-vivid-64:/workflows/workflows/scidap# ./bam-genomecov-bigwig.cwl ./bam-genomecov-bigwig-job.json 
/usr/local/bin/cwl-runner 1.0.20150918080732
[job 139882185334736] /tmp/tmpNrf3vX$ docker run -i --volume=/workflows/workflows/scidap/test-files/rna.SRR948778.bam.bai:/tmp/job238980059_test-files/rna.SRR948778.bam.bai:ro --volume=/workflows/workflows/scidap/test-files/mm10-chrNameLength.txt:/tmp/job238980059_test-files/mm10-chrNameLength.txt:ro --volume=/workflows/workflows/scidap/test-files/rna.SRR948778.bam:/tmp/job238980059_test-files/rna.SRR948778.bam:ro --volume=/tmp/tmpNrf3vX:/tmp/job_output:rw --volume=/tmp/tmpjfC2h2:/tmp/job_tmp:rw --workdir=/tmp/job_output --user=0 --rm --env=TMPDIR=/tmp/job_tmp --env=PATH=/usr/local/bin/:/usr/bin:/bin scidap/bedtools2:v2.25.0 bedtools genomecov -ibam /tmp/job238980059_test-files/rna.SRR948778.bam -g /tmp/job238980059_test-files/mm10-chrNameLength.txt -bg -scale 1 > /tmp/tmpNrf3vX/genomecov.bed
[job 139882184324048] /tmp/tmpJkD2d8$ docker run -i --volume=/tmp/tmpNrf3vX/genomecov.bed:/tmp/job899293945_tmpNrf3vX/genomecov.bed:ro --volume=/tmp/tmpJkD2d8:/tmp/job_output:rw --volume=/tmp/tmp9RGq3F:/tmp/job_tmp:rw --workdir=/tmp/job_output --user=0 --rm --env=TMPDIR=/tmp/job_tmp --env=PATH=/usr/local/bin/:/usr/bin:/bin ubuntu:15.04 sort -k1,1 -k2,2n /tmp/job899293945_tmpNrf3vX/genomecov.bed > /tmp/tmpJkD2d8/sorted.file
[job 139882178792528] /tmp/tmpUjC20a$ docker run -i --volume=/tmp/tmpJkD2d8/sorted.file:/tmp/job616341517_tmpJkD2d8/sorted.file:ro --volume=/workflows/workflows/scidap/test-files/mm10-chrNameLength.txt:/tmp/job616341517_test-files/mm10-chrNameLength.txt:ro --volume=/tmp/tmpUjC20a:/tmp/job_output:rw --volume=/tmp/tmp0MLE2W:/tmp/job_tmp:rw --workdir=/tmp/job_output --user=0 --rm --env=TMPDIR=/tmp/job_tmp --env=PATH=/usr/local/bin/:/usr/bin:/bin scidap/ucsc-userapps:v321 bedGraphToBigWig /tmp/job616341517_tmpJkD2d8/sorted.file /tmp/job616341517_test-files/mm10-chrNameLength.txt ./test-files/rna.SRR948778.bigwig
mustOpen: Can't open ./test-files/rna.SRR948778.bigwig to write: No such file or directory
Error while running job: No matches for output file with glob: './test-files/rna.SRR948778.bigwig'
[job 139882178792528] completed permanentFail
Output is missing expected field file:///workflows/workflows/scidap/bam-genomecov-bigwig.cwl#bigwig.bigWigOut
Workflow step file:///workflows/workflows/scidap/bam-genomecov-bigwig.cwl#bigwig completion status is permanentFail
[workflow 139882180237328] outdir is /workflows/workflows/scidap
Final process status is permanentFail

Activity

  1. tetron commented on Sep 22, 2015

    @tetron
    Member

    The output directory in CWL is always a clean directory with nothing in it, so the "test-files" symlink does not exist in the container environment in which bedGraphToBigWig actually runs. So when it tries to write to the output file "./test-files/rna.SRR948778.bigwig" it fails because there is no "test-files" subdirectory to write to.

    The problem is that "./test-files/rna.SRR948778.bigwig" is a string. Unlike when doing stdout redirection (where the value is always a path, so CWL can reason about it) in this case CWL doesn't know that it needs to create a "test-files" directory. Unfortunately, you can't use File because that only works for input files that already exist.

    You should be able to work around this using CreateFileRequirement to cause CWL to create a stub called something like ./test-files/.ignore that implicitly creates the desired directory.

    However, perhaps we need to add an OutputFile type to CWL that represents a file that doesn't exist yet, but is expected to exist, so CWL knows to clear the way so that the file can be written.

  2. mr-c commented on Oct 26, 2015

    @mr-c
    Member

    Thank you @portah for your work on this workflow. Has this issue been addressed?

  3. mr-c commented on Feb 16, 2016

    @mr-c
    Member

    I'm closing this issue. @portah feel free to re-open it if needed

  4. added a commit that references this issue on Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions