CWL: Specify type of input file
2
0
Entering edit mode
6.2 years ago
sc35 • 0

Can you make CWL insist that an input file has a particular type? How would you do this? I would like an error if the tool is given a file of the wrong type.

CWL • 1.3k views
ADD COMMENT
0
Entering edit mode
6.2 years ago

Hello sc35 and thank you for your question.

The answer depends on what you mean by "insist" :-)

The format field can be used to signal which File format you expect: http://www.commonwl.org/user_guide/16-file-formats/ But validation (beyond matching the format values) is up to the workflow engines themselves.

ADD COMMENT
0
Entering edit mode
6.2 years ago

HI, You can probably do a sort of a check using JS expression, for example add an argument that will not appear on the command line, but will throw an error if something is not the way you want it to be:

arguments:
- valueFrom: |-
${
if (inputs.input_file.nameext != '.bam') throw 'Not BAM'
return ''
}

ADD COMMENT

Login before adding your answer.

Traffic: 1588 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6