Hi,
Is it possible to create/stage directories via CWL? Say I have a tool which requires an output directory exists before it can run, but the directories should be automatically inferred from the samples being processed. What is the best way to go about this in CWL?
- Something built into CWL such as
InitialWorkDirRequirement
? I tried this, but couldn't quite get it to create the directory, I was just told it does not exist. - Running
mkdir
as a separate step in the workflow to create the directories?
If it is possible to do within CWL (1), then does someone have a good example they can point me to? Thanks!
Yes, this is possible, here's the tutorial for
InitialWorkDirRequirement
: http://www.commonwl.org/user_guide/15-staging/I think you are asking to create one or more directories to enclose each sample? If you could be more specific about what you need to do, that would help us help you :-)
Here is a very complex example where many input
File
s are collected, renamed, and placed into a directory hierarchy:https://github.com/EBI-Metagenomics/ebi-metagenomics-cwl/blob/master/workflows/convert-to-v3-layout.cwl Permalink from today: https://github.com/EBI-Metagenomics/ebi-metagenomics-cwl/blob/886df9de6713e06228d2560c40f451155a196383/workflows/convert-to-v3-layout.cwl
But there is a good chance won't need something that complex
Yes your interpretation is correct! Sorry I was trying to not overcomplicate my question. I tried using
InitialWorkDirRequirement
as such:[Errno 2] No such file or directory: /home/path/to/output
and it just told me that the directories did not exist, which made me wonder whether or not it can actually create those directories for you or if they have to exist to be "staged" alongside your inputs. The script itself requires the directories exist before running, but at least in my CWL script it also requires that. Is there a different way I need to set up
InitialWorkDirRequirement
so that the directories are created?As an additional note, I've also tried this variation, but I think I am just misunderstanding how this works:
since I still get a
cwltool.errors.WorkflowException: Expression evaluation error: [Errno 13] Permission denied
Where sample_tool.sh is just