about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPjotr Prins2025-11-28 07:31:12 +0100
committerPjotr Prins2025-11-28 07:31:12 +0100
commit06f1f9fb6479bf12b63678e9fbe274bad48befe6 (patch)
treebeeff02d3df0e81687fe8b8d7c1432bd7c4127b7
parent2f823be7ec6eebc3df6089df6e29af8f4f4efd63 (diff)
downloadpangemma-06f1f9fb6479bf12b63678e9fbe274bad48befe6.tar.gz
Improving test
-rw-r--r--test/lmm-integration-tests.scm16
1 files changed, 13 insertions, 3 deletions
diff --git a/test/lmm-integration-tests.scm b/test/lmm-integration-tests.scm
index 7b9ca3e..90858ce 100644
--- a/test/lmm-integration-tests.scm
+++ b/test/lmm-integration-tests.scm
@@ -8,21 +8,31 @@ exec guile --debug -s "$0" "$@"
   #:use-module (srfi srfi-1)  ; for last
   #:use-module (srfi srfi-13)
   #:use-module (srfi srfi-64) ; for tests
+  #:use-modules (ice-9 ftw)   ; delete file
   #:use-module (ice-9 rdelim)
   )
 
+(define kinship-fn "./output/mouse_hs1940.cXX.txt")
+(define gwa-fn "./output/mouse_hs1940.assoc.txt")
+
 (test-begin "uvlmm-kinship-run")
 
-(let [(err (system "./build/bin/Debug/gemma -g ./example/mouse_hs1940.geno.txt.gz -p ./example/mouse_hs1940.pheno.txt -gk -o mouse_hs1940 -debug"))]
+(when (file-exists? kinship-fn)
+  (delete-file kinship-fn))
+(let [(err (system "./build/bin/Debug/gemma -g ./example/mouse_hs1940.geno.txt.gz -gk -o mouse_hs1940 -debug"))]
   (test-eqv 0 err))
 
 (test-end "uvlmm-kinship-run")
 
 (test-begin "uvlmm-gwa-run")
 
-(let [(err (system "./build/bin/Debug/gemma -g ./example/mouse_hs1940.geno.txt.gz -p ./example/mouse_hs1940.pheno.txt -n 1 -a ./example/mouse_hs1940.anno.txt -k ./output/mouse_hs1940.cXX.txt -o mouse_hs1940 -lmm 9 -debug"))]
+(when (file-exists? gwa-fn)
+  (delete-file gwa-fn))
+;; The following integration test runs gemma uvlmm and adds up the output column as a check.
+;; It uses the kinship-run matrix from the earlier test
+(let [(err (system (string-append "./build/bin/Debug/gemma -g ./example/mouse_hs1940.geno.txt.gz -p ./example/mouse_hs1940.pheno.txt -n 1 -a ./example/mouse_hs1940.anno.txt -k " kinship-fn " -o mouse_hs1940 -lmm 9 -debug")))]
   (test-eqv 0 err))
-(call-with-input-file "output/mouse_hs1940.assoc.txt"
+(call-with-input-file gwa-fn
   (lambda (port)
     (read-line port)  ; skip first line
     (let* ((fields (string-split (read-line port) #\tab))