aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPjotr Prins2024-01-06 18:23:27 +0100
committerPjotr Prins2024-01-06 18:23:27 +0100
commit1c46296016ead8a5fa17ff291eeabbd0a0c63e4b (patch)
tree2ea04dab40e91eef942fc2d6abec5530f1112ed6
parent902cf907e9b315f52b2ef3b4b791e492a87e6437 (diff)
downloadgn-guile-1c46296016ead8a5fa17ff291eeabbd0a0c63e4b.tar.gz
Tracking metadat for GN DB
-rw-r--r--gn/runner/gemma.scm10
-rwxr-xr-xscripts/precompute/precompute-hits.scm4
2 files changed, 9 insertions, 5 deletions
diff --git a/gn/runner/gemma.scm b/gn/runner/gemma.scm
index d86abd7..89b6482 100644
--- a/gn/runner/gemma.scm
+++ b/gn/runner/gemma.scm
@@ -1,6 +1,7 @@
(define-module (gn runner gemma)
#:use-module (json)
#:use-module (gn data genotype)
+ #:use-module (gn util convert)
#:use-module (ice-9 match)
#:use-module (ice-9 format)
#:use-module (ice-9 iconv)
@@ -12,13 +13,16 @@
run-gemma
))
-(define (run-gemma population data-id name trait-name traits)
+(define (run-gemma population data-id probeset-id probesetfreeze-id name trait-name traits)
"Run gemma-wrapper to compute GRM and GWA. On failure the run will stop(!)"
(define bxd-inds (geno-inds-bxd "BXD.json"))
+ (define ids (string-append (int-to-string data-id) ","
+ (int-to-string probeset-id) ","
+ (int-to-string probesetfreeze-id)))
(assert (= 235 (length bxd-inds)))
(if name
(display (string-append "WE HAVE OUR " population " DATASET " name " and trait " trait-name " for precompute!\n")))
- (display data-id)
+ (display ids)
(display traits)
(newline)
;; ---- write phenotype file
@@ -51,7 +55,7 @@
(let [(err (system (string-append "env GEMMA_COMMAND=gemma /gemma-wrapper/bin/gemma-wrapper --population \"" population "\" --name \"" name "\" --trait \"" trait-name "\" --verbose --loco --json --parallel -- -gk -g BXD.8_geno.txt.gz -p " pheno-fn " -a BXD.8_snps.txt > " k-json-fn )))]
(if (not (= err 0))
(exit err)))
- (let [(err (system (string-append "env GEMMA_COMMAND=gemma /gemma-wrapper/bin/gemma-wrapper --population \"" population "\" --name \"" name "\" --trait \"" trait-name "\" --verbose --loco --json --parallel --input " k-json-fn " -- -g BXD.8_geno.txt.gz -p " pheno-fn " -a BXD.8_snps.txt -lmm 2 -maf 0.1 > " gwa-json-fn)))]
+ (let [(err (system (string-append "env GEMMA_COMMAND=gemma /gemma-wrapper/bin/gemma-wrapper --population \"" population "\" --name \"" name "\" --id \"" ids "\" --trait \"" trait-name "\" --verbose --loco --json --parallel --input " k-json-fn " -- -g BXD.8_geno.txt.gz -p " pheno-fn " -a BXD.8_snps.txt -lmm 2 -maf 0.1 > " gwa-json-fn)))]
(if (not (= err 0))
(exit err)))
(delete-file pheno-fn)
diff --git a/scripts/precompute/precompute-hits.scm b/scripts/precompute/precompute-hits.scm
index f33e7e9..8f27bbe 100755
--- a/scripts/precompute/precompute-hits.scm
+++ b/scripts/precompute/precompute-hits.scm
@@ -99,12 +99,12 @@ ssh -L 3306:127.0.0.1:3306 -f -N tux02.genenetwork.org
((id . value) (cons (assoc-ref bxd-strains id) value)
)))
id_traits))
- (display traits)
+ ;; (display traits)
;; (if (= 0 (length non-bxd))
(if (eq? non-bxd '())
(begin
(set-precompute-hit-status! db data-id-str "GEMMA-START")
- (run-gemma "BXD" data-id name trait-name traits)
+ (run-gemma "BXD" data-id probeset-id probesetfreeze-id name trait-name traits)
(set-precompute-hit-status! db data-id-str "GEMMA-DONE"))
;; disable precompute if non-bxd, for now, so it won't try again
(set-precompute-hit-status! db data-id-str "NON-BXD"))