Skip to content

Commit f228de0

Browse files
Update test-01
1 parent 6075857 commit f228de0

2 files changed

Lines changed: 31 additions & 26 deletions

File tree

test/test-01.bash

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
#!/bin/bash
2+
#
3+
# library(rmutil)
4+
# f = function(n,a,b) dbetabinom(0:n,n,a/(a+b),a+b)
25

36
echo "Running Integration Test: unfolded+tagged ..."
47

5-
SOFOS=$1
8+
SOFOS="${1:-../sofos}"
69
VCF=test-default.vcf
710

8-
output=$(${SOFOS} -q -a 0.1 -b 1 -n 10 -u -t ${VCF})
11+
output=$(${SOFOS} -q -a 0.1 -b 1 -n 10 -u -t ${VCF})
912

1013
hnum=$(echo "${output}" | grep '^#' | wc -l)
1114
if [[ 10 -ne "${hnum}" ]]; then
@@ -19,17 +22,17 @@ if [[ $header != "Number,Prior,Observed,Posterior" ]]; then
1922
fi
2023

2124
# Check posterior
22-
expected="0.341830374360738
23-
0.250675607864541
24-
0.169206035308565
25-
0.107597683991088
26-
0.0643344485530045
27-
0.0357933477403989
28-
0.018194951768036
29-
0.00820216873352734
30-
0.00311426094101116
31-
0.000899675382958782
32-
0.000151445356131395"
25+
expected="0.649602923876743
26+
0.476864186047936
27+
0.323085024970344
28+
0.207787973205851
29+
0.128175439263581
30+
0.0772737404468384
31+
0.0475690799391035
32+
0.0320738639692642
33+
0.0246226484295746
34+
0.0198606972724853
35+
0.0130844225782785"
3336

3437
echo "${output}" | grep -v '^#' | awk -F, 'NR>1 {print $4}' \
3538
| paste -d, - <(echo "${expected}") \
@@ -40,17 +43,17 @@ if [[ $? -ne 0 ]]; then
4043
fi
4144

4245
# Check prior
43-
expected="0.751621782268415
44-
0.0751621782268415
45-
0.0413391980247626
46-
0.0289374386173338
47-
0.0224265149284337
48-
0.0183897422413156
49-
0.0156312809051183
50-
0.0136215447887459
51-
0.012089121000012
52-
0.0108802089000108
53-
0.00990099009900991"
46+
expected="1.50324356453683
47+
0.150324356453683
48+
0.0826783960495252
49+
0.0578748772346676
50+
0.0448530298568674
51+
0.0367794844826313
52+
0.0312625618102366
53+
0.0272430895774919
54+
0.0241782420000241
55+
0.0217604178000216
56+
0.0198019801980198"
5457

5558
echo "${output}" | grep -v '^#' | awk -F, 'NR>1 {print $2}' \
5659
| paste -d, - <(echo "${expected}") \
@@ -63,12 +66,13 @@ fi
6366
# Check obs
6467
expected="0
6568
0
66-
1
69+
1.9
6770
0
6871
0
6972
0
7073
0
7174
0
75+
0.1
7276
0
7377
0"
7478

test/test-default.vcf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
##FORMAT=<ID=GP,Number=G,Type=Float,Description="Genotype Posteriors">
99
##contig=<ID=1,length=10000>
1010
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT A B C
11-
1 1 . A C 30 PASS AA=A;AN=6;AC=1 GT:GP 0/1:0,1,0 0/0:1,0,0 0/0:0,0,1
11+
1 1 . A C 30 PASS AA=A;AN=6;AC=1 GT 0/1 0/0 0/0
12+
1 2 . A C 30 PASS AA=C;AAQ=10 GT:GP 0/1 1/1 1/1

0 commit comments

Comments
 (0)