For your outputs field, if you want cwltool to interpret each output you should point to the input location where you'd expect each output to come from. For example in your code, you are telling cwltool to look for all of these output files from a string input. The output field is not aware the output_directory is an actual directory because all you have specified is that it is a string ( I know you are using this to name your directory, but cwltool does not know it is a directory). You would want each field to correspond with where the output to come from.
You should modify your inputs to expect a script, rather than having your cwltool try to interpret that it should run python read_fast5_basecaller.py with python by doing the following in your inputs/baseCommand:
baseCommand: python
inputs:
script:
type: File
inputBinding:
position: 1
default:
class: File
location: read_fast5_basecaller.py
also change your output_directory input to reflect that this is creating a directory, not just a string.
output_directory:
type: Directory
inputBinding:
prefix: --save_path
This tells your cwltool exactly how to interpret the script it is reading rather than having it try to figure out on its own. After this you want to point your glob function to this directory for all expected outputs:
outputs:
sequences:
type: Directory ## this is the location that you specify as the save path for read_fast5_basecaller.
outputBinding:
glob: $(inputs.output_directory)
As an example, say you want an output that you know is generated from the input you've named flowcell (this is a hypothetical) and the output from input flowcell would be a type: File:
outputs:
flowcell_out:
type: File
outputBinding:
glob: $(inputs.flowcell.basename).txt
This tells cwltool to expect this specific output to come specifically from your input labeled flowcell. This is how you use the inputs as a pointer in a glob function. I hope this fixes your problem! (I think the biggest issue was that you were trying to tell cwltool to expect all outputs to come from a string, and not a directory). You may also have run into some issues because you weren't telling cwltool to expect to run an external script. I hope this is informative! Post again if you have any more questions, I will try to help to save Mr. C some time. If you need me to rewrite the entire script top to bottom I don't mind doing it. Basically, if you leave the outputs field as you have it, it is going to be redundant but useful if you need to use any of those files as a pointer for downstream. If you include everything in your outputs that you currently have, plus the output_directory it will output everything in the output directory + point to each file in the output directory and point to the output directory. If you only output output_directory it will output everything but only point to output_directory in your final pointer. At least I believe this is how it will break down.