Skip to content

Commit 75804a1

Browse files
author
Peter Krusche
committedMar 1, 2017
HAP-280 more + fixed test cases
1 parent 55ac777 commit 75804a1

10 files changed

+49305
-10
lines changed
 

‎configure.sh

+17-5
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,24 @@ else
4141
CONFIGTYPE="$2"
4242
fi
4343

44+
PLATFORM='unknown'
45+
UNAMESTR=`uname`
46+
if [[ "$UNAMESTR" == 'Linux' ]]; then
47+
PLATFORM='linux'
48+
elif [[ "$UNAMESTR" == 'FreeBSD' ]]; then
49+
PLATFORM='freebsd'
50+
fi
51+
4452
if [[ -z $CONFIGTYPE ]]; then
45-
if [[ "$(hostname)" == *chuk.illumina.com ]] || [[ "$(hostname)" == ukch-* ]] || [[ "$(hostname)" == ussd-prd-lndt* ]]; then
46-
echo "using Illumina configuration."
47-
SPECIALCONFIG="${DIR}/src/sh/illumina-setup.sh"
48-
. ${DIR}/src/sh/illumina-setup.sh
49-
fi
53+
if [[ "$PLATFORM" == "linux" ]] && [[ -d /illumina ]]; then
54+
if [[ "$(hostname)" == *.illumina.com ]] || \
55+
[[ "$(hostname)" == ukch-* ]] || \
56+
[[ "$(hostname)" == ussd-prd-lndt* ]]; then
57+
echo "using Illumina configuration."
58+
SPECIALCONFIG="${DIR}/src/sh/illumina-setup.sh"
59+
. ${DIR}/src/sh/illumina-setup.sh
60+
fi
61+
fi
5062
else
5163
echo "using $CONFIGTYPE configuration."
5264
SPECIALCONFIG="${DIR}/src/sh/$CONFIGTYPE-setup.sh"

‎example/callsonly/call_merge.vcf

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
##contig=<ID=21,length=48129895>
99
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NA12877 NA12878 NA12882
1010
chr21 20000000 . N . . PASS END=20000100 GT:DP:GQ ./.:.:. ./.:.:. 0/0:20:10
11-
chr21 20000020 . N . . PASS END=20000050 GT:DP:GQ ./.:.:. 0/0:30:20 ./.:.:.
1211
chr21 20000020 . A T . PASS . GT:DP:GQ:AD 0/1:10:15:4,6 ./.:.:.:. ./.:.:.:.
12+
chr21 20000021 . N . . PASS END=20000050 GT:DP:GQ ./.:.:. 0/0:30:20 ./.:.:.
1313
chr21 20000048 . ATGG A . PASS . GT:DP:GQ:AD 0/1:10:15:4,6 ./.:.:.:. ./.:.:.:.
1414
chr21 20000051 . N . . PASS END=20000060 GT:DP:GQ ./.:.:. 0/0:40:20 ./.:.:.
1515
chr21 20000098 . N . . PASS END=20000110 GT:DP:GQ ./.:.:. 0/0:70:21 ./.:.:.

‎example/callsonly/call_merge.vcf.gz

2 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

‎example/happy/expected-stratified.extended.csv

+49,215
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Type,Filter,TRUTH.TOTAL,TRUTH.TP,TRUTH.FN,QUERY.TOTAL,QUERY.FP,QUERY.UNK,FP.gt,METRIC.Recall,METRIC.Precision,METRIC.Frac_NA,TRUTH.TOTAL.TiTv_ratio,QUERY.TOTAL.TiTv_ratio,TRUTH.TOTAL.het_hom_ratio,QUERY.TOTAL.het_hom_ratio
2+
INDEL,ALL,9126,8532,594,14475,367,5375,18,0.934911,0.95967,0.37133,,,1.4244024458,1.93149834437
3+
INDEL,PASS,9126,8532,594,14449,366,5350,18,0.934911,0.959776,0.370268,,,1.4244024458,1.9267232457
4+
SNP,ALL,51016,50157,859,70641,130,20405,60,0.983162,0.997412,0.288855,2.08128510176,1.85179356817,1.59334960342,2.28952886901
5+
SNP,PASS,51016,50156,860,70551,130,20316,60,0.983143,0.997412,0.287962,2.08128510176,1.85242059323,1.59334960342,2.28640686183

‎src/sh/compare_extended.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ def main():
6868
print >> sys.stderr, "-------------------------"
6969
sys.exit(1)
7070

71+
print "Comparing %i labels and %i metrics..." % (len(all_labels_1), len(all_keys_1))
72+
7173
different_metrics = []
7274

