-
Notifications
You must be signed in to change notification settings - Fork 0
/
arraycheck_simple.wdl
50 lines (42 loc) 路 963 Bytes
/
arraycheck_simple.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
version 1.0
# Author: Ash O'Farrell (UCSC)
# Note that this assumes that file names between the test and truth match
task stuart_arraycheck_simple {
input {
Array[File] test
Array[File] truth
Boolean fastfail = false # should we exit out upon first mismatch?
}
Int test_size = ceil(size(test, "GB"))
Int truth_size = ceil(size(truth, "GB"))
Int finalDiskSize = test_size + truth_size + 3
command <<<
for j in ~{sep=' ' test}
do
md5sum ${j} > sum.txt
test_basename="$(basename -- ${j})"
for i in ~{sep=' ' truth}
do
truth_basename="$(basename -- ${i})"
if [ "${test_basename}" == "${truth_basename}" ]; then
actual_truth="$i"
break
fi
done
if ! echo "$(cut -f1 -d' ' sum.txt)" $actual_truth | md5sum --check
then
if ~{fastfail}
then
exit 1
fi
fi
done
>>>
runtime {
cpu: 2
disks: "local-disk " + finalDiskSize + " HDD"
docker: "debian:stretch-slim"
memory: "2 GB"
preemptible: 2
}
}