about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
authorPjotr Prins2017-08-27 08:57:15 +0200
committerGitHub2017-08-27 08:57:15 +0200
commit523275386b5644a20be6a309d54d9497029462db (patch)
treeee7fe2693b3174328e46a22454edeb9e64cfc021 /test
parent2554242d10b9a7b58bd6c7df82a10e747b6cc0eb (diff)
parenta1984edf45653c46ff430de3958449459532cb6f (diff)
downloadpangemma-523275386b5644a20be6a309d54d9497029462db.tar.gz
Merge pull request #79 from genenetwork/issue78
Issue78
Diffstat (limited to 'test')
-rwxr-xr-xtest/dev_test_suite.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/test/dev_test_suite.sh b/test/dev_test_suite.sh
index 0b65c1e..9e49251 100755
--- a/test/dev_test_suite.sh
+++ b/test/dev_test_suite.sh
@@ -2,6 +2,52 @@
 
 gemma=../bin/gemma
 
+
+# Related to https://github.com/genetics-statistics/GEMMA/issues/78
+testBXDStandardRelatednessMatrixKSingularError() {
+    outn=BXDerr
+    rm -f output/$outn.*
+    $gemma -g ../example/BXD_geno.txt.gz \
+           -p ../example/BXD_pheno.txt \
+           -c ../example/BXD_covariates.txt \
+           -a ../example/BXD_snps.txt \
+           -gk \
+           -debug -o $outn
+    assertEquals 22 $? # should show singular error
+}
+
+testBXDStandardRelatednessMatrixK() {
+    outn=BXD
+    rm -f output/$outn.*
+    $gemma -g ../example/BXD_geno.txt.gz \
+           -p ../example/BXD_pheno.txt \
+           -c ../example/BXD_covariates2.txt \
+           -a ../example/BXD_snps.txt \
+           -gk \
+           -debug \
+           -o $outn
+    assertEquals 0 $?
+    outfn=output/$outn.cXX.txt
+    assertEquals "198" `wc -l < $outfn`
+    assertEquals "-116.11" `perl -nle 'foreach $x (split(/\s+/,$_)) { $sum += sprintf("%.2f",(substr($x,,0,6))) } END { printf "%.2f",$sum }' $outfn`
+}
+
+testBXDMultivariateLinearMixedModel() {
+    $gemma -g ../example/BXD_geno.txt.gz \
+           -p ../example/BXD_pheno.txt \
+           -c ../example/BXD_covariates2.txt \
+           -a ../example/BXD_snps.txt \
+           -k ./output/BXD.cXX.txt \
+           -lmm 2 -maf 0.1 \
+           -debug \
+           -o BXD_mvlmm
+    assertEquals 0 $?
+
+    outfn=output/BXD_mvlmm.assoc.txt
+    assertEquals "65862" `wc -w < $outfn`
+    assertEquals "3088489421.94" `perl -nle 'foreach $x (split(/\s+/,$_)) { $sum += sprintf("%.2f",(substr($x,,0,6))) } END { printf "%.2f",$sum }' $outfn`
+}
+
 testCenteredRelatednessMatrixKLOCO1() {
     outn=mouse_hs1940_LOCO1
     rm -f output/$outn.*