7375
for label in all_labels_1:
7476
for metric in all_keys_1:
75-
print label + "/" + metric
76-
7777
v1 = data1[label][metric]
7878
v2 = data2[label][metric]
7979

‎src/sh/run_gvcf_homref_test.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ${HCDIR}/multimerge ${DIR}/../../example/homref/homref.vcf.gz \
3838
diff -I ^# ${TF} ${DIR}/../../example/homref/expected_merge.vcf
3939

4040
if [ $? -ne 0 ]; then
41-
echo "GVCF homref test FAILED. You can inspect ${TF} for the failed result."
41+
echo "GVCF homref test FAILED. You can inspect ${TF} for the failed result. // diff -I ^# ${TF} ${DIR}/../../example/homref/expected_merge.vcf"
4242
exit 1
4343
else
4444
echo "GVCF homref test SUCCEEDED."
@@ -67,7 +67,7 @@ ${HCDIR}/multimerge ${DIR}/../../example/callsonly/call_merge.vcf.gz:* \
6767
diff ${TF} ${DIR}/../../example/callsonly/expected_callsonly.vcf
6868

6969
if [ $? -ne 0 ]; then
70-
echo "GVCF homref + Variants test FAILED. You can inspect ${TF} for the failed result."
70+
echo "GVCF homref + Variants test FAILED. You can inspect ${TF} for the failed result. // diff ${TF} ${DIR}/../../example/callsonly/expected_callsonly.vcf"
7171
exit 1
7272
else
7373
echo "GVCF homref + Variants test SUCCEEDED."
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
3+
# Quantification and GA4GH intermediate file format compliance
4+
#
5+
6+
set +e
7+
8+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
9+
. ${DIR}/detect_vars.sh
10+
11+
echo "Quantify stratified counting test for ${HCVERSION} from ${HCDIR}"
12+
13+
HG38=${DIR}/../../example/happy/hg38.chr21.fa
14+
15+
TMP_OUT=`mktemp -t happy.XXXXXXXXXX`
16+
17+
# run hap.py on NA12878 test file
18+
# note this only works if we don't change the confident regions
19+
# based on the truthset
20+
${PYTHON} ${HCDIR}/hap.py \
21+
-l chr21 \
22+
${DIR}/../../example/happy/PG_NA12878_hg38-chr21.vcf.gz \
23+
${DIR}/../../example/happy/NA12878-GATK3-chr21.vcf.gz \
24+
-f ${DIR}/../../example/happy/PG_Conf_hg38-chr21.bed.gz \
25+
-r ${HG38} \
26+
-o ${TMP_OUT} \
27+
--stratification ${DIR}/../../example/happy/stratification.tsv \
28+
--force-interactive
29+
30+
if [[ $? != 0 ]]; then
31+
echo "hap.py failed!"
32+
exit 1
33+
fi
34+
35+
# This script checks if the summary precision / recall figures have changed significantly
36+
${PYTHON} ${DIR}/compare_summaries.py ${TMP_OUT}.summary.csv ${DIR}/../../example/happy/expected-stratified.summary.csv
37+
if [[ $? != 0 ]]; then
38+
echo "All summary differs! -- diff ${TMP_OUT}.summary.csv ${DIR}/../../example/happy/expected-stratified.summary.csv"
39+
exit 1
40+
fi
41+
42+
# This script checks if the extended precision / recall figures have changed significantly
43+
${PYTHON} ${DIR}/compare_extended.py ${TMP_OUT}.extended.csv ${DIR}/../../example/happy/expected-stratified.extended.csv
44+
if [[ $? != 0 ]]; then
45+
echo "All extended differs! -- diff ${TMP_OUT}.extended.csv ${DIR}/../../example/happy/expected-stratified.extended.csv"
46+
exit 1
47+
fi
48+
49+
rm -rf ${TMP_OUT}.*

‎src/sh/run_tests.sh

+14
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,20 @@ else
215215
echo "Quantify integration test SUCCEEDED!"
216216
fi
217217

218+
##############################################################
219+
# Test GA4GH stratified quantification
220+
##############################################################
221+
222+
/bin/bash ${DIR}/run_quantify_stratification_test.sh
223+
224+
if [[ $? -ne 0 ]]; then
225+
echo "Quantify stratification test FAILED!"
226+
exit 1
227+
else
228+
echo "Quantify stratification test SUCCEEDED!"
229+
fi
230+
231+
218232
##############################################################
219233
# Test PG Counting
220234
##############################################################

0 commit comments

Comments
 (0)
Please sign in to comment.