How does cwltool actually check file formats?
1
0
Entering edit mode
6.4 years ago
biokcb ▴ 170

Hello!

I am using a pre-made tool (trimmomatic) downloaded from https://github.com/common-workflow-language/workflows/tree/master/tools which has a file format specification (fastq). If I use an input file as such:

input: 
  class: File
  path: /path/to/myfile.fastq

I get an error that says schema_salad.validate.ValidationException: File has no 'format' defined: so I add a format field to the input document (though I don't know if I am supposed to technically be required to input this?):

 input: 
  class: File
  format: http://edamontology.org/format_1930
  path: /path/to/myfile.fastq

And the error disappears. However, if I input a fake fastq file this also still works and it tries to run trimmomatic anyway (where it fails because it isn't an actual fastq). So clearly it isn't actually validating my fastq before running the tool, but I can force it to try by defining format in my input to match. I imagine it's not supposed to work like this, but maybe I'm misunderstanding how the format field actually is supposed to work. I tried updating to the latest version of cwltool, but it gives the same end result - tries to run the tool even on a fake fastq file if I specify format in my input.yml, but raises the other error if not. So how does format checking work, am I missing something here? Thanks for your input!

cwl • 1.7k views
ADD COMMENT
0
Entering edit mode

I misread your question earlier! Sorry for the post.

ADD REPLY
3
Entering edit mode
6.4 years ago

Hello biokcb, good question.

The CWL reference runner only checks the compatibility of the declared formats, it does not look into the files themselves. Other CWL implementations could choose to do file format verification, but are not required.

You can read more about the format field in the CWL spec under https://www.commonwl.org/v1.0/CommandLineTool.html#File

ADD COMMENT
0
Entering edit mode

Ok, it seems I just misunderstood this field. Thank you for the response!

ADD REPLY

Login before adding your answer.

Traffic: 2778 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