From b1c2e3a1d5e7756c774515cc3bc55447591e8cf1 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Thu, 16 May 2024 03:43:49 -0500 Subject: Write json file for traits --- scripts/precompute/list-traits-to-compute.scm | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'scripts/precompute') diff --git a/scripts/precompute/list-traits-to-compute.scm b/scripts/precompute/list-traits-to-compute.scm index ea3a013..75e121a 100755 --- a/scripts/precompute/list-traits-to-compute.scm +++ b/scripts/precompute/list-traits-to-compute.scm @@ -19,6 +19,10 @@ test connection with mysql client: mysql -uwebqtlout -pwebqtlout -A -h 127.0.0.1 -P 3306 db_webqtl -e "show tables;" +you can ignore the IPv6 message: + + bind [::1]:3306: Cannot assign requested address + to create a clean slate, for now, update Locus_old with update ProbeSetXRef set Locus_old=NULL; @@ -69,6 +73,7 @@ When that is the case we might as well write the phenotype file because we have ; (rnrs base) (ice-9 getopt-long) (ice-9 match) + (ice-9 textual-ports) (json) (srfi srfi-1) ) @@ -77,12 +82,13 @@ When that is the case we might as well write the phenotype file because we have (define (write-json id recs) (display id) (newline) - (write (scm->json-string (map (lambda (r) - (match (pk r) - [(strain-id . value) (cons (bxd-name strain-id) value)] - )) - (reverse recs)))) - (newline) + (call-with-output-file (string-append (number->string id) ".json") + (lambda (port) + (put-string port (scm->json-string (map (lambda (r) + (match r + [(strain-id . value) (cons (bxd-name strain-id) value)] + )) + (reverse recs)))))) ) (define (write-phenotypes first-id num batch-size) -- cgit v1.2.3