-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathqa_check_subwf.cwl
123 lines (115 loc) · 4.11 KB
/
qa_check_subwf.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
115
116
117
118
119
120
121
122
123
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: Workflow
doc: |
This subworkflow will perform a QA check on the OxoG outputs. It will perform the QA check on a single tumour and it associated VCFs
requirements:
- class: SchemaDefRequirement
types:
- $import: TumourType.yaml
- class: ScatterFeatureRequirement
- class: StepInputExpressionRequirement
- class: MultipleInputFeatureRequirement
- class: InlineJavascriptRequirement
expressionLib:
- { $include: oxog_varbam_annotate_util.js }
- class: SubworkflowFeatureRequirement
outputs:
qa_result:
File
inputs:
tumour_record:
type: "TumourType.yaml#TumourType"
vcfs:
type: File[]
normal_bam:
type: File
secondaryFiles: .bai
normal_minibam:
type: File
tumour_bam:
type: File
secondaryFiles: .bai
tumour_minibam:
type: File
steps:
check_files:
in:
vcfs_to_check:
source: [tumour_record, vcfs]
valueFrom: |
${
var tumour_record = self[0]
var vcfs = self[1]
var vcfsToUse = [];
//this might be a nested array if it came from the OxoG output.
var flattened_array = flatten_nested_arrays(vcfs);
var associated_vcfs = tumour_record.associatedVcfs
for (var i in associated_vcfs)
{
for (var j in flattened_array)
{
if ( flattened_array[j].basename.indexOf(associated_vcfs[i].replace(".vcf.gz","")) !== -1 )
{
//console.log("OK "+flattened_array[j].basename + " was in "+associated_vcfs[i] +" so it will be annotated!")
vcfsToUse.push( flattened_array[j] );
}
/*else
{
//console.log("Not OK "+ flattened_array[j].basename + " was NOT in "+associated_vcfs[i] +" so it will NOT be annotated!")
}*/
}
}
return vcfsToUse;
}
tumour_bam: tumour_bam
tumour_minibam: tumour_minibam
working_directory:
default: '/tmp/'
normal_bam: normal_bam
normal_minibam: normal_minibam
out:
[qa_result]
run:
class: CommandLineTool
requirements:
- class: DockerRequirement
dockerPull: quay.io/pancancer/pcawg-oxog-tools
- class: InitialWorkDirRequirement
listing:
- $( inputs.normal_bam )
- $( inputs.normal_minibam )
- $( inputs.tumour_bam )
- $( inputs.tumour_minibam )
inputs:
working_directory:
type: string
inputBinding:
position: 0
normal_bam:
type: File
inputBinding:
position: 1
normal_minibam:
type: File
inputBinding:
position: 2
tumour_bam:
type: File
inputBinding:
position: 3
tumour_minibam:
type: File
inputBinding:
position: 4
vcfs_to_check:
type: File[]
inputBinding:
position: 5
stdout: qa_check.txt
outputs:
qa_result:
type: File
outputBinding:
glob: "qa_check.txt"
baseCommand: /opt/oxog_scripts/check_minibams.sh