In trying to solve a problem posed by Stuti Agrawal, I've been trying to make a working example using the Directory type of CWL v1.0 as an input and not getting very far. I tried writing a tool that pics up the files from a Directory and adds them to a zip file. Note, this doesn't add the directory, but rather its contents. So if you have:
/home/foo/one.txt
/home/foo/two.txt
it should add one.txt
and two.txt
to the command line, i.e:
zip data.zip one.txt two.txt
I'm not sure if this is the intended use case for Directory? Alternatively, I'd like to able to add /home/foo
to the command line, yielding:
zip -r data.zip /home/foo
In any event here is a non-working experiment:
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
requirements:
- class: InlineJavascriptRequirement
class: CommandLineTool
baseCommand: ["zip"]
inputs:
testdir:
type: Directory
doc: |
string(s): list files in a directory.
inputBinding:
position: 1
outputs:
zipped_file:
type: File
outputBinding:
glob: data.zip
arguments:
- valueFrom: data.zip
What should be changed to get either my first or my second example command line?
Thanks
Hi Peter,
I think this is a bug. It's supposed to add the directory path to the command line, but that doesn't seem to be happening here. I'll look into it.
To follow up, I have a PR which correctly adds the Directory path to the command line as intended:
https://github.com/common-workflow-language/cwltool/pull/144
By the way I used this input to the above CWL:
Hello Peter vH!
We believe that this post does not fit the main topic of this site.
Not a bio-informatics question, have a look at stackoverflow.com
For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.
If you disagree please tell us why in a reply below, we'll be happy to talk about it.
Cheers!
I don't know, the common workflow language is sort of an up-and-coming important aspect of reproducible bioinformatics.
Well in that case, forgive my ignorance :) (reopened)
As Devon Ryan noted, CWL is a (now) stable specification describing workflows, and started from the need for documented reproducible bioinformatics workflows. It had a significant presence at the Bioinformatics Open Source Conference the last two years and just released a v1.0 specification.
https://www.open-bio.org/wiki/BOSC_2015_Schedule https://www.open-bio.org/wiki/BOSC_2016_Schedule
Peter vH it might be worth posting this to the CWL mail list:
https://groups.google.com/forum/#!forum/common-workflow-language
You might get a more direct answer there.
Some of the CWL folks have directed "support" questions to Biostars recently on the understanding that when they get answered here the answers are easy for people to find in the future. I'll alert the community to this question though.
Ah, didn't know that but using Biostars makes sense. I just haven't seen many CWL-related queries here yet.
https://www.biostars.org/t/cwl/ :-)