This repository has been archived by the owner on Apr 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
synapse-bsmn-common-workflow.cwl
134 lines (120 loc) · 3.53 KB
/
synapse-bsmn-common-workflow.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
124
125
126
127
128
129
130
131
132
133
134
class: Workflow
label: synapse-bsmn-common-workflow
id: synapse-bsmn-common-workflow
cwlVersion: v1.0
inputs:
mate1-ids-file:
type: File
mate2-ids-file:
type: File
prefix:
type: File
synapse_config:
type: File
specimenId:
type: string
outputs:
output_file:
type: File
outputSource: run-sambamba-merge/output_file
requirements:
- class: ScatterFeatureRequirement
- class: SubworkflowFeatureRequirement
- class: MultipleInputFeatureRequirement
- class: InlineJavascriptRequirement
- class: StepInputExpressionRequirement
steps:
get-mate1-files:
doc: "Get the first mate file IDs from the query to an array"
run: steps/out-to-array-tool.cwl
in:
datafile: mate1-ids-file
out: [output-array]
get-mate2-files:
doc: "Get the second mate file IDs from the query to an array"
run: steps/out-to-array-tool.cwl
in:
datafile: mate2-ids-file
out: [output-array]
download-mate1-files:
doc: "Download all of the first mate files from Synapse"
run: https://raw.githubusercontent.com/Sage-Bionetworks/synapse-client-cwl-tools/master/synapse-get-tool.cwl
scatter: synapseid
in:
synapseid: get-mate1-files/output-array
synapse_config: synapse_config
out: [filepath]
download-mate2-files:
doc: "Download all of the second mate files from Synapse"
run: https://raw.githubusercontent.com/Sage-Bionetworks/synapse-client-cwl-tools/master/synapse-get-tool.cwl
scatter: synapseid
in:
synapseid: get-mate2-files/output-array
synapse_config: synapse_config
out: [filepath]
get-platform-unit:
doc: "Get the platform unit ({FLOWCELL_BARCODE}.{LANE}.{SAMPLE_BARCODE}) from the mate 1 fastq file."
run: steps/get-platform-unit.cwl
in:
fastq_files:
source: download-mate1-files/filepath
valueFrom: $(self[0])
out: [platform_unit]
run-bwa-index:
doc: "Create BWA index from the genome fasta file"
run: steps/bwa-index-tool.cwl
in:
sequences:
source: prefix
out: [output]
make-read-group-header:
doc: "Use the specimen ID and platform unit to construct read group header for bwa mem."
run: steps/make-read-group-header.cwl
in:
specimenId: specimenId
platform_unit: get-platform-unit/platform_unit
out: [read_group_header]
run-bwa-mem:
run: steps/bwa-mem-tool.cwl
in:
input1:
source: download-mate1-files/filepath
input2:
source: download-mate2-files/filepath
prefix: run-bwa-index/output
read_group_header:
source: make-read-group-header/read_group_header
output_name:
source: specimenId
valueFrom: $(self + '.sam')
out: [sam_file]
run-sambamba-view: # creates the bam file
run: steps/sambamba-view.cwl
in:
sam_input: {default: true}
format: {default: 'bam'}
compression_level: {default: 0}
input_file:
source: run-bwa-mem/sam_file
output_name:
source: specimenId
valueFrom: $(self + '.bam')
out: [output_file]
run-sambamba-sort:
run: steps/sambamba-sort.cwl
in:
memory_limit: {default: "24GB"}
threads: {default: 1}
input_file:
source: run-sambamba-view/output_file
output_name:
source: specimenId
valueFrom: $(self + '.sorted.bam')
out: [output_files]
run-sambamba-merge:
run: steps/sambamba-merge.cwl
in:
input_files:
source: run-sambamba-sort/output_files
output_name: { default: 'test.merged.bam' }
out: [output_file]