diff options
Diffstat (limited to 'scripts/precompute/list-traits-to-compute.scm')
-rwxr-xr-x | scripts/precompute/list-traits-to-compute.scm | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/scripts/precompute/list-traits-to-compute.scm b/scripts/precompute/list-traits-to-compute.scm index 75e121a..7e0660d 100755 --- a/scripts/precompute/list-traits-to-compute.scm +++ b/scripts/precompute/list-traits-to-compute.scm @@ -76,20 +76,26 @@ When that is the case we might as well write the phenotype file because we have (ice-9 textual-ports) (json) (srfi srfi-1) + (srfi srfi-19) ; time ) (define (write-json id recs) (display id) (newline) - (call-with-output-file (string-append (number->string id) ".json") - (lambda (port) - (put-string port (scm->json-string (map (lambda (r) + (let* [(traits (map (lambda (r) (match r [(strain-id . value) (cons (bxd-name strain-id) value)] )) - (reverse recs)))))) - ) + (reverse recs))) + (json-data `((meta . + ((id . ,id) + (time . ,(date->string (time-utc->date (current-time)))))) + (traits . ,traits)))] + (call-with-output-file (string-append (number->string id) ".json") + (lambda (port) + (put-string port (scm->json-string json-data)))) + )) (define (write-phenotypes first-id num batch-size) (call-with-db |