My workflow(annotateVCF.cwl) has two steps: snpEff and gzip.
First, snpEff outputted its result(ann.vcf) to stdout, which was used by gzip as the input. Then, gzip compressed the ann.vcf and outputted the ann.vcf.gz to stdout.
The problem is: ann.vcf.gz was lost somewhere in the tmp directory and was not moved to the current working directory. Can anybody give me a solution to this problem?
annotateVCF.cwl
#!/usr/bin/env cwl-runner
cwlVersion: v1.2
class: Workflow
label: Annotate the VCF file and compress the resulting VCF
############
inputs:
species:
type: string
input_vcf:
type: string
output_vcf:
type: string
############
steps:
snpEff:
run: snpEff.cwl
in:
species: species
input_vcf: input_vcf
output_vcf: output_vcf
out: [stdout_vcf]
gzip:
run:
class: CommandLineTool
baseCommand: [gzip, -f, -c]
inputs:
fileToCompress:
type: File
inputBinding:
position: 1
stdout: $(inputs.fileToCompress.basename).gz
outputs: []
in:
fileToCompress:
source: snpEff/stdout_vcf
out: []
############
outputs: []
snpEff.cwl
#!/usr/bin/env cwl-runner
cwlVersion: v1.2
class: CommandLineTool
label: snpEff
baseCommand: [java, -jar, /home/user1/snpEff.jar]
inputs:
species:
type: string
inputBinding:
position: 1
input_vcf:
type: string
inputBinding:
position: 2
output_vcf:
type: string
stdout: $(inputs.output_vcf)
outputs:
stdout_vcf:
type: stdout
job.yml
species: GRCm39.105
input_vcf: /data/input.vcf.gz
output_vcf: ann.vcf