Skip to content

Commit d4d8bcf

Browse files
authored
Merge pull request #10 from aofarrel/arraycheck-stop-copying
Stop needless copying of inputs
2 parents 10ed80c + 318bd05 commit d4d8bcf

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

arraycheck_rdata.wdl

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,50 +10,36 @@ task stuart_arraycheck_rdata {
1010
Boolean fastfail = false # should we exit as soon as we get our first mismatch?
1111
}
1212

13-
Int test_size = 2*ceil(size(test, "GB"))
14-
Int truth_size = 2*ceil(size(truth, "GB"))
13+
Int test_size = ceil(size(test, "GB"))
14+
Int truth_size = ceil(size(truth, "GB"))
1515
Int finalDiskSize = test_size + truth_size + 1
1616

1717
command <<<
1818

19-
# the md5 stuff pulls from the files in /inputs/
20-
# the Rscript pulls from the copied files
21-
2219
failflag=false
2320
for j in ~{sep=' ' test}
2421
do
25-
26-
# md5
2722
md5sum ${j} > sum.txt
2823
test_basename="$(basename -- ${j})"
2924

30-
# R
31-
cp ${j} .
32-
mv ${test_basename} "testcopy_${test_basename}"
33-
3425
for i in ~{sep=' ' truth}
3526
do
3627
truth_basename="$(basename -- ${i})"
28+
29+
# We assume the test file and truth file have the same basename
30+
# Due to how WDL inputs work, they have a different absolute path
3731
if [ "${test_basename}" == "${truth_basename}" ]; then
38-
# md5
3932
actual_truth="$i"
40-
41-
# R
42-
cp ${i} .
43-
mv ${truth_basename} "truthcopy_${truth_basename}"
44-
4533
break
4634
fi
4735
done
4836

49-
# md5
5037
if ! echo "$(cut -f1 -d' ' sum.txt)" $actual_truth | md5sum --check
5138
then
5239
if ! ~{exact}
5340
then
54-
# R
5541
echo "Calling Rscript to check for functional equivalence."
56-
if Rscript /opt/rough_equivalence_check.R testcopy_$test_basename truthcopy_$truth_basename ~{tolerance}
42+
if Rscript /opt/rough_equivalence_check.R $j $actual_truth ~{tolerance}
5743
then
5844
echo "Outputs are not identical, but are mostly equivalent."
5945
else

0 commit comments

Comments
 (0)