ba6fa32c19c0185e20671421c36d41a9a28a382f
[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.1
8 class: Workflow
9 label: Scatter to Convert various gVCF to FASTA
10 requirements:
11   SubworkflowFeatureRequirement: {}
12   ScatterFeatureRequirement: {}
13 hints:
14   DockerRequirement:
15     dockerPull: vcfutil
16   arv:IntermediateOutput:
17     outputTTL: 604800
18   
19 inputs:
20   vcfsinput:
21     - type: record
22       vcfsdir:
23         type: Directory
24         label: Input directory of VCFs
25     - type: record
26       vcfs:
27         type: File[]
28         label: Input VCFs in array of files 
29     - type: record
30       vcftars:
31         type: File[]
32         label: Input VCF tars
33   genomebed:
34     type: File
35     label: Whole genome BED
36   ref:
37     type: File
38     label: Reference FASTA
39   
40   gqcutoff:
41     type: int?
42     label: GQ (Genotype Quality) cutoff for filtering
43   sampleids:
44     type: string[]?
45     label: Sample IDs
46   chrs: string[]?
47   refsdir: Directory?
48   mapsdir: Directory?
49   panelnocallbed: File?
50   panelcallbed: File?
51
52
53 outputs:
54   fas:
55     type:
56       type: array
57       items:
58         type: array
59         items: File
60     label: Output pairs of FASTAs
61     outputSource: 
62       - gvcf2fasta_nonrefvcf-wf/fas
63       - gvcf2fasta_splitvcf-imputation-wf/fas
64       - gvcf2fasta_splitvcf-wf/fas
65       - gvcf2fasta_splitvcftar-wf/fas
66       - gvcf2fasta-wf/fas
67     pickValue: first_non_null
68
69 steps: 
70   gvcf2fasta_nonrefvcf-wf:
71     run:  subworkflows/scatter/gvcf2fasta/gvcf2fasta_nonrefvcf-wf.cwl
72     when: $(inputs.sampleid and inputs.vcfsinput.vcf)
73     scatter: [sampleid, vcf]
74     scatterMethod: dotproduct
75     in:
76       sampleid: sampleids
77       vcf: vcfsinput
78       gqcutoff: gqcutoff
79       genomebed: genomebed
80       ref: ref
81     out: [fas]
82
83   gvcf2fasta_splitvcf-imputation-wf:
84     run: subworkflows/scatter/gvcf2fasta/gvcf2fasta_splitvcf-imputation-wf.cwl
85     when: $(inputs.sampleids and inputs.splitvcfdirs and inputs.chrs and inputs.refsdir and inputs.mapsdir and inputs.panelcallbed and inputs.panelnocallbed)
86     scatter: [sampleid, splitvcfdir]
87     scatterMethod: dotproduct
88     in:
89       sampleid: sampleids
90       splitvcfdir: vcfsinput
91       gqcutoff: gqcutoff
92       genomebed: genomebed
93       ref: ref
94       chrs: chrs
95       refsdir: refsdir
96       mapsdir: mapsdir
97       panelnocallbed: panelnocallbed
98       panelcallbed: panelcallbed
99     out: [fas]
100
101   gvcf2fasta_splitvcf-wf:
102     run: subworkflows/scatter/gvcf2fasta/gvcf2fasta_splitvcf-wf.cwl
103     when: $(inputs.sampleid and inputs.splitvcfdir)
104     scatter: [sampleid, splitvcfdir]
105     scatterMethod: dotproduct
106     in:
107       sampleid: sampleids
108       splitvcfdir: vcfsinput
109       gqcutoff: gqcutoff
110       genomebed: genomebed
111       ref: ref
112     out: [fas]
113   gvcf2fasta_splitvcftar-wf:
114     run: subworkflows/scatter/gvcf2fasta/gvcf2fasta_splitvcftar-wf.cwl
115     when: $(inputs.sampleids and inputs.vcftars)
116     scatter: [sampleid, vcftar]
117     scatterMethod: dotproduct
118     in:
119       sampleid: sampleids
120       vcftar: vcfsinput
121       gqcutoff: gqcutoff
122       genomebed: genomebed
123       ref: ref
124     out: [fas]
125   getfiles:
126     run: subworkflows/scatter/helpers/getfiles.cwl
127     in:
128       dir: vcfsinput
129     out: [vcfs, samples]
130   gvcf2fasta-wf:
131     run: subworkflows/scatter/gvcf2fasta/gvcf2fasta-wf.cwl
132     scatter: [sampleid, vcf]
133     scatterMethod: dotproduct
134     in:
135       sampleid: getfiles/samples
136       vcf: getfiles/vcfs
137       genomebed: genomebed
138       ref: ref
139     out: [fas]
140