aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPjotr Prins2024-05-16 03:43:49 -0500
committerPjotr Prins2024-05-16 03:43:49 -0500
commitb1c2e3a1d5e7756c774515cc3bc55447591e8cf1 (patch)
tree19ac9fe8879385c934cd831e7c2766cab6520edd
parent31ea2b879d23d23b3389b9c3da59dba067c9f0f9 (diff)
downloadgn-guile-b1c2e3a1d5e7756c774515cc3bc55447591e8cf1.tar.gz
Write json file for traits
-rw-r--r--README.md2
-rwxr-xr-xscripts/precompute/list-traits-to-compute.scm18
2 files changed, 14 insertions, 6 deletions
diff --git a/README.md b/README.md
index 7c5a47c..6005264 100644
--- a/README.md
+++ b/README.md
@@ -18,10 +18,12 @@ GNU Guile allows you to develop against a live running web server using emacs-ge
```sh
cd web
+unset GUIX_PROFILE
. .guix-shell -- guile --listen=1970 -e main ./webserver.scm 8091
```
Note the leading dot. The .guix-shell is defined in `genenetwork3/gn3-guile/web` and loads required packages using GNU Guix.
+If you are on Debian you may need to unset GUIX_PROFILE first.
Next fire up emacs with `emacs-geiser-guile` and connect to the running web server with `M-x geiser-connect` and the port `1970`. Now you can not only inspect procedures, but also update any prodedure on the live server using `C-M-x` and get updated output from the webserver!
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)