Open Keyeoh opened 8 years ago
Hi @Keyeoh,
The immediate bug is that cwltool wants Node.js to interpret Javascript expressions, and it's unable to execute it, and that failure is not handled gracefully leading to backtraces. As of 6ce6370 you should get a more reasonable error message explaining what the problem is.
However, there's also a problem in your example, which is that you are using draft-3 expression syntax without providing cwlVersion: cwl:draft-3
. Unfortunately cwltool lets you get away with but it's not valid, you should update your tool description:
cwlVersion: cwl:draft-3
$graph:
- id: "#sumcmd"
class: CommandLineTool
inputs:
- id: "#a"
type: int
inputBinding: {}
- id: "#b"
type: int
inputBinding: {}
- id: "#output-file"
type: string
outputs:
- id: "#filename"
type: File
outputBinding:
glob: $(inputs['output-file'])
baseCommand: sum.r
stdout: $(inputs['output-file'])
Or to write it more idiomatically:
class: CommandLineTool
cwlVersion: cwl:draft-3
inputs:
- id: a
type: int
inputBinding: {}
- id: b
type: int
inputBinding: {}
- id: output-file
type: string
outputs:
- id: filename
type: File
outputBinding:
glob: $(inputs['output-file'])
baseCommand: sum.r
stdout: $(inputs['output-file'])
Thank you very much, @tetron, for your quick answer. Changed the cwl definition file to the second one you provide (the more idiomatic one) and it ran smoothly. Before closing the issue, could I ask you two small questions related to it?
Forgive me in advance if my questions are dumb, but I am a completely newbie in which refers to Javascript, Node, advanced JSON and related stuff..
@mr-c can we close?
@manu-chroma We should answer @Keyeoh's questions first
Hi everybody,
First of all I would like to congratulate you all for the amazing work you are doing with the CWL. It really seems a great idea to try to standardize practices which we are actually reimplementing almost continuously in our work (I am a bioinformatician).
I am beginning with the tools, just trying to replicate some of the simple examples (Hello world!) and finding out if I can do something similar with a command line R script, which is something I am currently very interested in. I already have the following dummy R script:
And I have created the following CWL specification:
If I try to run the tool, it seems fine at first:
But when I try to run it with actual arguments:
At first I thought this was on me, but then I cloned the example workflows and tools repository, and tried to execute one of the included tools.
Problem is, I do not have any idea of what is exactly causing the error. I can see that is related to not finding a file or a directory, but I am not exactly sure about where to start looking for, because I think I do not understand what the cwl-runner tool is actually doing.
Any help or hint would be much appreciated.
Regards, Gustavo.