diff options
author | Pjotr Prins | 2017-08-14 09:59:42 +0000 |
---|---|---|
committer | Pjotr Prins | 2017-08-14 10:21:25 +0000 |
commit | d9556d0aa21a084bd39f0188c88c8c3f09f71ab4 (patch) | |
tree | 435d53ad9fad4a43ad55e15f76a8897e91f851b5 /test | |
parent | ff1252fe3db1ba639fe148f45b0408a4f182da0d (diff) | |
download | pangemma-d9556d0aa21a084bd39f0188c88c8c3f09f71ab4.tar.gz |
Issue 58, add tests for GSLv2 NaN's showing up with covariates
https://github.com/genetics-statistics/GEMMA/issues/58
Diffstat (limited to 'test')
-rwxr-xr-x | test/test_suite.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/test_suite.sh b/test/test_suite.sh index 625298e..71901d7 100755 --- a/test/test_suite.sh +++ b/test/test_suite.sh @@ -80,6 +80,37 @@ testMultivariateLinearMixedModel() { assertEquals "139867" `wc -w < $outfn` assertEquals "4029037056.54" `perl -nle 'foreach $x (split(/\s+/,$_)) { $sum += sprintf("%.2f",(substr($x,,0,6))) } END { printf "%.2f",$sum }' $outfn` } + +testPlinkStandardRelatednessMatrixK() { + testname=testPlinkStandardRelatednessMatrixK + datadir=../example + outfn=output/$testname.sXX.txt + rm -f $outfn + $gemma -bfile $datadir/HLC \ + -gk 2 -o $testname + assertEquals 0 $? + assertEquals 0 $? + assertEquals "427" `wc -l < $outfn` + assertEquals "-358.07" `perl -nle 'foreach $x (split(/\s+/,$_)) { $sum += sprintf("%.2f",(substr($x,,0,6))) } END { printf "%.2f",$sum }' $outfn` +} + +# Test for https://github.com/genetics-statistics/GEMMA/issues/58 +# fixed GSLv2 NaN's that appeared with covariates. +testPlinkMultivariateLinearMixedModel() { + testname=testPlinkMultivariateLinearMixedModel + datadir=../example + $gemma -bfile $datadir/HLC \ + -k output/testPlinkStandardRelatednessMatrixK.sXX.txt \ + -lmm 1 \ + -maf 0.1 \ + -c $datadir/HLC_covariates.txt \ + -o $testname + assertEquals 0 $? + outfn=output/$testname.assoc.txt + assertEquals "223243" `wc -l < $outfn` + assertEquals "89756559859.06" `perl -nle 'foreach $x (split(/\s+/,$_)) { $sum += sprintf("%.2f",(substr($x,,0,6))) } END { printf "%.2f",$sum }' $outfn` +} + shunit2=`which shunit2` if [ -x "$shunit2" ]; then |