Updating Dockerfile for vcfutil to point to my gvcf repo with updated changes for...
[lightning.git] / cwl / gvcf2fasta / maingvcf2fasta.cwl
1 # Copyright (C) The Lightning Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 $namespaces:
6   arv: "http://arvados.org/cwl#"
7 cwlVersion: v1.2
8 class: Workflow
9 label: Scatter to Convert various gVCF to FASTA
10 requirements:
11   SubworkflowFeatureRequirement: {}
12   ScatterFeatureRequirement: {}
13   MultipleInputFeatureRequirement: {}
14   InlineJavascriptRequirement: {}
15   StepInputExpressionRequirement: {}
16 hints:
17   DockerRequirement:
18     dockerPull: vcfutil
19   arv:IntermediateOutput:
20     outputTTL: 604800
21   
22 inputs:
23   splitvcfdirs:
24     type: Directory[]?
25     label: Input directory of split gVCFs
26     default: null
27   vcfsdir:
28     type: Directory?
29     label: Input directory of VCFs
30     default: null
31   vcfs:
32     type: File[]?
33     label: Input VCFs in array of files 
34     default: null
35   genomebed:
36     type: File?
37     label: Whole genome BED
38     default: null
39   ref:
40     type: File?
41     label: Reference FASTA
42     default: null
43   gqcutoff:
44     type: int?
45     label: GQ (Genotype Quality) cutoff for filtering
46     default: null
47   sampleids:
48     type: string[]?
49     label: Sample IDs
50     default: null
51   chrs: string[]?
52   refsdir: Directory?
53   mapsdir: Directory?
54   panelnocallbed: File?
55   panelcallbed: File?
56   nonref: boolean?
57   split: boolean?
58   tar: boolean?
59
60
61 outputs:
62   fas:
63     type:
64       type: array
65       items:
66         type: array
67         items: File
68     label: Output pairs of FASTAs
69     outputSource: 
70       - gvcf2fasta_nonrefvcf-wf/fas
71       - gvcf2fasta_splitvcf-imputation-wf/fas
72       - gvcf2fasta_splitvcf-wf/fas
73       - gvcf2fasta_splitvcftar-wf/fas
74       - gvcf2fasta-wf/fas
75     pickValue: first_non_null
76
77 steps: 
78   getfiles:
79     run: subworkflows/scatter/helpers/getfiles.cwl
80     when: $(inputs.dir !== null)
81     in:
82       dir: vcfsdir
83     out: [vcfs]
84
85   vcf_throttle:
86     in:
87       vcf_files: 
88         source: vcfs
89         default: null
90       transformed_vcfs: 
91         source: getfiles/vcfs
92         default: null
93     run: subworkflows/scatter/helpers/get_vcfs.cwl
94     out: [vcfs]
95
96   get_sample_ids:
97     run: subworkflows/scatter/helpers/get_sample_ids.cwl
98     when: $(inputs.sampleids === null)
99     in:
100       vcfs: vcf_throttle/vcfs
101       sampleids: sampleids
102     out: [sampleids]
103
104   gvcf2fasta_nonrefvcf-wf:
105     run:  subworkflows/scatter/gvcf2fasta/gvcf2fasta_nonrefvcf-wf.cwl
106     when: $(inputs.vcf !== null && inputs.genomebed !== null && inputs.ref !== null && inputs.gqcutoff !== null && inputs.nonref === true)
107     scatter: [sampleid, vcf]
108     scatterMethod: dotproduct
109     in:
110       sampleid: 
111         source: get_sample_ids/sampleids
112         default: []
113       vcf: 
114         source: vcf_throttle/vcfs
115         default: []
116       gqcutoff: gqcutoff
117       genomebed: genomebed
118       ref: ref
119       nonref: nonref
120     out: [fas]
121
122   gvcf2fasta_splitvcf-imputation-wf:
123     run: subworkflows/scatter/gvcf2fasta/gvcf2fasta_splitvcf-imputation-wf.cwl
124     when: $(inputs.splitvcfdir !== null && inputs.chrs !== null && inputs.refsdir !== null && inputs.mapsdir !== null && inputs.panelcallbed !== null && inputs.panelnocallbed !== null)
125     scatter: [sampleid, splitvcfdir]
126     scatterMethod: dotproduct
127     in:
128       sampleid: 
129         source: sampleids
130         default: []
131       splitvcfdir: 
132         source: splitvcfdirs
133         default: []
134       gqcutoff: gqcutoff
135       genomebed: genomebed
136       ref: ref
137       chrs: chrs
138       refsdir: refsdir
139       mapsdir: mapsdir
140       panelnocallbed: panelnocallbed
141       panelcallbed: panelcallbed
142     out: [fas]
143
144   gvcf2fasta_splitvcf-wf:
145     run: subworkflows/scatter/gvcf2fasta/gvcf2fasta_splitvcf-wf.cwl
146     when: $(inputs.split && inputs.chrs === null)
147     scatter: [sampleid, splitvcfdir]
148     scatterMethod: dotproduct
149     in:
150       sampleid: 
151         source: get_sample_ids/sampleids
152         default: []
153       splitvcfdir: 
154         source: splitvcfdirs
155         default: []
156       gqcutoff: gqcutoff
157       genomebed: genomebed
158       ref: ref
159       split: split
160       chrs: chrs
161     out: [fas]
162
163   gvcf2fasta_splitvcftar-wf:
164     run: subworkflows/scatter/gvcf2fasta/gvcf2fasta_splitvcftar-wf.cwl
165     when: $(inputs.tar === true && inputs.split === true)
166     scatter: [sampleid, vcftar]
167     scatterMethod: dotproduct
168     in:
169       sampleid: 
170         source: get_sample_ids/sampleids
171         default: []
172       vcftar: 
173         source: vcf_throttle/vcfs
174         default: []
175       gqcutoff: gqcutoff
176       genomebed: genomebed
177       ref: ref
178       tar: tar
179       split: split
180     out: [fas]
181   gvcf2fasta-wf:
182     run: subworkflows/scatter/gvcf2fasta/gvcf2fasta-wf.cwl
183     scatter: [sampleid, vcf]
184     when: $(inputs.tar !== true && inputs.split !== true && inputs.nonref !== true)
185     scatterMethod: dotproduct
186     in:
187       sampleid: 
188         source: get_sample_ids/sampleids
189         default: []
190       vcf: 
191         source: vcf_throttle/vcfs
192         default: []
193       genomebed: genomebed
194       ref: ref
195       gqcutoff: gqcutoff
196       tar: tar
197       split: split
198       nonref: nonref
199     out: [fas]
200