-
Notifications
You must be signed in to change notification settings - Fork 0
/
map_to_sharded_index.wdl
85 lines (69 loc) · 1.68 KB
/
map_to_sharded_index.wdl
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
version 1.1
workflow map_to_sharded_index {
input {
Array[File] index_shards
File fastq
File? fastq2
String? minimap2_options
String docker
}
# generate intermediate mappings from each index shard, then merge the intermediates
# warning: minimap2_options (e.g. '-x sr') must be the same as used while indexing
scatter (index_shard in index_shards) {
call map {
input:
index_shard, fastq, fastq2, minimap2_options, docker
}
}
call merge {
input:
intermediates = map.intermediate,
fastq, fastq2, minimap2_options, docker
}
output {
File mappings = merge.mappings
}
}
task map {
input {
File index_shard
File fastq
File? fastq2
String minimap2_options = ""
String docker
Int cpu = 8
}
command <<<
set -euxo pipefail
minimap2 ~{minimap2_options} -t ~{cpu} --split-map intermediate \
'~{index_shard}' ~{fastq} ~{fastq2}
>>>
output {
File intermediate = "intermediate"
}
runtime {
docker: docker
cpu: cpu
}
}
task merge {
input {
Array[File] intermediates
File fastq
File? fastq2
String minimap2_options = ""
String output_basename = basename(fastq) + ".paf"
String docker
}
command <<<
set -euxo pipefail
minimap2 ~{minimap2_options} --split-merge -o '~{output_basename}' \
~{fastq} ~{fastq2} . ~{sep(' ', squote(intermediates))}
>>>
output {
File mappings = output_basename
}
runtime {
docker: docker
}
}