I saw this page here:
https://www.commonwl.org/user_guide/misc/
Which describes how to load data from a file in order to output it ;
Non “File
” types using evalFrom
cwlVersion: v1.0 # or v1.1
class: CommandLineTool
requirements:
InlineJavascriptRequirement: {}
baseCommand: [ echo, "42" ]
inputs: []
stdout: my_number.txt
outputs:
my_number:
type: int
outputBinding:
glob: my_number.txt
loadContents: True
outputEval: $(parselnt(self[0].contents))
my_number_as_string:
type: string
outputBinding:
glob: my_number.txt
loadContents: True
outputEval: $(self[0].contents)
However, this is not what I want. In these examples, you would have to write out all your data into files and then load them back into output objects from files.
I want to be able to pass in any arbitrary input into a CommandLineTool, then pass that (or other) data back out, regardless of the involvement of any file. For example:
cwlVersion: v1.0 # or v1.1
class: CommandLineTool
requirements:
InlineJavascriptRequirement: {}
baseCommand: [ touch, newfile.txt ]
inputs:
some_value: int
some_file: File
outputs:
some_value:
value: $(inputs.some_value)
type: int
some_other_value:
value: ${ return `some_JS_expression_result` ; }
type: int
new_file:
type: File
outputBinding:
glob: newfile.txt
This is just a basic example with primitive data types, but ultimately what I would really like is the ability to pass in a record
type as an input, with one or more fields including File
objects, then inside my CommandLineTool do some processing to make a new file, and then output that same record
but with an updated File
in its fields.
I have tried writing this myself but I get syntax or “incorrect field” errors every time.
The CWL spec here describes several different types
's of CommandOutput and CommandOutputRecord object;
https://www.commonwl.org/v1.0/CommandLineTool.html
But I have not been able to find any real-world examples that show how to output anything from CommandLineTool
that is not from a file.