about summary refs log tree commit diff
path: root/gn
diff options
context:
space:
mode:
Diffstat (limited to 'gn')
-rw-r--r--gn/data/genotype.scm23
-rw-r--r--gn/runner/gemma.scm9
2 files changed, 29 insertions, 3 deletions
diff --git a/gn/data/genotype.scm b/gn/data/genotype.scm
new file mode 100644
index 0000000..c7cb63c
--- /dev/null
+++ b/gn/data/genotype.scm
@@ -0,0 +1,23 @@
+(define-module (gn data genotype)
+  #:use-module (json)
+  #:use-module (ice-9 match)
+  #:use-module (ice-9 format)
+  #:use-module (ice-9 iconv)
+  #:use-module (ice-9 receive)
+  #:use-module (ice-9 string-fun)
+  ;; #:use-module (gn db sparql)
+  #:use-module (dbi dbi)
+  #:use-module (gn db mysql)
+  #:use-module (gn data group)
+  #:use-module (gn util convert)
+
+  #:export (
+            geno-inds-bxd
+            ))
+
+(define (geno-inds-bxd fn)
+  (let [(js (call-with-input-file fn
+              (lambda (port)
+                (json->scm port))))]
+    (vector->list (assoc-ref (car (vector->list (assoc-ref js "genofile"))) "sample_list"))
+))
diff --git a/gn/runner/gemma.scm b/gn/runner/gemma.scm
index 31a14f7..d9e43eb 100644
--- a/gn/runner/gemma.scm
+++ b/gn/runner/gemma.scm
@@ -17,13 +17,16 @@
   (display traits)
   (newline)
   ;; ---- write phenotype file
-  (call-with-output-file "test.tmp"
+  (call-with-output-file "pheno.txt"
     (lambda (port)
       (write 12 port)
       (newline port)
       (write "HELLO" port)
       ))
+  ;; set up with ./.guix-shell -- guile -L . -s ./scripts/precompute/precompute-hits.scm
 
-  ;; ---- start GEMMA precompute
-  (system "gemma")
+  ;; ---- to start GEMMA precompute inside container
+  ;; env LD_LIBRARY_PATH=$GUIX_ENVIRONMENT/lib/ guile -L . -s ./scripts/precompute/precompute-hits.scm
+  ;; --- First we compute K
+  (system (string-append "env GEMMA_COMMAND=/gemma/bin/gemma /gemma-wrapper/bin/gemma-wrapper --debug -- -gk -g BXD.8_geno.txt.gz -p pheno.txt -a BXD.8_snps.txt"  ))
   )