-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathDockstore.cwl
226 lines (205 loc) · 6.92 KB
/
Dockstore.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
#!/usr/bin/env cwl-runner
class: CommandLineTool
id: Seqware-BWA-Workflow
label: Seqware-BWA-Workflow
cwlVersion: v1.0
dct:creator:
'@id': http://orcid.org/0000-0002-7681-6415
foaf:name: Brian O'Connor
foaf:mbox: mailto:briandoconnor@gmail.com
dct:contributor:
foaf:name: Denis Yuen
foaf:mbox: mailto:denis.yuen@oicr.on.ca
requirements:
- class: DockerRequirement
dockerPull: quay.io/pancancer/pcawg-bwa-mem-workflow:2.7.0
- class: InlineJavascriptRequirement
inputs:
output_file_basename:
type: string
inputBinding:
position: 10
prefix: --output-file-basename
doc: the basename to use for output files
download_reference_files:
type: string
inputBinding:
position: 11
prefix: --download-reference-files
doc: should we attempt to download the reference files ["true", "false"]
reference_gz_fai:
type: File
inputBinding:
position: 3
prefix: --reference-gz-fai
doc: the reference *.fa.gz.fai file
reference_gz:
type: File
inputBinding:
position: 2
prefix: --reference-gz
doc: the reference *.fa.gz file
reference_gz_pac:
type: File
inputBinding:
position: 7
prefix: --reference-gz-pac
doc: the reference *.fa.gz.pac file
reference_gz_amb:
type: File
inputBinding:
position: 4
prefix: --reference-gz-amb
doc: the reference *.fa.gz.amb file
reads:
type:
type: array
items: File
inputBinding:
position: 1
prefix: --files
reference_gz_bwt:
type: File
inputBinding:
position: 6
prefix: --reference-gz-bwt
doc: the reference *.fa.gz.bwt file
output_dir:
type: string
inputBinding:
position: 9
prefix: --output-dir
doc: the output directory
reference_gz_sa:
type: File
inputBinding:
position: 8
prefix: --reference-gz-sa
doc: the reference *.fa.gz.sa file
reference_gz_ann:
type: File
inputBinding:
position: 5
prefix: --reference-gz-ann
doc: the reference *.fa.gz.ann file
outputs:
merged_output_bai:
type: File
outputBinding:
glob: $(inputs.output_dir + '/' + inputs.output_file_basename + '.bam.bai')
merged_output_unmapped_metrics:
type: File
outputBinding:
glob: $(inputs.output_dir + '/' + inputs.output_file_basename + '.unmapped.bam.metrics')
merged_output_bam:
type: File
outputBinding:
glob: $(inputs.output_dir + '/' + inputs.output_file_basename + '.bam')
merged_output_metrics:
type: File
outputBinding:
glob: $(inputs.output_dir + '/' + inputs.output_file_basename + '.bam.metrics')
merged_output_unmapped_bai:
type: File
outputBinding:
glob: $(inputs.output_dir + '/' + inputs.output_file_basename + '.unmapped.bam.bai')
merged_output_unmapped_bam:
type: File
outputBinding:
glob: $(inputs.output_dir + '/' + inputs.output_file_basename + '.unmapped.bam')
baseCommand: [/start.sh , python, /home/seqware/Seqware-BWA-Workflow/run_seqware_workflow.py]
doc: |
PCAWG uniform alignment workflow uses the popular short read aligner tool BWA MEM (https://github.com/lh3/bwa)
with BioBAMBAM (https://github.com/gt1/biobambam) for BAM sorting, merging and marking duplicate.
The alignment workflow has been dockerized and packaged using CWL workflow language, the source code
is available on GitHub at: https://github.com/ICGC-TCGA-PanCancer/Seqware-BWA-Workflow.
## Run the workflow with your own data
### Prepare compute environment and install software packages
The workflow has been tested in Ubuntu 16.04 Linux environment with the following hardware
and software settings.
#### Hardware requirement (assuming 30X coverage whole genome sequence)
- CPU core: 16
- Memory: 64GB
- Disk space: 1TB
#### Software installation
- Docker (1.12.6): follow instructions to install Docker https://docs.docker.com/engine/installation
- CWL tool
```
pip install cwltool==1.0.20180116213856
```
### Prepare input data
#### Input unaligned BAM files
The workflow uses lane-level unaligned BAM files as input, one BAM per lane (aka read group).
Please ensure *@RG* field is populated properly in the BAM header, the following is a
valid *@RG* entry. *ID* field has to be unique among your dataset.
```
@RG ID:WTSI:9399_7 CN:WTSI PL:ILLUMINA PM:Illumina HiSeq 2000 LB:WGS:WTSI:28085 PI:453 SM:f393ba16-9361-5df4-e040-11ac0d4844e8 PU:WTSI:9399_7 DT:2013-03-18T00:00:00+00:00
```
Multiple unaligned BAMs from the same sample (with same *SM* value) should be run together. *SM* is
globally unique UUID for the sample. Put the input BAM files in a subfolder. In this example,
we have two BAMs in a folder named *bams*.
#### Reference genome sequence files
The reference genome files can be downloaded from the ICGC Data Portal at
under https://dcc.icgc.org/releases/PCAWG/reference_data/pcawg-bwa-mem. Please download all
reference files and put them under a subfolder called *reference*.
#### Job JSON file for CWL
Finally, we need to prepare a JSON file with input, reference and output files specified. Please
replace the *reads* parameter with your real BAM file name.
Name the JSON file: *pcawg-bwa-mem-aligner.job.json*
```
{
"reads": [
{
"path":"bams/seq_from_normal_sample_A.lane_1.bam",
"class":"File"
},
{
"path":"bams/seq_from_normal_sample_A.lane_2.bam",
"class":"File"
}
],
"output_dir": "datastore",
"download_reference_files": "false",
"output_file_basename": "seq_from_normal_sample_A",
"reference_gz_amb": {
"path": "reference/genome.fa.gz.64.amb",
"class": "File"
},
"reference_gz_sa": {
"path": "reference/genome.fa.gz.64.sa",
"class": "File"
},
"reference_gz_pac": {
"path": "reference/genome.fa.gz.64.pac",
"class": "File"
},
"reference_gz_ann": {
"path": "reference/genome.fa.gz.64.ann",
"class": "File"
},
"reference_gz_bwt": {
"path": "reference/genome.fa.gz.64.bwt",
"class": "File"
},
"reference_gz_fai": {
"path": "reference/genome.fa.gz.fai",
"class": "File"
},
"reference_gz": {
"path": "reference/genome.fa.gz",
"class": "File"
}
}
```
### Run the workflow
#### Option 1: Run with CWL tool
- Download CWL workflow definition file
```
wget -O pcawg-bwa-mem-aligner.cwl "https://raw.githubusercontent.com/ICGC-TCGA-PanCancer/Seqware-BWA-Workflow/2.6.8_1.3/Dockstore.cwl"
```
- Run *cwltool* to execute the workflow
```
nohup cwltool --debug --non-strict pcawg-bwa-mem-aligner.cwl pcawg-bwa-mem-aligner.job.json > pcawg-bwa-mem-aligner.log 2>&1 &
```
#### Option 2: Run with the Dockstore CLI
See the *Launch with* on the next tab for details