Yes, true. The scatter creates multiple jobs and each job output gets written to different file, although the output file is the same. Each time a file gets created, overwriting the previous one.
As a solution, writing the output of the scatter to different output files and then another step to cat the results of those output files to a single output file.
cat fastqc_check.cwl
class: CommandLineTool
baseCommand: [sh, fastqc_check.sh]
inputs:
fq1_zips:
type: File
inputBinding:
position: 1
outputs:
fastqc_check_out:
type: File
outputBinding:
glob: $(inputs.fq1_zips.nameroot).summary
cat fastqc_summarize.cwl
cwlVersion: v1.0
class: CommandLineTool
baseCommand: [cat]
inputs:
sample: string
fq1_summary:
type: File[]
inputBinding:
position: 1
outputs:
fastqc_summarize_out:
type: stdout
stdout: $(inputs.sample)_fastqc.summary
cat qc.cwl
cwlVersion: v1.0
class: Workflow
requirements:
- class: ScatterFeatureRequirement
inputs:
reads1:
type: File[]
reads2:
type: File[]
fastqc_check_script:
type: File
sample:
type: string
outputs:
fastqc_out:
type: File[]
outputSource: fastqc/fastqc_zip
fastqc_html:
type: File[]
outputSource: fastqc/fastqc_html
fastqc_check_out:
type: File[]
outputSource: fastqc_check/fastqc_check_out
fastqc_summary_out:
type: File
outputSource: fastqc_summarize/fastqc_summarize_out
steps:
fastqc:
run: fastqc.cwl
in:
fq1:
source: reads1
fq2:
source: reads2
out: [fastqc_zip, fastqc_html]
fastqc_check:
run: fastqc_check_temp.cwl
in:
fq1_zips:
source: [fastqc/fastqc_zip]
scatter: fq1_zips
out: [fastqc_check_out]
fastqc_summarize:
run: fastqc_summarize.cwl
in:
sample: sample
fq1_summary:
source: fastqc_check/fastqc_check_out
out: [fastqc_summarize_out]