Ok, so a couple modifications you can try out:
cwlVersion: v1.0
class: CommandLineTool
baseCommand: [python, python/splad.py]
requirements:
- class: InitialWorkDirRequirement
listing: $(inputs.splad_outDir)
writable: true
inputs:
splad_gtf:
type: File
inputBinding:
position: 1
prefix: -a
splad_bams:
type: File[]
inputBinding:
position: 2
prefix: -b
itemSeparator: ","
splad_outDir:
type: Directory
inputBinding:
position: 3
prefix: -o
splad_phase2:
type: string
inputBinding:
position: 4
prefix: -T
outputs:
splad_out_dir:
type: Directory
outputBinding:
glob: $(inputs.splad_outDir.basename)/splad
I added InitialWorkDirRequirement section which allows you to write files to an input directory (splad_outDir) and changed the output collected to a Directory type that follows the pattern above. You need to specify that it used the directory's basename attribute, as just using $(inputs.splad_outDir) is an object. This should still collect the whole output set of files as well, but if you want to also explicitly specify the files that are in the directory to be captured as output you can add that too under outputs, but I'm not sure what you'd glob for specifically since I don't know your file types, so replace the "*" accordingly if needed.
splad_out_files:
type: File[]
outputBinding:
glob: $(inputs.splad_outDir.basename)/splad/*
Note that if you don't capture the directory as an output as well, it places your files into the runtime output directory (which could be the current directory you run the script from). So if you also need splad_outDir, you may want to specify that directory should be captured too. Let me know if this doesn't work and we can modify it a bit!
In this case the output files will be put in
spladder_TEST/splad?Yes, the script/program creates additional directory
spladinside the output directory you specify and keeps the output files there. So here in this casespladder_TEST/splad