-
Notifications
You must be signed in to change notification settings - Fork 0
/
annotator_sub_wf.cwl
114 lines (111 loc) · 4.05 KB
/
annotator_sub_wf.cwl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: Workflow
doc: |
This is a subworkflow of the main oxog_varbam_annotat_wf workflow - this is not meant to be
run as a stand-alone workflow!
requirements:
- class: SchemaDefRequirement
types:
- $import: TumourType.yaml
- class: ScatterFeatureRequirement
- class: StepInputExpressionRequirement
- class: MultipleInputFeatureRequirement
- class: InlineJavascriptRequirement
expressionLib:
- { $include: annotate_util.js }
- class: SubworkflowFeatureRequirement
inputs:
tumour_record:
type: "TumourType.yaml#TumourType"
tumourBams:
type: File[]
VCFs:
type: File[]
normalBam:
type: File
variantType:
type: string
outputs:
annotated_vcfs:
type: File[]
outputSource: chooseVCFsToAnnotate/annotated_vcf
steps:
# This step will prepare the next level by creating vcfsToAnnotate as an array of
# vcfs that need to be annotated
chooseVCFsToAnnotate:
in:
vcfsToAnnotate:
source: [tumour_record, VCFs]
valueFrom: |
${
return chooseVCFsForAnnotator(self[1], self[0].associatedVcfs)
}
tumour_bam:
source: [tumour_record, tumourBams]
valueFrom: |
${
return chooseBamForAnnotator(self[1], self[0])
}
variantType: variantType
normalBam: normalBam
out: [annotated_vcf]
run:
class: Workflow
inputs:
tumour_bam:
type: File
vcfsToAnnotate:
type: File[]
variantType:
type: string
normalBam:
type: File
outputs:
annotated_vcf:
type: File[]
outputSource: processVCFs/annotated_vcf
steps:
# This step scatters across the array of VCFs created by chooseVCFsToAnnotate
processVCFs:
in:
tumour_bam: tumour_bam
input_vcf: vcfsToAnnotate
variant_type: variantType
normal_bam: normalBam
scatter: [input_vcf]
out:
[annotated_vcf]
run:
class: Workflow
inputs:
tumour_bam:
type: File
input_vcf:
type: File
variant_type:
type: string
normal_bam:
type: File
steps:
# This step takes the scatter of processVCFs and executes the annotator on each VCF.
annotate:
in:
tumour_bam: tumour_bam
input_vcf: input_vcf
variant_type: variant_type
normal_bam: normal_bam
output:
source: [input_vcf]
valueFrom: |
${
return self.basename.replace('.vcf.gz','_annotated.vcf')
}
out:
[annotated_vcf]
run:
sga-annotate-docker/Dockstore.cwl
outputs:
annotated_vcf:
type: File
outputSource: annotate/annotated_vcf